Skip to content

Wavelet Transform revisited #9509

Closed

Description

@kgramhans

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:

Image
  • 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:

  1. Wavelet analysis of me pronouncing the word "wavelet"
Image
  1. Spectrogram with favoured frequency resolution
Image
  1. Spectrogram with favoured time resolution
Image

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

Activity

  1. added
    Enhancement Request
    on Sep 30, 2025
  2. Tantacrul commented on Oct 1, 2025

    @Tantacrul

    @teetow @saintmatthieu - I thought you might be interested in this, since we're about to port to Spectrogram feature.

  3. scrubbbbs commented on Oct 4, 2025

    @scrubbbbs

    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.

  4. kgramhans commented on Oct 5, 2025

    @kgramhans
    ContributorAuthor

    @scrubbbbs
    I enclose same analysis done using reassignment method for some choice of parameters that seem to work well:

    Image

    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

  5. moved this from Undecided to Accepted in Feature Requestson Oct 6, 2025
  6. moved this from Accepted to timeline: early 4.x in Feature Requestson Oct 6, 2025
  7. kgramhans commented on Dec 11, 2025

    @kgramhans
    ContributorAuthor

    @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

    1. Speed of wavelet transform
    2. Architecture for isolating Spectrogram calculations into a dedicated lib (Cleaning up SpectrumCache.cpp)

    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

  8. moved this from Design - Todo to Code Review in [AU4] Main Board(archive)on Jan 15, 2026
  9. moved this from Code Review to Done in [AU4] Main Board(archive)on Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Enhancement Request

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions