WDF-based spectrograms | GLSL & Sound

submited by
Style Pass
2021-06-14 02:30:05

As I was looking for interesting audio transforms, I came across the Wigner distribution function (or just WDF). The example on Wikipedia looks indeed interesting and it’s “sold” as a function that “provides the highest possible temporal vs frequency resolution which is mathematically possible within the limitations of the uncertainty principle” and thus “when a signal is not time limited, its WDF is hard to implement.” Turns out, WDF isn’t much harder to implement than plain FFT.

It does an interesting trick: at every point in time it inverts the audio signal and multiplies it by its normal time-forward version. This makes sense because a periodic signal at time T would locally correlate with a time inverted version of itself, however in WDF this correlation isn’t time bounded, so if the signal is 1 hour long, WDF will multiply two one hour long signals to compute just one value at T. This seems meaningless at first glance, as the random contributions 30 mins away from the current moment would make WDF random, but a closer look reveals that if those far away contributions are indeed random, they would cancel out each other, and they do (to an extent). The complex exponent on the right is effectively the usual FFT on the forward-inverted correlation.

So it doesn’t really add any complexity on top of the regular FFT. In practice, though, WDF is an extremely noisy function that’s much less insightful than plain FFT. Below is the same bird recording (xeno-canto.org/33539) visualized with different methods.

Leave a Comment