I am using OSX 10.6.7 and Audacity 2.0.3; when I plot a frequency analysis of a .aiff sample under the Analyze > Plot Spectrum … menu, I notice that increasing the “Size” values under the plot causes the amplitudes of the frequency peaks to shrink significantly with increasing bin size. I was wondering if this is expected behavior and not a bug; the amplitude peaks increasingly do not match what the underlying data reports in the export text file. Also, some of the peaks do not have the same relative relationship to each other with increasing bin sizes. I’m not sure if this is something intrinsic to the analysis that I do not understand or whether it is a bug of some sort. Thank you for any information.
Some of the behaviour is explainable.
Two frame sizes are per se not comparable. One of 1024 bins has twice as much input samples as one that is made of 512 samples.
Even by using two for the second case, the result won’t be the same.
Let’s say we have two window sizes, one has bins for each 100 Hz distance and the other one is haf as large and gives us only bins for 200 Hz distance.
If we now analyze a 300 Hz tone with amplitude 1, this will correctly be shown by our first frame choice as a single peak at the 4th bin.
For the secondary frame size, the frequency falls between bin 200 and 400. they will both have about half of the magnitude. But not only this, the influence will also affect the bins at 0, 600, 800 Hz and so on (because a 300 Hz tone is not the same as two at 200 and 400 Hz, this difference must be made by the bins outside).
The audio you want to analyze seldom falls exactly onto a bin and the resulting spectrum appears therefore always a little blurry. Windowing can help to make the peaks more distinct.
However, the spectrum changes due to this effect when comparing two different FFT sizes.
You must decide if the frequency or the time resolution is what you want to analyze.
I can’t tell you why the exported data does not match the displayed spectrum.
I often struggle to get the current data to be exported (mostly an accessibility issue). It would be helpful when the exported data would include some details about the current settings and a time stamp, when the data was produced.
Yes that is normal.
The spectrum plot (both the graphic and the export data) are normalized such that a 0 dB sine wave at a frequency that lies in the centre of a an FFT frequency band will read as 0 dB. (try generating a tone at 516.8 Hz).
The graphic spectrum plot is limited by the pixel size. Very narrow spikes will appear lower than the exported data because the data is rounded to the nearest whole pixel size. Similarly very narrow notches will appear less deep.There may also appear to be mismatches due to extrapolation between the data points and the drawn graph.
Plot Spectrum calculates the data points first, then draws the graph from the data. Exporting the data is provided for cases where precise measurements are required. Programs such as Gnuplot, Microsoft Excel, Matlab and others are able to draw alternative types of graphs from the exported data if required.