3
$\begingroup$

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?

$\endgroup$

2 Answers 2

5
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – some_id
    Commented Mar 26, 2014 at 0:42
  • 1
    $\begingroup$ 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. $\endgroup$
    – user2718
    Commented Mar 26, 2014 at 2:02
5
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ 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? $\endgroup$
    – some_id
    Commented Mar 26, 2014 at 0:28
  • 2
    $\begingroup$ 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. $\endgroup$
    – hotpaw2
    Commented Mar 26, 2014 at 0:31
  • $\begingroup$ 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? $\endgroup$
    – some_id
    Commented Mar 26, 2014 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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