FFT in Max/Msp
Jul 15, 2013 at 7:16am
FFT in Max/MspHey, so I was looking at the tutorial #25 in MSP, and I had several questions about using fft. When the sample analyzed is no longer a sinosuid or periodic, it seems that you have to window it to eliminate erroneous signals, but would the artifacts created by the FFT object and the windowing somehow tamper and mishandle the original data? I know you can use pfft~ also, but how would that affect the original data? Also, it suggests splitting data of samples that are longer than 1024 into different sections, but I am hoping to directly perform FFT on at least 10000 samples at a time, so how would the larger amount of samples affect analysis? I also don’t understand why 512 samples is so important (well in the tutorial) and while I know the concept of fundamental frequency, how is 512 samples the fundamental frequency in this case? And in order for FFT to process it, does it have to be a signal first? would I use “*~” or “cycle~” or both? And if the number of samples is not a power of 2, which is needed for the algorithm of FFT, how will that affect how things run? 

Jul 15, 2013 at 8:12am
I will try to give you some answers, but english is not my native language and this is a complicated topic, so I don’t know how much I will be able to help you.
The reason why you have to window the original signal is that the fourier transform assumes that the signal is periodic. If you take little slices of a longer signal (sample), for example you have a sample that has a length of 20 seconds and you slice it into parts that are 1024 samples long, the fft will assume, that each of these 1024 samples long slices is a periodic waveform and that after the end of each slice (at sample 1023) the waveform jumps back (loops) to the beginning (sample 0). 

Jul 15, 2013 at 8:27am
If you do a fft on a 1024 samples long signal, it will give you the frequency contents of that 1024 long section, if you take the fft on over 10000 samples long signal it will give you the frequency contents of that over 10000 samples long section. So how long you make the section depends on what you want to do, what you want to analyze. Also it has an effect on the “resolution” of the fft, I will explain that later and of course on the latency, because you have to “collect” the more than 10000 samples before you can perform a fft on it.
I think you’re mistaking the fundamental frequency of your input signal for the fundamental frequency of the fft. The fourier transform tells you, how to reconstruct a periodic signal by using siniod waves that have integer frequency ratios. So for example, if you do a fft on a 512 samples long signal, the fft will “deconstruct” it into sine waves that have lengths of 512 samples, 256, 128, 64…. and so on plus a dc offset. The fft will give you the amplitude and phase of each of these sine waves (at least after some more calculations). 

Jul 15, 2013 at 8:37am
Well yes, the fft analyzes signals. But then again, a digital signal is just a stream of numbers. I don’t know what “*~” or “cycle~” have to do with this. What are you trying to do?
The number of samples have to be a power of 2 because of the fft algorithm, which is much, much, much faster than a “normal” fourier transform. You could take 16384 (2^14) for example. On http://www.dspguide.com you can find a free online book, that also explains fourier transform as less math as possible. 
You must be logged in to reply to this topic.