# Wigner distribution function

The Wigner distribution function (WDF) is used in signal processing as a transform in time-frequency analysis.
The WDF was first proposed in physics to account for quantum corrections to classical statistical mechanics in 1932 by Eugene Wigner, and it is of importance in quantum mechanics in phase space (see, by way of comparison: Wigner quasi-probability distribution, also called the Wigner function or the Wigner–Ville distribution).
Given the shared algebraic structure between position-momentum and time-frequency conjugate pairs, it also usefully serves in signal processing, as a transform in time-frequency analysis, the subject of this article. Compared to a short-time Fourier transform, such as the Gabor transform, the Wigner distribution function provides the highest possible temporal vs frequency resolution which is mathematically possible within the limitations of the uncertainty principle. The downside is the introduction of large cross terms between every pair of signal components and between positive and negative frequencies, which makes the original formulation of the function a poor fit for most analysis applications. Subsequent modifications have been proposed which preserve the sharpness of the Wigner distribution function but largely suppress cross terms.

## Mathematical definition

There are several different definitions for the Wigner distribution function. The definition given here is specific to time-frequency analysis. Given the time series $x[t]$, its non-stationary auto-covariance function is given by
    $C_{x}(t_{1},t_{2})=\left\langle \left(x[t_{1}]-\mu [t_{1}]\right)\left(x[t_{2}]-\mu [t_{2}]\right)^{*}\right\rangle ,$
where $\langle \cdots \rangle$ denotes the average over all possible realizations of the process and $\mu (t)$ is the mean, which may or may not be a function of time. The Wigner function $W_{x}(t,f)$ is then given by first expressing the autocorrelation function in terms of the average time $t=(t_{1}+t_{2})/2$ and time lag $\tau =t_{1}-t_{2}$, and then Fourier transforming the lag.
    $W_{x}(t,f)=\int _{-\infty }^{\infty }C_{x}\left(t+{\frac {\tau }{2}},t-{\frac {\tau }{2}}\right)\,e^{-2\pi i\tau f}\,d\tau .$
So for a single (mean-zero) time series, the Wigner function is simply given by
    $W_{x}(t,f)=\int _{-\infty }^{\infty }x\left(t+{\frac {\tau }{2}}\right)\,x^{*}\left(t-{\frac {\tau }{2}}\right)\,e^{-2\pi i\tau f}\,d\tau .$
The motivation for the Wigner function is that it reduces to the spectral density function at all times $t$ for stationary processes, yet it is fully equivalent to the non-stationary autocorrelation function. Therefore, the Wigner function tells us (roughly) how the spectral density changes in time.

## Time-frequency analysis example

Here are some examples illustrating how the WDF is used in time-frequency analysis.

### Constant input signal

When the input signal is constant, its time-frequency distribution is a horizontal line along the time axis. For example, if x(t) = 1, then
    $W_{x}(t,f)=\int _{-\infty }^{\infty }e^{-i2\pi \tau \,f}\,d\tau =\delta (f).$

### Sinusoidal input signal

When the input signal is a sinusoidal function, its time-frequency distribution is a horizontal line parallel to the time axis, displaced from it by the sinusoidal signal's frequency. For example, if x(t) = e $^{i2πkt}$, then
    ${\begin{aligned}W_{x}(t,f)&=\int _{-\infty }^{\infty }e^{i2\pi k\left(t+{\frac {\tau }{2}}\right)}e^{-i2\pi k\left(t-{\frac {\tau }{2}}\right)}e^{-i2\pi \tau \,f}\,d\tau \\&=\int _{-\infty }^{\infty }e^{-i2\pi \tau \left(f-k\right)}\,d\tau \\&=\delta (f-k).\end{aligned}}$

### Chirp input signal

When the input signal is a linear chirp function, the instantaneous frequency is a linear function. This means that the time frequency distribution should be a straight line. For example, if
    $x(t)=e^{i2\pi kt^{2}}$ ,
