2

What are the Pros and Cons of using Wigner-Ville Distribution for spectral analysis of a signal vs taking the STFT. When is it appropriate to use one over the other and is WVD used in real-time implementations?

Update: Since no answers were received for the first few days of this post, I tried posting the same question on ChatGPT and below is the response I got from it:

The WVD is a time-frequency representation that provides a high degree of resolution in both time and frequency. It is useful for analyzing signals that have non-stationary properties, such as chirps and transient signals. The WVD can also distinguish between closely spaced frequency components, and can also show the instantaneous frequency of a signal.

On the other hand, the STFT is a widely used method in signal processing, and is useful for analyzing signals that are stationary or have slow time-varying properties. It provides a high degree of frequency resolution, but its time resolution is limited. Unlike WVD, it is not able to distinguish between closely spaced frequency components, and it does not show the instantaneous frequency of a signal to the degree in which WVD can.

The major disadvantage of the WVD is the computational cost. It has a computational complexity of O(N^2) which makes it impractical for large data sizes.

Is the above response true or false?

I had originally added this as a possible answer, removed it due to objection from a member (Jdip) due to inaccuracy and adding it back as part of question as asked by a member (OverLordGoldDragon) in the comments. Hope posting ChatGPT responses is not against the rules or anything.

Peter K. also mentioned a link to his publication in the comments of the deleted answer which I am adding here as well.

Peter K. also mentioned in OverlordGoldDragon's answer that the WVD is not very much useful in the presence of noise, a separate question has been added here for discussion on that in case anyone is interested.

malik12
  • 488
  • 4
  • 24

2 Answers2

3

I preface this answer with that I know little about WVD and never worked with it, but do know time-frequency, and synchrosqueezing, which shares similarities. Part of my answer will be for SSQ.

Re: ChatGPT

The WVD is a time-frequency representation that provides a high degree of resolution in both time and frequency.

No, oversimplified

It is useful for analyzing signals that have non-stationary properties, such as chirps and transient signals. The WVD can also distinguish between closely spaced frequency components, and can also show the instantaneous frequency of a signal.

Yes

On the other hand, the STFT is a widely used method in signal processing, and is useful for analyzing signals that are stationary or have slow time-varying properties.

So is DFT, misses the point

It provides a high degree of frequency resolution, but its time resolution is limited.

Nonsense, the whole point is we can tune it

Unlike WVD, it is not able to distinguish between closely spaced frequency components,

No

and it does not show the instantaneous frequency of a signal to the degree in which WVD can.

Yes

The major disadvantage of the WVD is the computational cost. It has a computational complexity of O(N^2) which makes it impractical for large data sizes.

No

Re: dorian111

When increasing the sampling length to improve the frequency domain resolution, the time domain resolution will deteriorate.

I can't tell if this refers to WVD or STFT. For STFT or any localized time-frequency method, it's wrong - the sampling rate, not duration, affects time resolution. WVD appears to have a global temporal operator, so it may be true there.

For WVD, it is generally believed that it is not limited to the uncertainty principle and can achieve the maximum mathematical accuracy of frequency domain resolution.

No method completely escapes Heisenberg, but it's true we can achieve practically perfect localization for certain classes of signals.

The general conclusion is that the accuracy of WVD is much higher than that of STFT.

No. This isn't even true for synchrosqueezing, which significantly improves upon WVD. The worst case in SSQ vs STFT is close, I can't say SSQ is better, and certainly not "much better". But it is true that the best case for SSQ is far superior.

The disadvantage is that the frequency spectrum will appear pseudo-frequency when there are multiple frequency signals in the data.

Unsure what this means, WVD is time-frequency, there's no "frequency spectrum" in standard sense. It's true that introducing additional intrinsic modes worsens WVD, esp. with "quadratic interference" (that SSQ lacks).

Compared with STFT, the calculation cost is much higher, and the performance is the difference between O(N2log(N)) and O(kNlog(N)). When the STFT sliding length is taken as the minimum limit of 1, k=N, and the performance of WVD is the same.

