Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I currently run real time audio through an FFT and the library (vDSP) returns magnitude and phase values (polar coordinates) for data in the FFT bins.

Does the bin with the highest magnitude always represent the fundamental frequency?

What exactly can the phase of the frequency bins be used for in regards to audio? What does it represent? Would that be used for audio identification, e.g. matching amplitude and phase pairs within the same bins of different audio segments?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

It is difficult to assign meaning to individual phase values in an FFT. If you wanted to reconstruct your original signal using each of the frequency components in the FFT, you would use the phase values to time align each of the sinusoids so you get the proper destructive and constructive interference to reproduce the original signal. Altering the phase relationship of the frequency components can dramatically change the time domain representation of the signal (peaks and troughs can be shifted around this way).

Phase is more meaningful when applied over a band of frequencies. The cumulative effect of phase shift over a band of frequencies can delay the attack and or decay of audio signals. This can be important in audio systems and in particular speaker design.

You can look up "Group delay and phase delay" (google or enter in wikipedia) for a discussion of how these concepts affect sound quality.

It would be very difficult to do meaningful matching of audio signals by comparing values of FFT results. You can do exact matches if things are properly time aligned, but even minor changes to the audio signals can cause major changes in FFT values. For identification or matching of sounds, more complex methods are used. For example speech recognition uses CEPSTRAL analysis which involves multiple transforms, filter banks and a log computation to create sets of "feature" coefficients (Mel frequency cepstral coefficients ) that can be compared for similarity.

share|improve this answer
    
Thanks :) At the moment I would just like to try and visualise the FFT data in various ways to help me understand more and also detect fundamentals etc. I will look into CEPSTRAL analysis. –  Helium3 Mar 26 at 0:42
    
You should also look into short time Fourier transforms and spectograms. A spectrogram is a time frequency representation of data (often audio / music and voice) that uses short time Fourier transforms to break the data (sounds) into a sequence of short, equal lenght increments (generally tens of miliseconds long) providing a frequency breakdown for each increment. The representation is a great way to visualize sound and is used in audio mastering/editing. –  user2718 Mar 26 at 2:02

The frequency bin with the highest magnitude is very often not the fundamental pitch frequency, especially for lower (male) voices and larger stringed instruments. It could instead represent a strong overtone or harmonic.

The FFT phase result is very important in representing any transient waveform shape or timing, for instance whether a note onset or percussive hit occurred toward the beginning or end of the FFT frame. It's thus not very useful in matching sounds unless the FFT frame timing is somehow very precisely matched to the sound's timing.

For a very narrow-band signals that are stationary across multiple FFT frames with known time offsets, the FFT phase results can also potentially be used for frequency estimation finer than the FFT bin spacing resolution.

share|improve this answer
    
Thanks. :) Wouldn't it be difficult to determine a note onset or percussive hit from a phase value in a FFT bin if a bin could contain data from different frequencies. If various instruments producing the same frequencies get FFTd into the same bins, can timbre be extracted from analysing groups of bins over time? –  Helium3 Mar 26 at 0:28
2  
Envelope (thus timing) information is not contained in a bin. It is contained in all bins, or at least all the ones within the sidebands of any stationary note. –  hotpaw2 Mar 26 at 0:31
    
Ahh, so accumulating a number of FFT output bins over time is a better way to look at this. So phase values in sequence for the same bin represents some sinusoid's (depending on frequency range of the bin) movement. When analysing known frequencies, can these amplitudes and phases be calculated with the frequency and sampling rate if the signal is assumed to be normalised? –  Helium3 Mar 26 at 0:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.