 # Fft

2468 Views 7 Replies 4 Participants Last post by  Al Stevens
I have in the past written DSP software that uses the FFT and its inverse to apply filters to audio waveforms. Most of the time I haven't really understood what I was doing because all the formal explanations I read about those formulae assume the reader knows more than I know. The filters I work with are usually open source algorighms-EQ, slow-downers, pitch changers,and so on. I cannot always tell how those algorithms work by reading the code because I don't fully understand the structure of the frequency domain data.

Here's what I know:

1. Begin with a block of samples from a waveform. The number of samples must be a power of 2. This is, of course, the time domain.
2. Pass the sample buffer to the FFT algorithm.
3. Apply the filter to the resulting buffer, which contains the frequency domain.
4. Pass the filtered buffer to the iFFT algorithm to convert it back to the time domain.
The explanations I read fail to describe the frequency domain buffer sufficiently that I can understand it. Here's what I think I know:

1. Each bin in the buffer represents a frequency range.
2. The bins are 0 to some upper limit, which is determined by the number of bins (I think.)
3. The value in each bin is a complex number. One part is the frequency's volume; the other part is the phase (0-359) the frequency is at when the waveform begins.

Here's what I do not understand:
1. If a waveform has a frequency occurring more than once but at different phases, how does the frequency domain represent these data? Or does it need to?
2. Many algorithms operate on the time domain buffer and then save some part of the end of the filtered time domain buffer to combine with the next buffer occuring in time. I hope that makes sense as I explained it because I do not fully understand what is going on there.
Comments? Please converse as much as possible without advanced mathematical references. It's been too long. You'll lose me. Feel free to disagree with the things that I said I do know. Because I don't really know that I know them. If you know what I mean.
See less See more
1 - 3 of 8 Posts
Al Stevens said:
...
Here's what I do not understand:
1. If a waveform has a frequency occurring more than once but at different phases, how does the frequency domain represent these data? Or does it need to?
2. Many algorithms operate on the time domain buffer and then save some part of the end of the filtered time domain buffer to combine with the next buffer occuring in time. I hope that makes sense as I explained it because I do not fully understand what is going on there.
....
1. It doesn't need to, a fourier transform takes the incoming wave form and breaks it into separate fequencies, you dont get the same fequency twice.

I am not going to attempt point two - but I'd like to read an explanation if someone else has one - I suspect that a proper worked example will require some maths...
Al Stevens said:
....

I probably should write a program that generates and mixes sine waves and displays the frequency domain data to see what it does.
or - for the traditional users out there - either:
1. plot it on graph paper
2. solve as a trig problem.
OK - you can show what happens in Excel without any fancy maths
Generate two series - one for a sine wave, and one for the same wave shifted by a suitable phase angle.

Sum these to build a third.

Deduce the single y=Asin(x+q) formula where A is the peak value for the sum and q a matching phase discrepency this is series 4.

Build series five from the differences between 3 and 4.....
1 - 3 of 8 Posts