Can anyone tell me what overlap value Audacity uses to calculate spectrograms? Some programs let you specify this parameter, but Audacity seems to use a fixed value.
If by “Spectrum Overlap” you mean a sloppy representation, yes. That’s the default. If you want to try other specifications you can change the settings in Edit > Preferences > Spectrogram.
Koz
No, I mean FFT window overlap. We can specify the size, but not the overlap. Perhaps the overlap is zero. Some programs like Sonic Visualiser let you change it. From the manual of the program:
“The overlap between consecutive windows can be adjusted using the Window Overlap property, which determines by what proportion of the window size the processing frames will overlap. Using a larger overlap will help to compensate for the reduced time resolution of a large window size.” (> Sonic Visualiser: A Brief Reference> )
I’m not sure but I think a 50% overlap is used. If you understand C++ you could look in the source code to be certain.
I can’t understand the code, but could this be it? From WaveClip.cpp:
// purposely offset the display 1/2 bin to the left (as compared
// to waveform display to properly center response of the FFT
I’m just guessing.
It’s really beyond my (little) understanding of C++, but I was looking at Spectrum.cpp in which it appears to be looping in steps of “half = windowSize / 2”
Do you want to vote for a FFT overlap control for Spectrogram ? I see someone else has done so.
I’m not sure if I’m reading http://sourceforge.net/mailarchive/message.php?msg_id=27462757 correctly but it seems that the overlap might actually be 100% and Martyn has been considering making it variable.
Gale
I wasn’t sure how to specify the % overlap, so I looked on-line. The references that I found said that overlapping by half a window is 50%. This would men that the first half of any window (other than the first) overlaps the latter half of the previous window. I presume that is the same as you mean by “100% overlap”. I’ve also seen this referred to as “2 x overlap”, but in either case it appears to be the norm for Hann windows, giving a sum of overlapping windows that is exactly 1.
Thanks for that link, that’s good background information. If I’m interpreting that thread correctly then the FFT window sizes greater that 2048 have only been available since mid 2011? If so, thanks whoever was responsible for that, I regularly use the high values to look at the low frequencies.
Interesting comment about the regeneration speed. That is a problem with low values, but even with a 2 hour track, it’s not as bad as 10 seconds for me. I haven’t actually timed it, but it might be less than half that. It makes playing the track and adding labels as it runs impractical, as the cursor is well into the next page when it’s finished regenerating after a page change. (Is page the right terminology?)
Sonic Visualiser caches the entire spectrogram each time you change the parameters, so scrolling is quick. The price is a long wait after a parameter change. Perhaps it would be possible to be calculating and caching in the background using some of my three idle CPUs.
BTW, I’m not requesting a variable overlap, I just wanted to know what it uses so I can replicate the settings in Sonic Visualiser, etc. I’m having trouble making their low frequency spectrograms look as good as Audacity’s.
Before the May 2011 changes, the maximum FFT size was 4096.
At that time going beyond 4096 was painfully slow but there have been other changes to FFT in Audacity since then that have provided significant increase in speed.