Not necessarily. The compute burden depends on what we need WVD for, and whether we window. Of chief consideration is information, and how much we lose, which can be measured - and conversely, how much we gain by computing the full WVD as opposed to a part of it. The original MATLAB synchrosqueezing toolbox used n_fft=N, with logic that DFT is length N, and which most will agree is completely unnecessary.

Without windowing, I imagine WVD is like a fancified Hilbert transform and struggles with more than one component - see Figure 4.18 and below. Windowing, particularly with kernels which make WVD complex, enable tremendous optimization, similar to CWT. These optimizations are unrealized in most code... for now.

$$X(\tau,f)=\int_{-\infty}^\infty x(t)w(t-\tau)e^{-j2\pi f t}dt $$

This is a correct STFT formulation which is what most libraries implement, but I'd like to note that it's bad.

$$W_x(t,f)=\int_{-\infty}^{\infty}x(t+\frac\tau{2})x^{*}(t-\frac\tau{2})e^{-j2\pi f\tau}d\tau $$

From this formula, something sticks out: $x(... \pm \tau)$. This screams boundary effects - a major disadvantage compared to STFT.


Re: original question

Two major advantages of the spectrogram (abs(STFT)) over WVD, or at least SSQ, is stability, and sparsity. SSQ, as a feature, is quite brittle to noise (in some ways, yet also more robust in other ways, see related). Sparsity may come as a surprise, as SSQ claims that's its advantage over STFT - and it is - but the form of sparsity that matters a lot is subsampleability.

Note, hop_size is just the subsampling factor for STFT. We can hop in the spectrogram because there's high redundancy along time, and doing so loses little information. Not the case with SSQ, which generates rough and spiky time-frequency geometries - subsampling it a lot means losing a lot, and not subsampling likewise means keeping too many data points to be useful for machine learning, not because of data size, but correlated features prone to overfitting.

As I understand, WVD is more a measurement tool - it can be used to describe time-frequency characteristics of time-frequency kernels, e.g. wavelets. Though really I don't know where its applicability ends.

Lastly, third major advantage, STFT doesn't straight up invent signals:

Figures 4.18 & 4.20, Wavelet Tour. Left is plain WVD, such interference is a dealbreaker for most applications. Right is windowed WVD, which attenuates interferences, but "reduces the time-frequency resolution" (under Eq 4.156).

OverLordGoldDragon
  • 8,912
  • 5
  • 23
  • 74
  • "the sampling rate, not duration, affects time resolution." For a time-frequency representation such as the STFT, wouldn't we refer to time resolution as how closely spaced together we compute the spectrum, i.e. the hop-size? – Jdip Jan 19 '23 at 11:22
  • 1
    @Jdip Not necessarily. I was responding to the claim that "longer x = worse time resolution", which isn't true at all for STFT. – OverLordGoldDragon Jan 19 '23 at 11:24
  • 1
    Oh I see. Agreed. – Jdip Jan 19 '23 at 11:26
  • @OverLordGoldDragon, I think "longer x" given the same sampling rate degrades the time resolution, was the original intention statement – malik12 Jan 19 '23 at 11:27
  • @malik12 No, but this should be asked separately. It's true for DFT, not STFT. – OverLordGoldDragon Jan 19 '23 at 11:28
  • @OverLordGoldDragon, difference being the Overlap factor or hop size? – malik12 Jan 19 '23 at 11:30
  • @malik12 overlap = n_fft - hop_size. They refer to the same thing. – OverLordGoldDragon Jan 19 '23 at 11:36
  • @OverLordGoldDragon Thank you I understand that part, I meant when you say " It's true for DFT, not STFT" is this the reason? – malik12 Jan 19 '23 at 11:38
  • 2
    @malik12 DFT has no hop size. STFT resolution only changes with the window and hop, and both are completely independent of len(x). Can have same window for any len(x) >= len(window). – OverLordGoldDragon Jan 19 '23 at 11:46
  • The applicability of the WVD ends when the signal does not have a single instantaneous frequency component or when the signal has noise. That is, it is really only useful for noiseless, single frequency component signals. As I've published, the Wigner-Ville Distribution is a $W_a(n,k)$. – Peter K. Jan 19 '23 at 15:02
  • @PeterK. If it is only useful for noiseless single frequency signals then that means it's pretty much useless for all practical scenarios doesn't it? – malik12 Jan 19 '23 at 15:07
  • @malik12 Precisely correct. – Peter K. Jan 19 '23 at 15:08
  • @PeterK. That's what I thought originally but then recalled, what of Figure 4.19? That's pretty good for crossing chirps. – OverLordGoldDragon Jan 19 '23 at 15:09
  • @OverLordGoldDragon The choice of grayscale there, for me, hides the variation in the cross-terms between the two components. YMMV – Peter K. Jan 19 '23 at 18:52
  • @PeterK. I have added snapshots of chirp signals and their WVDs at different SNRs using Matlab in the question, the presence of chirp is still visible on the WVD even at 0dB SNR, does Matlab do some other post or pre processing or am I missing something big here? – malik12 Jan 19 '23 at 19:28
  • @malik12 You've expanded the scope of the question several times now, not how SE works. These should be asked separately. – OverLordGoldDragon Jan 20 '23 at 05:15
  • @OverLordGoldDragon I'm sorry but that is not my intention as in my view it is still relevant to the original question. Peter K. mentioned that it is useful for noiseless signals, that is why I expanded further to add the Matlab plots – malik12 Jan 20 '23 at 05:17
  • @malik12 Yes but every aspect of WVD or STFT cannot be the subject of a single Q&A, especially if said aspects are edited in after answers are submitted. WVD vs noise and STFT vs noise can each stand as its own topic. Too broad / lacks focus. – OverLordGoldDragon Jan 20 '23 at 09:59
  • 2
    @OverLordGoldDragon ok, I see your point, I'll clear the noise related stuff up and open a new Question for it and add the link here if any one wishes to follow the trail (most unlikely :) ) – malik12 Jan 20 '23 at 10:21
