You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ongoing PR #10142 from external contributor Klaus Gram-Hansen does the backend work of computing, caching and painting a wavelet version of the spectrogram. This is most of the work.
To make this available to the user, some design work is needed so that the spectrogram settings accommodate this particular transform. Some of the "normal" spectrogram parameters become irrelevant, and new ones are needed.
Then this UI modification of the dialog would have to be implemented and wired to the backend. This might be a bit more difficult than it sounds due to the different layouts of the global and per-track setting dialogs, but still not difficult.
Additional work, to make these new parameters persistent, would be needed in SpectrogramConfiguration. I do not expect this to be difficult at all.
I will ask Klaus to provide a list of the parameters that would be obsolete and of the new parameters needed.
The new Spectrogram version (Constant-Q aka Wavelet) is characterised by
Name: I prefer the name "Constant-Q" since this better describes how it distinguishes itself from regular "Frequencies" algorithm which is based on the Fourier Transform. The alternative name "Wavelet" is not as precise, but maybe sexier?
Q factor of the transform. This is a well-known quantity. It is in principle a positive floating point value. I prefer to present the user with a number of named options since this makes reproduction easier and limits testing scenarios. I suggest these named options: 1/6th octave (Q=8.7), 1/12th octave (Q=17.3) and 1/24th octave (Q=35). The middle choice should be the default
Filter shape (Window type): In principle, any window type can be used, but I prefer restricting usage to only a Gaussian window, or more correctly a Confined Gaussian window since it has superior properties for this application. I do not think we should bother the user with this choice
Overlap: This parameter describes the density of points to be calculated for the Spectrogram. With the current implementation this only has an effect on the smoothness along the frequency axis. The higher the overlap, the more calculations is required (and the more details may be revealed). So this is an optimisation parameter. I suggest presenting the user with three choices : 0%, 50% and 75%. 50% should be the default
Min frequency (Scale setting) should preferably have a non-zero value. If it has not, we will have to safeguard against this in code (not problematic). But it would help to set a default value of 20 Hz for the constant-Q transform
Window size: This current parameter is in reality not a requirement for the Constant-Q spectrogram but is a consequence of the current implementation and as such needed. Recommended value can be calculated as follows: SamplingFrequency/(Min Frequency/Q) and next choosing the closest power-of-2 value. In general, 32768 seems to be a good fixed value. It may be relevant to offer lower choices if computer resources are scarce
Overall, the simplest approach would be
Introduce new Algorithm "Constant-Q"
Set default value of "Min Frequency" to 20 in this case
Make a drop-down for "Q factor"
Make a drop-down for "Overlap"
Make default choice of "Window size" = 32768
Make "Window type" and "Zero padding factor" invisible. Zero padding must take on the value "1" in order to avoid implementation side-effects
In prolongeration of discussion #10327 , I am now ready to present a proposal for a GUI allowing for Constant-Q spectrogram in Audacity 4
I have taken a number of circumstances into consideration
The changes should have a minimal effect in the GUI
The changes must be pure add-ons. This is important in order not to interfere with existing projects and settings and makes code less prone to side-effects
The changes must be easy to document and understand
What it all boils down to is a single new setting in the Spectrogram, named Frequencies bandwidth
The Frequency bandwidth can take a number of options:
Constant : This is the default option, which assures same behaviour as until now
Constant-Q 1/6 octave, Constant-Q 1/12 octave, Constant-Q 1/24 octave, Constant-Q 1/48 octave : These options turn the "Frequencies" representation of the Spectrogram into a Constant-Q version with selected bandwidth and optimum time resolution
It is important to note, that behind the scenes a number of design choices have been made and that this functionality is not based on FFT synthesis, but on the Wavelet Transform. From my perspective, the user should not be bothered with that. If, at a later stage more control over parameters is desirable, the GUI could easily be re-designed. But I think that a real need should drive such development. Also, the testing and documentation and general QA efforts can be kept relatively low.
The signal processing required was already introduced into the code base in Audacity 3 and has undergone some testing - however not from skilled users of the app
Also note, that
The selection of Frequencies bandwidth is only relevant when Algorithm has been set to "Frequencies" (hence the name of the option)
All other parameters (Window size, Window type and Zero padding factor) are irrelevant to the Constant-Q Spectrogram
Current status from my side is that I am ready to bring this further whenever convenient. This means
I am ready to digest any comments and suggestions
We could have sesssion to discuss, if required
A PR can be produced whenever convenient
To begin, I think we should somehow place this issue on the board
Activity
kgramhans commentedon Jan 11, 2026
The new Spectrogram version (Constant-Q aka Wavelet) is characterised by
1/6th octave (Q=8.7),1/12th octave (Q=17.3)and1/24th octave (Q=35). The middle choice should be the defaultGaussianwindow, or more correctly aConfined Gaussianwindow since it has superior properties for this application. I do not think we should bother the user with this choiceSamplingFrequency/(Min Frequency/Q) and next choosing the closest power-of-2 value. In general, 32768 seems to be a good fixed value. It may be relevant to offer lower choices if computer resources are scarceOverall, the simplest approach would be
kgramhans commentedon Nov 17, 2026
Dear @saintmatthieu @teetow @DilsonsPickles
In prolongeration of discussion #10327 , I am now ready to present a proposal for a GUI allowing for Constant-Q spectrogram in Audacity 4
I have taken a number of circumstances into consideration
What it all boils down to is a single new setting in the Spectrogram, named
Frequencies bandwidthThe Frequency bandwidth can take a number of options:
Constant: This is the default option, which assures same behaviour as until nowConstant-Q 1/6 octave,Constant-Q 1/12 octave,Constant-Q 1/24 octave,Constant-Q 1/48 octave: These options turn the "Frequencies" representation of the Spectrogram into a Constant-Q version with selected bandwidth and optimum time resolutionIt is important to note, that behind the scenes a number of design choices have been made and that this functionality is not based on FFT synthesis, but on the Wavelet Transform. From my perspective, the user should not be bothered with that. If, at a later stage more control over parameters is desirable, the GUI could easily be re-designed. But I think that a real need should drive such development. Also, the testing and documentation and general QA efforts can be kept relatively low.
The signal processing required was already introduced into the code base in Audacity 3 and has undergone some testing - however not from skilled users of the app
Also note, that
Frequencies bandwidthis only relevant whenAlgorithmhas been set to "Frequencies" (hence the name of the option)Current status from my side is that I am ready to bring this further whenever convenient. This means
To begin, I think we should somehow place this issue on the board
Looking forward to receiving your feedback!
teetow commentedon Nov 25, 2026
Hello again! Glad to see this is still alive!
I think your mockup is the right direction, so I suggest you do this for the UI:
(The last point is presuming that those controls are indeed irrelevant to Constant Q)
For prior art on showing and hiding UI elements dynamically, have a peek at our Export dialog.
kgramhans commentedon Nov 26, 2026
@teetow Thx for the suggestion and the hint. I will look into it.