What values of frequency are considered for the output of fft function?

3 views (last 30 days)
For example, when I type fft([1 2 3]) the output is [6.0000+0.0000i -1.5000+0.8660i -1.5000-0.8660i]. Which value of frequency does each output stand for?

Answers (1)

Walter Roberson
Walter Roberson on 17 Sep 2018
Generally,
The first entry is 0 cycles per frame (dc constant). The second entry is one cycle per frame. The third entry is two cycles per frame, the 4th is 3 cycles per frame, and so on, increasing by one cycle per frame for each entry, but only until half way through the entries. After that it decreases one by one until the last is 1 cycle per frame. There is no 0 cycles entry at the right hand side.
Now, fft() does not know or care how long the frame was in physical units. It cannot tell the difference between 100000 samples representing 2 seconds of 50kHz, compared to 10 seconds of 10 kHz. You need to use your knowledge of the recording conditions to figure out what the physical meaning is for a cycle per frame.
I recommend looking at the first example in the fft documentation to see how Hz is calculated for label purposes.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!