0

The STFT formula is $$X(\tau,f)=\int_{-\infty}^\infty x(t)w(t-\tau)e^{-j2\pi f t}dt $$ Generally speaking, it is the Fourier transform of data sliding and windowing.

WVD formula is $$W_x(t,f)=\int_{-\infty}^{\infty}x(t+\frac\tau{2})x^{*}(t-\frac\tau{2})e^{-j2\pi f\tau}d\tau $$ for the part of $x(t+\frac\tau{2})x^{*}(t-\frac\tau{2})$ in the formula, if there is some signal basis, it is found that it is very similar to autocorrelation. It is called instantaneous autocorrelation function, which is the Fourier transform of data instantaneous autocorrelation.

It is generally believed that the STFT is limited by the uncertainty principle. $f_{\texttt{bin}}=\frac{\texttt{sample rate}}{\texttt{fftlength}}$ is the minimum frequency domain resolution scale. When the sampling rate is fixed, the only way to improve the frequency domain resolution is to increase the sampling length. However, increasing the sampling length means increasing the sampling time. Non-steady and short-time stationary signals are the majority of signals generated in the display world. When increasing the sampling length to improve the frequency domain resolution, the time domain resolution will deteriorate.

For WVD, it is generally believed that it is not limited to the uncertainty principle and can achieve the maximum mathematical accuracy of frequency domain resolution. The general conclusion is that the accuracy of WVD is much higher than that of STFT. The disadvantage is that the frequency spectrum will appear pseudo-frequency when there are multiple frequency signals in the data.

Compared with STFT, the calculation cost is much higher, and the performance is the difference between $O(N^2\log(N))$ and $O(kN\log(N))$. When the STFT sliding length is taken as the minimum limit of $1$, $k = N$, and the performance of WVD is the same.

Based on the above reasons, WVD cannot be used in real time. Although the signal resolution is high, it is severely limited. Although adding kernel function can blur the pseudo-frequency, it also reduces the resolution. Therefore, it should not be common to use WVD in engineering and real time services.

I think that the main concern of the building owner may be the improvement of frequency domain resolution. In this regard, better technologies include frequency correction, Reassignment or Synchrosqueezing. Resolution improvement can achieve good results. The building owner can focus on a python audioFlux In addition to correction, reassignment and other methods (demo effect is here), there are other types of time-frequency correlation transformation in the framework.

enter image description here

Jdip
  • 5,980
  • 3
  • 7
  • 29
dorian111
  • 17
  • 4