Qu

wigner_ville

Builtin index · Signal processing

wigner_ville(x, [fs=1])

Input: x, fs · Output: no output

What it is

x is a length-N real vector or Signal; fs (optional number, Hz, default 1, i.e. normalized frequency) is the sample rate, or is carried by a Signal. Wigner-Ville distribution: the quadratic time-frequency distribution W(t,f) = ∫ x(t+τ/2)*conj(x(t-τ/2))*exp(-2πifτ) dτ, discretized over the analytic signal. Using no window at all, it reaches the finest joint time-frequency localization of anything here — a linear chirp comes out as a one-cell-wide line where stft smears it to the window length. Cross terms are expected, not a bug. The transform is quadratic in x, so every *pair* of components adds an oscillating interference term sitting exactly midway between them in time and frequency, at up to twice an auto-term's amplitude, and parts of the surface go genuinely negative (this is not a power spectrum and is not constrained to be non-negative). Two tones at 50 Hz and 150 Hz will show energy at 100 Hz where the signal contains none: read the result as a high-resolution display of a *single-component* signal, or expect to reason about the ghosts. Draws a magnitude heatmap and returns a Record with fields tfr (an (N, N) real Mat), freq (length-N Vec; row k is k*fs/(2N) Hz, spanning DC to just under Nyquist at twice an N-point FFT's resolution) and time (length-N Vec, seconds). The output is N×N, so the cost is quadratic in the record length and anything above 4,000,000 cells is refused with a named error. Added in v0.3.0.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
wigner_ville(x, [fs=1])
x vector or Signalx is a length-N real vector or Signal.
fs number, optional (default 1)fs (optional number, Hz, default 1, i.e.
not documented yetnormalized frequency) is the sample rate, or is carried by a Signal. Using no window at all, it reaches the finest joint time-frequency localization of anything here — a linear chirp comes out as a one-cell-wide line where stft smears it to the window length. Two tones at 50 Hz and 150 Hz will show energy at 100 Hz where the signal contains none: read the result as a high-resolution display of a *single-component* signal, or expect to reason about the ghosts. The output is N×N, so the cost is quadratic in the record length and anything above 4,000,000 cells is refused with a named error. Added in v0.3.0.

Examples

No documentation example calls this form yet. The Signal processing chapter is where one belongs.

How it works

wigner_ville(x, [fs=]) — the quadratic time-frequency distribution. Finest joint resolution of anything here (no window at all), at the cost of cross terms: see the wigner_ville doc comment in qu-core, and the doc row, for why the "extra" energy between two components is the definition working, not a defect.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.