![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: general FFT questions | |
johannes Member |
![]() ![]() ![]() hello, i have 3 basic kyma fft questions: 1. i wonder if it would be possible to process fft data at framerate instead of doing it at samplerate. lets say i want to randomize the phases (after convert from cartesian to polar) by adding random amounts (between 0 and pi) to all phasevalues before convert back to cartesian coords. would it be possible to write fftsize/2 sample of my phase data into a wavetable and add an array of randomnumbers to it? 2. is it possible to use hopsizes greater than fftsize/2 and fftsizes greater than 1024? 3. i am still a bit confused about the output of fft. regarding the "fft 512 analysis" prototype the thanks for your help to make me understand, IP: Logged | |
gustl Member |
![]() ![]() ![]() Hi johannes, I'm not the real pro regarding this but maybe I can help: 1. Isn't the FFT data already framebased? e.g. A 512 point FFT is represented in 512 samples so 1 frame is 512 samples long. I'm not sure if I understand everything correctly but if you want to add random numbers to all phases you don't need to care about the frame, just use a noise module and a mixer. If you want to add the same random generated value for all phases in one frame you can use a SampleAndHold module with FFTsize samp Hold time after the noise. 2. Yes. But the FFTsize hast to be a power of 2. 3. I think the delayed and undelayed signal are just made up to process a mono signal. If you change the delayed signal to a Constant 0 and use only the left output of the inv FFT you get the same signal back. So I think the FFT module is made for 2-channel (Stereo) Input and therefore you are actually doing a 256 point FFT for 2 channels when choosing an FFTsize of 512.
IP: Logged | |
johannes Member |
![]() ![]() ![]() hey gustl, thanks for taking the time. 1: the other reason i asked for the processingrate was because i would like to use capytalk scripts to mangle the fft data. e.g modulo, divide, etc yes, i already used white noise for that. great hint with the sample and hold!
3:
[This message has been edited by johannes (edited 07 May 2014).] IP: Logged | |
gustl Member |
![]() ![]() ![]() no problem ![]() 1: I don't know what hopsize means but in Kyma it works like this: The FFT module has got 2 inputs (left, right). When you start the Sound there's a short delay (3 * FFTsize samples at FFTsize 512) for buffering/calculating. Then it will output the complex numbers (left = real, right = imaginary) at samplerate. Each sample represents one bin so when you do a FFT with size 512 each 256 samples represent 1 frame (alternating between left and right input - see 3 below). 2: No, I think for overlaps you'd have to use 2 FFT modules and make up the timing and the windowing yourself. 3: The FFT module is alternating between the left and the right input. So for 256 samples (again for 512 point FFT) it will output the complex numbers of the left input and for another 256 samples it will output the complex numbers of the right input. An FFTsize of 512 actually is a 2 channel 256 point FFT. Select the FFT module and go to Info -> Describe Sound. It's basically all in there IP: Logged | |
gustl Member |
![]() ![]() ![]() add 2: By thinking about this again I think you can use the 2 inputs to do the overlapping windows best wishes, IP: Logged | |
pete Member |
![]() ![]() ![]() Hi Johannes I think you can have FFT frame sizes greater than 1024 but only on the paca(rana) (not the capybara). Gustl is right, but there are a few things to note about the FFT Module (assuming it hasn't changed lately). The left and right input expect two different signals but they are analyzed at the same frame edge so to achieve the half frame overlap you need to delay one leg. Also you will probably need windowing of the two overlapping frames and this has to be done before feeding the left and right inputs. The output of the module gives a stream of pairs of values (left reals and right imagins) in alternating frames, left input result right input result etc. So if your FFT length was 1024 samples you would get 512 pairs of points of the left inputs results followed by 512 pairs of points of the right inputs results. But heres the crunch. The first 512 point start with DC then 1,2 3 harmonic, but the second 512 point come out in reverse order, harmonic 511,510 all the way down to DC. The inverse FFT module expects this forward backward arrangement of the partials and will output the two simultaneous (time domain) frames on the left and right output, but with the frame edges in sync. So you will need to delay the one leg you didn't delay on the way in, before combining them to get the clean mono output signal. I think we worked out that the overall route from in to out (with the delays and processing time) took a total of 7.5 frames. If you have a capybara I may have some old DSP code I through together that didn't use FFT, but used my own FT algorithm, that was not so efficient but had a lower latency and dealt with the windowing , overlapping and outputted the partials from DC upwards all the time. It had an overall latency of 1.5 frames, but it cannot be used on the Paca(rana). As gustl said if you want the data in tables you would have to record the streams of data into the tables (at sample rate). This is in effect what is happening with the other table based FFTs except that the streaming is done before hand. For quarter frame overlapping you would need two sets of FFTs and would have to have different input and output delays to shift the frames to the correct place. I don't know how you would deal with two stereo streams of data but I suspect there are ways. I hope this makes sense And just in passing, it's not the Z-Plane, it's BarbieCam. Pete IP: Logged | |
gustl Member |
![]() ![]() ![]() quote: Definitely! I didn't know the thing about the reversed bins, thanks for the information! This should be added to the Prototype description! BarbieCam, of course IP: Logged | |
johannes Member |
![]() ![]() ![]()
thanks for the very detailed explanations. it really helped me to understand whats going on. pete, is there a specific reason for the reverse partial order (in the fft output) for every second frame? i just worked on the 4 times overlap using the 2 inputs. with a fftsize of 1024 samples i set the delaytimes to 0 and 512 on the left and 256 and 768 samples on the right channel, than joining, windowing (frequency: fftsize), fft... too bad that capytalk wont work for direct fft processing. i already had some ideas including the use of modulo and divide... and there is no samplerate version of them (for the paca). would be perfect if we could slow down the capyrate to framerate... ciao, johannes [This message has been edited by johannes (edited 08 May 2014).] IP: Logged | |
SSC Administrator |
![]() ![]() ![]() quote: Probably because the bins are NOT reversed.
quote: See the Prototypes "Inverse 512 FFT" and "Inverse 512 FFT Windowed". Also, in Kyma Sound Library>Effects processing>SpectralProcessing-Live.kym see: "pseudo bandpass with 1024 FFT (5)" [This message has been edited by SSC (edited 08 May 2014).] IP: Logged | |
johannes Member |
![]() ![]() ![]()
for sounds with processing in the freq domain i wonder if it is good to use a second windowing module right behind the ifft resynthesis stage. IP: Logged | |
pete Member |
![]() ![]() ![]() Hi Johannes Normally with a half overlap FFT you can only window on the input or the output, as windowing in both places results in a sound with big holes. ie as if you put it through a ring modulator with an off set sine wave at 2 times frame rate. It would need odd window shapes like Square root of hann to fill in the gaps. But With a quarter overlapping FFT you can put ordinary windows on both the input and output as the extra two signals fill in the holes. I have a feeling you will get better results with windows at both ends but I've never got round to trying it. Also SSC Do the harmonics now come out in the same order for every half frame, as they used to alternate? Am I delivering old news?
[This message has been edited by pete (edited 09 May 2014).] IP: Logged | |
SSC Administrator |
![]() ![]() ![]() quote: The harmonics come out in the same order for every half frame.
quote: Possibly? Might have been that way pre-2003? IP: Logged | |
gustl Member |
![]() ![]() ![]() Hi johannes, I'm just curious: Why are you using the FFT module instead of all the ready-to-go spectral analysis possibilities? IP: Logged | |
johannes Member |
![]() ![]() ![]()
the reason i used the fft module is because i need to access the phases in order to accomplish phase randomization as a addition to magnitude smoothing. of course something similar is possible using the wire between but it will sound differently because we processing partials instead of bins. i tried a similar technic to phase randomization (via the wire in between) by adding an random amount to the right leg, also with a interesting but different result. anyway, there might be other and more efficient ways of doing this in kyma. i definitely need to encapsulate the stereo version of the patch - its a big mess now. if you try to follow than look at the mono version of the patch. all suggestions, idea´s etc. are welcome. pete, thanks for the windowing suggestion. that made it work without any crackles… ciao, johannes
[This message has been edited by johannes (edited 10 May 2014).] IP: Logged | |
Roland Kuit Member |
![]() ![]() ![]()
I was just having fun with your sound. Kind regards, IP: Logged | |
gustl Member |
![]() ![]() ![]()
![]() Encapsulating doesn't make sense because then you can't access/manipulate the FFT data. You could encapsulate one module for the FFT and one for the inverse FFT but then you always have to make sure the settings match. So I just went for a Script here and merged the FFT / inverse FFT parts of the Sound. Enjoy! IP: Logged | |
johannes Member |
![]() ![]() ![]() Great. Will look into your sound the NeXT days . Did you Manage your fft-ifft timestretcher? IP: Logged | |
gustl Member |
![]() ![]() ![]() Not yet.. Did you have a look at the Sound at the Q&A? Maybe you've got an idea? IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.