Language Reference
TFPWV Function
TFPWV (x, window <, overlap> <, fftlen> <, center> <, nthreads> <, hilbert_tsf> ) ;
This function is supported by the IML procedure and the iml action.
The TFPWV function computes the pseudo-Wigner-Ville (PWV) transform of the input vector x. The function returns a three-column matrix that has rows, where
Here series_length is the dimension of the argument x, and window_length is the dimension of the argument window.
The three columns of the resulting output are as follows:
The first column stores the normalized frequency index. The frequency index starts at 0 and increments in multiples of .
The second column stores the time index. The time index starts at 0 and increments in multiples of
window_length– overlap.The third column stores the value of the pseudo-Wigner-Ville distribution that corresponds to the time index and the normalized frequency index.
The input arguments are as follows:
- x
specifies the input vector. If the SAS/HPF product is not installed, the input vector is restricted to elements.
- window
specifies a vector that contains the window values to be used for computation of pseudo-Wigner-Ville distribution. The window must have an odd number of elements. See also the TFWINDOW function.
- overlap
specifies the overlap between consecutive windows, where overlap must be an integer that is strictly less than
window_length. The default value is .- fftlen
specifies the length of the vector on which to perform a finite Fourier transform. The value of fftlen must be a positive integer and must be at least as large as
window_length. The computation runs fastest when fftlen is a power of two. The default value is the greater of 256 andwindow_length.- center
specifies whether to center the input during computations. The default value is 0. The following values are valid:
- 0
does not center the input.
- 1
subtracts the mean of the input vector from each term of the input vector before calculating the PWV distribution. Missing values of the input are excluded in the calculation of the mean.
- nthreads
suggests the number of threads to use during computation. This option is not available unless you have a license for the SAS/HPF product.
- hilbert_tsf
specifies whether to replace the input signal by an analytical signal. The default value is 1. The following values are valid:
- 0
does not replace the input series.
- 1
replaces the input series. If the value of center is 1, the input series is replaced by the analytic signal for the centered signal. Otherwise the analytical signal for the input series is used.
The pseudo-Wigner-Ville distribution is a modification of the Wigner-Ville distribution. The Wigner-Ville distribution of a continuous time series is obtained by computing the Fourier transform of for fixed t as varies. So the Wigner-Ville distribution of a continuous, possibly complex-valued, time series is given by :
It can be shown that the is real even when takes complex values.
The pseudo-Wigner-Ville distribution is obtained by adding an additional term in the defining integral. The pseudo-Wigner-Ville distribution of a continuous time series is given by
The Wigner distribution of discrete time series is defined as follows (Claasen and Mecklenbräuker 1980b, 1980a; Debnath 2002):
From the preceding formula, it follows that is the discrete-time Fourier transform of and provides the basis for the computation here.
Given an input time series , the computation can be considered to be the evaluation of a function , which measures the value of the pseudo-Wigner-Ville distribution at time n and frequency for different values of n and f. Now can be defined: given a possibly complex-valued time series and a window of odd length , where window=(, define
The preceding summation is performed with the following convention: any term in the summation for which both and do not lie between 0 and series_length – 1 is replaced with 0.
If and , the output of the PWV function is determined by the evaluation of the complex value for and for
. If u denotes the real part of , then a row of output consists of the triplet of values as f varies over and n varies over .
The pseudo-Wigner-Ville distribution has some undesirable properties. It displays annoying artifacts for multicomponent time series (Cohen 1995), but you can get better results by replacing the input with the analytic signal that corresponds to the input (Boashash 1988). For this reason, the TFPWV function provides the hilbert_tsf option, which replaces the original series with its analytic signal before computation, and the center option, which removes the mean from the series so that an overall mean effect does not show up in the output. Before any computation, the input series is first transformed depending on the value of the hilbert_tsf and center parameters. First the value of the center parameter is checked; if it is 1, then the input series is replaced by the centered series that is obtained by subtracting the series mean from each term of the series. If the value of the hilbert_tsf parameter is also 1, this possibly centered series is replaced by the analytic signal that corresponds to the centered input.
The following statements demonstrate the TFPWV function:
x = 1:10;
window_len=3; overlap=0; fftlen=4;
window = tfwindow(window_len); /* Hanning window */
output = tfpwv(x, window, overlap, fftlen);
print output[colname={"f" "t" "pwv"}];
Figure 472: Pseudo-Wigner-Ville Distribution of a Signal
| output | ||
|---|---|---|
| f | t | pwv |
| 0 | 0 | 4.4222912 |
| 0.125 | 0 | 4.4222912 |
| 0.25 | 0 | 4.4222912 |
| 0.375 | 0 | 4.4222912 |
| 0 | 3 | 29.422291 |
| 0.125 | 3 | 29.422291 |
| 0.25 | 3 | 29.422291 |
| 0.375 | 3 | 29.422291 |
| 0 | 6 | 64.422291 |
| 0.125 | 6 | 64.422291 |
| 0.25 | 6 | 64.422291 |
| 0.375 | 6 | 64.422291 |