# Interpreting FFT Output?

This topic is 3171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! I'm trying to do some basic audio processing, an area that I'm not yet very familiar with. I want to calculate the amplitude of a wave with some arbitrary frequency 'f', if such a wave is indeed a part of the series of waves that compose my signal. If my (very limited) understanding of the Fourier Transform is correct, the output from a FFT should give me the information I need. I've found several C implementations of FFT online, but I don't quite understand how to extract the information I need from their output. They all seem to accept some N^2 complex samples and return N^2 complex samples. Perhaps someone could explain how the amplitudes are calculated from the complex number samples? Also, how do I know which output samples correspond to which frequencies? Thanks in advance for any help. Stas B.

##### Share on other sites
1. The amplitude is the absolute value of the complex number
|a + b i| = sqrt(a^2 + b^2)
and the phase is its 'argument' or 'angle,'
arg(a + b i) = atan2(b, a)

2. Usually the highest index corresponds to the sampling frequency (call it 'Fs'), so your output is over the range [0, Fs]. The top half of the array, over the interval (-Fs/2,Fs] is just a repeat of the lower half though (in terms of magnitude, that is; phase has the opposite sign.) (Also, since the DFT's (Discrete Fourier Transform's) output is periodic, it helps to think of it rewrapped to the range [-Fs/2, Fs/2]. Then it has Hermetian symmetry (which is basically all I was saying about the array)).

3. If you're trying to learn this stuff, I recommend Oppenheim & Schafer; it's what electrical engineering students the world 'round use.

4. In your post, I think you meant "2^N," not "N^2."

##### Share on other sites
Thank you very much for the clarification!
It makes sense now.

##### Share on other sites
Hm I am not quite sure but most
FFT algorithms should have Fs/2 as their
highest detectable frequency.
As described in Nyquist-Shannon's sampling theorem
your sampling rate needs to be at least 2 times bigger
than the highest frequency you want to be able to detect.

##### Share on other sites
It's not that the FFT algorithm can't detect higher frequencies. The fundamental properties of discrete-time sampling means frequencies above half the sampling frequency doesn't even exist in the first place.

##### Share on other sites
To elaborate on Brother Bob's point... In principle, you can certainly detect energy that occurs at higher frequencies than Fs/2, but it will be aliased down; e.g., energy from (1 + 1/4)Fs ends up in the same bin as energy from (1/4)Fs.

That said, all this is moot, because we're talking about programming computers, not designing hardware, and the sampling has already taken place. And whoever designed the sound card put an analog filter (called an antialiasing filter) in front of the sampler to eliminate frequencies above Fs/2 before sampling... so aliasing is not an issue.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013598
×