Repository navigation
Description
Problem to be solved
When working with Spectrogram displays, the choice of window function balances the compromise between time and frequency resolutions on linear scales, ie same temporal and frequency resolution will be applied throughout the Spectrogram display
The wavelet transform offers a different compromise between time and frequency resolutions such that
- Frequency resolution is relative to analysis frequency
- Time resolution is a constant number of periods for analysis frequency
As such, the wavelet is much closer related to analysis tools conventionally applied to the analysis of sounds
Basically, the wavelet transform may be presented completely analogous to the existing Spectrogram display
Your idea
A minor modification to the Audacity GUI will allow for a basic introduction of wavelet transform into the software. Such changes must of course be reflected in implementation code as well
I have played around with a simple implementation which is based on a simple extension of the "Spectrograms" preferences:
- An Algorithm choice has been added. For demo purposes, I have chosen a so-called "1/6th octave" modulated Hann window
- The "Window size" parameter is re-used to signify the maximum length of wavelet filter used to calculate the transform. As such, this parameter is not really needed, but it limits the otherwise extensive calculations implied at low but not interesting frequencies
- "Window type" and Zero padding factors are fixed at "Hann" and "1"
The necessary adaptations of the code base have been done allowing for then displaying a wavelet based spectrogram:
- Wavelet analysis of me pronouncing the word "wavelet"
- Spectrogram with favoured frequency resolution
- Spectrogram with favoured time resolution
It is not my ambition to prove any method being superior to the other. The wavelet transform offers a compromise in resolution trade-off that is different from conventional spectrogram.
Prior art
I have implemented ideas developed in my PhD thesis (Simultaneous Time and Frequency Analysis, 1990). This is knowledge in the public domain. I also implemented similar features in an antiquated Signal Analysis toolbox Non-stationary Signal Analysis Software
Additional context
I consider the above issue as a "shot in the dark". I am very well aware that it may not be at the current center of interest and do not consider the proposed implementation as cast in stone in any way. If the above is of any interest, I would gladly spend time shaping it in any direction advised - or integrating it as-is
I have currently worked off the 3.7.5 branch locally. If of any interest, please advise on how to publish my work in the most compliant way according to the project guidelines
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Projects
- StatusShow more project fieldsDone
Activity
Tantacrul commentedon Oct 1, 2025
@teetow @saintmatthieu - I thought you might be interested in this, since we're about to port to Spectrogram feature.
scrubbbbs commentedon Oct 4, 2025
The reassignment spectrogram does much better with the time/frequency resolution tradeoff, but requires rectangular window to work well. You can read more about it on wikipedia. I'd be curious to see your example shown with this method.
kgramhans commentedon Oct 5, 2025
@scrubbbbs
I enclose same analysis done using reassignment method for some choice of parameters that seem to work well:
The reassignment method could be applicable to wavelet based analysis as well. But most likely not efficient
An infinite number of possible time/frequency analysis tools do exist and different users may have different preferences
My aim with the above suggestion was to provide support for yet another method. I am aware that this takes thorough consideration and design and must be aligned with the roadmap for Audacity 4. If possible, I would be interested in some insight
kgramhans commentedon Dec 11, 2025
@saintmatthieu
@Tantacrul
Hi Matt
I have had some spare time to look further into our wavelet/constant Q related spectrogram discussions. More specifically, I have in pull request #10055 proposed changes related to
The Pull request contains fully functional code for the wavelet transform
For matters of demonstration, also the STFT has been implemented in the proposed lib
For now, I see no point in progressing further into this until the core team decides on the path forward. Therefore, looking forward to your comments whenever you find some time...
Regards, Klaus
Constant-Q in au4 spectrogram (#10142)