How change X-axis range in Spectrum Analysis Plot

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

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

Post by steve » Sun May 04, 2014 9:08 pm

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.
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: How change X-axis range in Spectrum Analysis Plot

Post by Robert J. H. » Mon May 05, 2014 6:15 am

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.

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

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

Post by steve » Mon May 05, 2014 10:00 am

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

Post Reply