Spectral analysis of a pure sound

Feedback and Reviews for Audacity 2.x
Forum rules
This board is ONLY for general feedback and discussion about Audacity 2.X.

If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
pl72
Posts: 6
Joined: Sun Sep 08, 2013 7:49 am
Operating System: Please select

Spectral analysis of a pure sound

Post by pl72 » Sun Sep 08, 2013 8:13 am

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 !

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Spectral analysis of a pure sound

Post by steve » Sun Sep 08, 2013 11:02 am

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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: Spectral analysis of a pure sound

Post by Robert J. H. » Sun Sep 08, 2013 4:27 pm

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.

kozikowski
Forum Staff
Posts: 68902
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Spectral analysis of a pure sound

Post by kozikowski » Sun Sep 08, 2013 4:33 pm

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

pl72
Posts: 6
Joined: Sun Sep 08, 2013 7:49 am
Operating System: Please select

Re: Spectral analysis of a pure sound

Post by pl72 » Mon Sep 09, 2013 4:42 pm

Thank you very much for your answers, I'll think about that!

Post Reply