Wednesday, April 22, 2015

SpQ15 FFT's & Spectra

FFT relies on groups of samples that are 2^n in size-in Max, default are 512 and 1024, as well as 2048 and 4096 (FFT window)

For each sample/data point, you'll get a frequency and amplitude in the spectrum--a graph of amplitude over time (waveform) becomes a graph of frequency versus amplitude--an integral

divide sample rate (48000, for ex) by FT size (1024, for ex)--> 46.875 Hz between points in frequency on the resulting graph--a harmonic series on the bin frequency

when you get up to half the sample rate, you get a mirror image

pfft~ object--needs to load in another patch, so name it: pfft~ my_pfft--then add argument for FFT size: pfft~ my_pfft 1024--next argument is overlap factor, 2 means overlap by 1/2, 4 means overlap by 1/4, etc.--pfft~ my_pfft 1024 2--input and output objects are fftin~ 1 and fftout~ 1--connect first two outlets of fftin to first two inlets of fftout

fft~ in 1 has far right outlet that's bin index, other two outlets are real and imaginary parts of it--they're graphed as x and y--if you take the same Cartesian coordinates and convert to polar, the r (radius) value gives you the amplitude of the sound, and the angle theta gives you the phase of the wave--a key element of phase vocoders--put a cartopol~ object between them, to convert Cartesian to polar coordinates

you can do inverse FFT to go from frequency domain into time domain, as well--works as a filter

spectral gate, only louder (for ex) components make it through--maximum amplitude you can get is window size divided by two or four or something--just need two objects, a > object (which sends a 1 if true and a 0 if false) and a multiply object--that gives you cool effects that only pass frequencies louder than a certain amount--basically produces a sinusoidal result--re-synthesizing based on frequency spectrum

No comments:

Post a Comment