Skip to content

Wavelet transform UI #10158

Open

Description

@saintmatthieu

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.

Activity

  1. added
    spectral tools
    on Jan 8, 2026
  2. kgramhans commented on Jan 11, 2026

    @kgramhans
    Contributor

    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
  3. added this to [AU4] Backlog and removed this from [AU4] Triageon Jan 12, 2026
  4. added
    P1
    on Jan 12, 2026
  5. kgramhans commented on Nov 17, 2026

    @kgramhans
    Contributor

    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

    1. The changes should have a minimal effect in the GUI
    2. 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
    3. 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

    Screenshot 2026-11-17 at 19 26 37

    The Frequency bandwidth can take a number of options:

    Screenshot 2026-11-17 at 19 32 10
    • 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

    1. The selection of Frequencies bandwidth is only relevant when Algorithm has been set to "Frequencies" (hence the name of the option)
    2. 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

    Looking forward to receiving your feedback!

  6. teetow commented on Nov 25, 2026

    @teetow
    Collaborator

    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:

    • If the Algorithm dropdown shows "Frequencies," the "Frequencies bandwidth" dropdown is visible right below it.
    • If "Frequencies bandwidth" shows "Constant," the Window size, type, and zpf dropdowns are visible.
    • If it shows any of the Constant Q options, those options are hidden

    (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.

  7. kgramhans commented on Nov 26, 2026

    @kgramhans
    Contributor

    @teetow Thx for the suggestion and the hint. I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1spectral tools

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions