Page 2 of 2

Re: How change X-axis range in Spectrum Analysis Plot

Posted: Sun May 04, 2014 9:08 pm
by steve
Spriter1275 wrote:I find I have to use a value of 3500 rather than 1000 otherwise I get an error message saying there is not enough data.
The "Size" setting in Plot Spectrum sets the number of samples used for each FFT window. There must be at least this number of samples available in the selection.
After resampling 20 seconds of audio to 1000 Hz sample rate, there will be 20 x 1000 = 20000 samples.
If you wish to use a window size bigger than 20000, use the "Repeat" effect (http://manual.audacityteam.org/o/man/repeat.html) so that there are more samples available.

Re: How change X-axis range in Spectrum Analysis Plot

Posted: Mon May 05, 2014 6:15 am
by Robert J. H.
steve wrote:
Spriter1275 wrote:I find I have to use a value of 3500 rather than 1000 otherwise I get an error message saying there is not enough data.
The "Size" setting in Plot Spectrum sets the number of samples used for each FFT window. There must be at least this number of samples available in the selection.
After resampling 20 seconds of audio to 1000 Hz sample rate, there will be 20 x 1000 = 20000 samples.
If you wish to use a window size bigger than 20000, use the "Repeat" effect (http://manual.audacityteam.org/o/man/repeat.html) so that there are more samples available.
Bad idea, this introduces an artificial periodicity/comb effect. It is better to padding the audio with zeros at the beginning and end (for non-rectangular windows).
In fact, plot spectrum should do this automatically imo for short selections.

Re: How change X-axis range in Spectrum Analysis Plot

Posted: Mon May 05, 2014 10:00 am
by steve
Robert J. H. wrote:Bad idea, this introduces an artificial periodicity/comb effect.
I can see that effect if I use hundreds of repeats, but we're talking about just two or three repeats. With only three repeats the effect seems negligible, or can you demonstrate that there could be a significant effect?

As an example, attached is the spectrum test for a 49 Hz sine tone generated at 48 kHz, then resampled to 1000 Hz, then repeated three times (total 80,000 samples. Other than the -2 dB spike centred at 49 Hz, the level remains below -100 dB throughout.
spectrum.txt
(728.91 KiB) Downloaded 41 times
I agree that padding with silence would be better :grin: but then for quantitative measurements it would be necessary to scale the results.

Of course the resampling needs to be very high quality so as to avoid alias frequencies creeping in, but the default settings in Audacity should handle that pretty well.