Page 1 of 1

Overlapping in FFT analysis

Posted: Sat Mar 09, 2013 2:06 pm
by fonon
Analyse-> Plot spectrum.
It is not clear how Audacity averages the spectrum. How the FFT windows are overlapped? The manual contains the sentence: "currently only the first 237.8 seconds of selected audio can be analyzed". Why? At any sampling rate? Where is beginning of FFT window when there is no range selected and the cursor indicates position given on the time axis? Who could explain?
f.

Re: Overlapping in FFT analysis

Posted: Sat Mar 09, 2013 10:15 pm
by steve
fonon wrote:The manual contains the sentence: "currently only the first 237.8 seconds of selected audio can be analyzed"
That is an inaccuracy in the manual which has been corrected in the 2.0.4 manual.
The limit is actually 10485760 samples (237.8 seconds at 44100 Hz sample rate).

I'm not sure what the overlap percentage is, but as there is no user control for that such information is only of academic interest and the source code is freely available for anyone that wants to look it up.
fonon wrote:Where is beginning of FFT window when there is no range selected and the cursor indicates position given on the time axis?
Plot Spectrum analyzes the selected audio, up to the first 10485760 samples.

Re: Overlapping in FFT analysis

Posted: Sun Mar 10, 2013 1:19 pm
by fonon
steve wrote: I'm not sure what the overlap percentage is, but as there is no user control for that such information is only of academic interest and the source code is freely available for anyone that wants to look it up.
It's important to know what the overlap is, even there is no control. It may be 0% for example. There are users who aren't programers and analysis of the code may be too difficult.
steve wrote:
fonon wrote:Where is beginning of FFT window when there is no range selected and the cursor indicates position given on the time axis?
Plot Spectrum analyzes the selected audio, up to the first 10485760 samples.
Thank You for explanation. It isn't a good idea.
f.

Re: Overlapping in FFT analysis

Posted: Sun Mar 10, 2013 10:09 pm
by steve
This is not my area of expertise, but it looks to me like a 50% (100%) overlap. What do you think it is?
fonon wrote:
Plot Spectrum analyzes the selected audio, up to the first 10485760 samples.
Thank You for explanation. It isn't a good idea.
Please explain.

Re: Overlapping in FFT analysis

Posted: Mon Mar 11, 2013 3:10 pm
by fonon
steve wrote:
fonon wrote:
Plot Spectrum analyzes the selected audio, up to the first 10485760 samples.
Thank You for explanation. It isn't a good idea.
Please explain.
The selection of entire audio file is very easy in "CTRL-A" mode. There is no need to duplicate this function. Sometimes the analysis of very short time range (as short as FFT window size) is needed. The selection of the range equal FFT window size is difficult. The much better solution is set the cursor at the beginning of that range and do only one FFT cycle. In the other words - the cursor indicates the beginning of the FFT window and the window size determines the length of selected range. Unfortunately, Audacity can't do it.
f.

PS. We do not know what Audacity do when the selected range is shorter than FFT window size or slightly longer and doesn't cover exactly the overlapped FFT windows.

Re: Overlapping in FFT analysis

Posted: Mon Mar 11, 2013 6:49 pm
by steve
fonon wrote:The selection of entire audio file is very easy in "CTRL-A" mode. There is no need to duplicate this function.
It doesn't.
Perhaps you have the "Select all audio in project, if none selected" preference option enabled: http://manual.audacityteam.org/o/man/tr ... ences.html
fonon wrote:Sometimes the analysis of very short time range (as short as FFT window size) is needed.
then select a very short time range.
fonon wrote:The selection of the range equal FFT window size is difficult.
Zoom in, or use the Selection toolbar.
http://manual.audacityteam.org/o/man/zooming.html
http://manual.audacityteam.org/o/man/se ... olbar.html
The selection does not need to be exact (see below).
fonon wrote:The much better solution is set the cursor at the beginning of that range and do only one FFT cycle.
The purpose of windowing is to enable analysis of long selections. The window size is a means to set time and frequency resolutions, it is not intended as a means to determine how much audio to analyse. http://en.wikipedia.org/wiki/Window_function
fonon wrote:PS. We do not know what Audacity do when the selected range is shorter than FFT window size or slightly longer and doesn't cover exactly the overlapped FFT windows.
Obviously a selection shorter than the window size returns no result. Try it and you will see that Audacity provides a warning if your selection is shorter than the window size.

Re: Overlapping in FFT analysis

Posted: Thu Mar 14, 2013 4:23 pm
by fonon
steve wrote:
fonon wrote:The selection of entire audio file is very easy in "CTRL-A" mode. There is no need to duplicate this function.
(1) It doesn't.
Perhaps you have the "Select all audio in project, if none selected" preference option enabled: http://manual.audacityteam.org/o/man/tr ... ences.html
??? We are talking about "Analyze-> Plot spectrum". The idea of "select all audio in project" for FFT analysis is nonsense.
If we can't to use "CTRL+A" for select a single audio track, we still can do it fast and simple using mouse cursor.
steve wrote:
fonon wrote:Sometimes the analysis of very short time range (as short as FFT window size) is needed.
(2) then select a very short time range.
fonon wrote:The selection of the range equal FFT window size is difficult.
Zoom in, or use the Selection toolbar.
http://manual.audacityteam.org/o/man/zooming.html
http://manual.audacityteam.org/o/man/se ... olbar.html
You will try to do it 100 times first. It's possible to do it in your way, but it's extremely uncomfortable.
steve wrote:(3) The selection does not need to be exact (see below).
You can't know it.
steve wrote:
fonon wrote:The much better solution is set the cursor at the beginning of that range and do only one FFT cycle.
(4) The purpose of windowing is to enable analysis of long selections. The window size is a means to set time and frequency resolutions, it is not intended as a means to determine how much audio to analyse. http://en.wikipedia.org/wiki/Window_function
You have no right. Probably You are not familiar with typical operations in frequency domain. There are better sources than wikipedia. For example - see B&K Technical Bulletin. Single FFT operation needs a set of samples i.e. "time window". The window function will be matched to the kind of signal analyzed (pulse, periodic etc.). For pulses we typical need only one time window. For periodic signals in many cases better results are obtained with single FFT operation with long "time window" than short "time window" and overlapping procedure.
steve wrote:
fonon wrote:PS. We do not know what Audacity do when the selected range is shorter than FFT window size or slightly longer and doesn't cover exactly the overlapped FFT windows.
(5) Obviously a selection shorter than the window size returns no result. Try it and you will see that Audacity provides a warning if your selection is shorter than the window size.
Go to (2). The selection of exactly one "time window" is very necessary and useful option. The typical situation is when we need to do FFT analysis in many parts of audio track using well-matched window function and window size. The best solution is my method.
f.

Re: Overlapping in FFT analysis

Posted: Thu Mar 14, 2013 5:34 pm
by steve
Audacity is a multi-track audio editor. For advanced analysis options you may be better to use MatLab.
fonon wrote:The best solution is my method.
Of course. Please submit a patch to implement your method and I'll be happy to forward it to the developers for consideration.