then its instantaneous frequency is
    ${\frac {1}{2\pi }}{\frac {d(2\pi kt^{2})}{dt}}=2kt~,$
and its WDF
    ${\begin{aligned}W_{x}(t,f)&=\int _{-\infty }^{\infty }e^{i2\pi k\left(t+{\frac {\tau }{2}}\right)^{2}}e^{-i2\pi k\left(t-{\frac {\tau }{2}}\right)^{2}}e^{-i2\pi \tau \,f}\,d\tau \\&=\int _{-\infty }^{\infty }e^{i4\pi kt\tau }e^{-i2\pi \tau f}\,d\tau \\&=\int _{-\infty }^{\infty }e^{-i2\pi \tau (f-2kt)}\,d\tau \\&=\delta (f-2kt)~.\end{aligned}}$

### Delta input signal

When the input signal is a delta function, since it is only non-zero at t=0 and contains infinite frequency components, its time-frequency distribution should be a vertical line across the origin. This means that the time frequency distribution of the delta function should also be a delta function. By WDF
    ${\begin{aligned}W_{x}(t,f)&=\int _{-\infty }^{\infty }\delta \left(t+{\frac {\tau }{2}}\right)\delta \left(t-{\frac {\tau }{2}}\right)e^{-i2\pi \tau \,f}\,d\tau \\&=4\int _{-\infty }^{\infty }\delta (2t+\tau )\delta (2t-\tau )e^{-i2\pi \tau f}\,d\tau \\&=4\delta (4t)e^{i4\pi tf}\\&=\delta (t)e^{i4\pi tf}\\&=\delta (t).\end{aligned}}$
The Wigner distribution function is best suited for time-frequency analysis when the input signal's phase is 2nd order or lower. For those signals, WDF can exactly generate the time frequency distribution of the input signal.

### Boxcar function

    $x(t)={\begin{cases}1&|t|<1/2\\0&{\text{otherwise}}\end{cases}}\qquad$ ,
the rectangular function ⇒
    $W_{x}(t,f)={\begin{cases}{\frac {1}{\pi f}}\sin(2\pi f\{1-2|t|\})&|t|<1/2\\0&{\mbox{otherwise}}\end{cases}}$

## Cross term property

The Wigner distribution function is not a linear transform. A cross term ("time beats") occurs when there is more than one component in the input signal, analogous in time to frequency beats. In the ancestral physics Wigner quasi-probability distribution, this term has important and useful physics consequences, required for faithful expectation values. By contrast, the short-time Fourier transform does not have this feature. Negative features of the WDF are reflective of the Gabor limit of the classical signal and physically unrelated to any possible underlay of quantum structure.
The following are some examples that exhibit the cross-term feature of the Wigner distribution function.
* $x(t)={\begin{cases}\cos(2\pi t)&t\leq -2\\\cos(4\pi t)&-2<t\leq 2\\\cos(3\pi t)&t>2\end{cases}}$
* $x(t)=e^{it^{3}}$
In order to reduce the cross-term difficulty, several approaches have been proposed in the literature, some of them leading to new transforms as the modified Wigner distribution function, the Gabor–Wigner transform, the Choi-Williams distribution function and Cohen's class distribution.

## Properties of the Wigner distribution function

The Wigner distribution function has several evident properties listed in the following table.

### Projection property

    ${\begin{aligned}|x(t)|^{2}&=\int _{-\infty }^{\infty }W_{x}(t,f)\,df\\|X(f)|^{2}&=\int _{-\infty }^{\infty }W_{x}(t,f)\,dt\end{aligned}}$

### Energy property

    $\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }W_{x}(t,f)\,df\,dt=\int _{-\infty }^{\infty }|x(t)|^{2}\,dt=\int _{-\infty }^{\infty }|X(f)|^{2}\,df$

