Page 1 of 1

Spectral analysis of a pure sound

Posted: Sun Sep 08, 2013 8:13 am
by pl72
Hello,

when I generate pure sound with Audacity (say La3 to 440 Hz) and then I do the spectral analysis of the sound (with all the default options), I could expect a perfect peak at 440 Hz.
Actually I get a peak at 440 Hz with a certain width.
I do not understand why.
Can someone explain to me the reason for this width ?
Thank you very much !

Re: Spectral analysis of a pure sound

Posted: Sun Sep 08, 2013 11:02 am
by steve
I presume that you are doing the spectral analysis with Plot Spectrum.

Plot Spectrum uses a technique called "FFT" to calculate the amplitude of the selected audio across the frequency spectrum. In effect what FFT does is to split the frequency range into lots of frequency bands, and then it measures how much sound is in each frequency band.

Increasing the FFT "size" will split the spectrum into a larger number of narrower frequency bands. The number of frequency bands is equal to half of the FFT size.

Re: Spectral analysis of a pure sound

Posted: Sun Sep 08, 2013 4:27 pm
by Robert J. H.
Frequencies that coincide with a FFT bin (a frequency band) are much sharper than those which fall between two bins.
FFT assumes that the frame that holds the samples (e.g. 1024) is a perfect cycle and continues on both sides to infinity.
If we take a 440 Hz frequenzy, the cycle won't fit into a 1024 frame (with a rectangular window). In fact, the first sample will be 0 and the last 0.9634. This introduces a big step when we expand or repeat this frame on both sides. It isn't a sine wave anymore, rather a mixture with a saw tooth.
This introduces frequencies in other bins.
Windowing allows us to make the samples on both boundaries of the frame to be near zero. However, this introduces other side effects and that's why there is such a large variety of window functions.

Re: Spectral analysis of a pure sound

Posted: Sun Sep 08, 2013 4:33 pm
by kozikowski
You can increase the accuracy by dragging the analyze window larger and, as above, increase the "size" value will increase the granularity and detail of the display. You would think that a higher value is always a good thing, but in addition to taking a longer time to calculate, sometimes a single, one-pixel wide spike is impossible to see.

Koz

Re: Spectral analysis of a pure sound

Posted: Mon Sep 09, 2013 4:42 pm
by pl72
Thank you very much for your answers, I'll think about that!