### Recovery property

    ${\begin{aligned}\int _{-\infty }^{\infty }W_{x}\left({\frac {t}{2}},f\right)e^{i2\pi ft}\,df&=x(t)x^{*}(0)\\\int _{-\infty }^{\infty }W_{x}\left(t,{\frac {f}{2}}\right)e^{i2\pi ft}\,dt&=X(f)X^{*}(0)\end{aligned}}$

### Mean condition frequency and mean condition time

    ${\begin{aligned}X(f)&=|X(f)|e^{i2\pi \psi (f)},\quad x(t)=|x(t)|e^{i2\pi \phi (t)},\\{\text{if }}\phi '(t)&=|x(t)|^{-2}\int _{-\infty }^{\infty }fW_{x}(t,f)\,df\\{\text{ and }}-\psi '(f)&=|X(f)|^{-2}\int _{-\infty }^{\infty }tW_{x}(t,f)\,dt\end{aligned}}$

### Moment properties

    ${\begin{aligned}\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }t^{n}W_{x}(t,f)\,dt\,df&=\int _{-\infty }^{\infty }t^{n}|x(t)|^{2}\,dt\\\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }f^{n}W_{x}(t,f)\,dt\,df&=\int _{-\infty }^{\infty }f^{n}|X(f)|^{2}\,df\end{aligned}}$

### Real properties

    $W_{x}^{*}(t,f)=W_{x}(t,f)$

### Region properties

    ${\begin{aligned}{\text{If }}x(t)&=0{\text{ for }}t>t_{0}{\text{ then }}W_{x}(t,f)=0{\text{ for }}t>t_{0}\\{\text{If }}x(t)&=0{\text{ for }}t<t_{0}{\text{ then }}W_{x}(t,f)=0{\text{ for }}t<t_{0}\end{aligned}}$

### Multiplication theorem

    ${\begin{aligned}{\text{If }}y(t)&=x(t)h(t)\\{\text{then }}W_{y}(t,f)&=\int _{-\infty }^{\infty }W_{x}(t,\rho )W_{h}(t,f-\rho )\,d\rho \end{aligned}}$

### Convolution theorem

    ${\begin{aligned}{\text{If }}y(t)&=\int _{-\infty }^{\infty }x(t-\tau )h(\tau )\,d\tau \\{\text{then }}W_{y}(t,f)&=\int _{-\infty }^{\infty }W_{x}(\rho ,f)W_{h}(t-\rho ,f)\,d\rho \end{aligned}}$

### Correlation theorem

    ${\begin{aligned}{\text{If }}y(t)&=\int _{-\infty }^{\infty }x(t+\tau )h^{*}(\tau )\,d\tau {\text{ then }}\\W_{y}(t,\omega )&=\int _{-\infty }^{\infty }W_{x}(\rho ,\omega )W_{h}(-t+\rho ,\omega )\,d\rho \end{aligned}}$

### Time-shifting covariance

    ${\begin{aligned}{\text{If }}y(t)&=x(t-t_{0})\\{\text{then }}W_{y}(t,f)&=W_{x}(t-t_{0},f)\end{aligned}}$

### Modulation covariance

    ${\begin{aligned}{\text{If }}y(t)&=e^{i2\pi f_{0}t}x(t)\\{\text{then }}W_{y}(t,f)&=W_{x}(t,f-f_{0})\end{aligned}}$

### Scale covariance

    ${\begin{aligned}{\text{If }}y(t)&={\sqrt {a}}x(at){\text{ for some }}a>0{\text{ then }}\\{\text{then }}W_{y}(t,f)&=W_{x}(at,{\frac {f}{a}})\end{aligned}}$

## Windowed Wigner Distribution Function

When a signal is not time limited, its Wigner Distribution Function is hard to implement. Thus, we add a new function(mask) to its integration part, so that we only have to implement part of the original function instead of integrating all the way from negative infinity to positive infinity.
Original function:
    $W_{x}(t,f)=\int _{-\infty }^{\infty }x\left(t+{\frac {\tau }{2}}\right)\cdot x^{*}\left(t-{\frac {\tau }{2}}\right)e^{-j2\pi \tau f}\cdot d\tau$
Function with mask:
    $W_{x}(t,f)=\int _{-\infty }^{\infty }w(\tau )x\left(t+{\frac {\tau }{2}}\right)\cdot x^{*}\left(t-{\frac {\tau }{2}}\right)e^{-j2\pi \tau f}\cdot d\tau$
where $w(\tau )$ is real and time-limited

### Implementation

    According to definition:
    ${\begin{aligned}W_{x}(t,f)=\int _{-\infty }^{\infty }w(\tau )x\left(t+{\frac {\tau }{2}}\right)\cdot x^{*}\left(t-{\frac {\tau }{2}}\right)e^{-j2\pi \tau f}\cdot d\tau \\W_{x}(t,f)=2\int _{-\infty }^{\infty }w(2\tau ')x\left(t+\tau '\right)\cdot x^{*}\left(t-\tau '\right)e^{-j4\pi \tau 'f}\cdot d\tau '\\W_{x}(n\Delta _{t},m\Delta _{f})=2\sum _{p=-\infty }^{\infty }w(2p\Delta _{t})x((n+p)\Delta _{t})x^{\ast }((n-p)\Delta _{t})e^{-j4\pi mp\Delta _{t}\Delta _{f}}\Delta _{t}\end{aligned}}$
    Suppose that $w(t)=0$ for $|t|>B\rightarrow w(2p\Delta _{t})=0$ for $p<-Q$ and $p>Q$
    ${\begin{aligned}W_{x}(n\Delta _{t},m\Delta _{f})=2\sum _{p=-Q}^{Q}w(2p\Delta _{t})x((n+p)\Delta _{t})x^{\ast }((n-p)\Delta _{t})e^{-j4\pi mp\Delta _{t}\Delta _{f}}\Delta _{t}\end{aligned}}$
    We take $x(t)=\delta (t-t_{1})+\delta (t-t_{2})$ as example
    ${\begin{aligned}W_{x}(t,f)=\int _{-\infty }^{\infty }w(\tau )x\left(t+{\frac {\tau }{2}}\right)\cdot x^{*}\left(t-{\frac {\tau }{2}}\right)e^{-j2\pi \tau f}\cdot d\tau \,,\end{aligned}}$
    where $w(\tau )$ is a real function
    And then we compare the difference between two conditions.
    Ideal: $W_{x}(t,f)=0,{\text{ for }}t\neq t_{2},t_{1}$
    When mask function $w(\tau )=1$, which means no mask function.
    $y(t,\tau )=x(t+{\frac {\tau }{2}})$ $y^{*}(t,-\tau )=x^{*}(t-{\frac {\tau }{2}})$
    $W_{x}(t,f)=\int _{-\infty }^{\infty }x(t+{\frac {\tau }{2}})x^{*}(t-{\frac {\tau }{2}})e^{-j2\pi \tau f}d\tau$
    $=\int _{-\infty }^{\infty }[\delta (t+{\frac {\tau }{2}}-t_{1})+\delta (t+{\frac {\tau }{2}}-t_{2})][\delta (t-{\frac {\tau }{2}}-t_{1})+\delta (t-{\frac {\tau }{2}}-t_{2})]e^{-j2\pi \tau f}\cdot d\tau$
    $=4\int _{-\infty }^{\infty }[\delta (2t+\tau -2t_{1})+\delta (2t+\tau -2t_{2})][\delta (2t-\tau -2t_{1})+\delta (2t-\tau -2t_{2})]e^{j2\pi \tau f}\cdot d\tau$

### 3 Conditions

    Then we consider the condition with mask function:
    We can see that $w(\tau )$ have value only between –B to B, thus conducting with $w(\tau )$ can remove cross term of the function. But if x(t) is not a Delta function nor a narrow frequency function, instead, it is a function with wide frequency or ripple. The edge of the signal may still exist between –B and B, which still cause the cross term problem.
    for example: