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 fftlen times k 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:

  1. The first column stores the normalized frequency index. The frequency index starts at 0 and increments in multiples of 1 slash left-parenthesis 2 sans-serif-italic fftlen right-parenthesis.

  2. The second column stores the time index. The time index starts at 0 and increments in multiples of window_lengthoverlap.

  3. 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 2 Superscript 20 Baseline equals 1048576 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 left floor sans-serif w sans-serif i sans-serif n sans-serif d sans-serif o sans-serif w sans-serif bar sans-serif l sans-serif e sans-serif n sans-serif g sans-serif t sans-serif h slash 2 right floor.

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 and window_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 x left-parenthesis t right-parenthesis is obtained by computing the Fourier transform of x left-parenthesis t plus tau slash 2 right-parenthesis ModifyingAbove x left-parenthesis t minus tau slash 2 right-parenthesis With bar for fixed t as tau varies. So the Wigner-Ville distribution of a continuous, possibly complex-valued, time series x left-parenthesis t right-parenthesis is given by upper W Subscript x Baseline left-parenthesis t comma f right-parenthesis:

It can be shown that the upper W Subscript x Baseline left-parenthesis t comma f right-parenthesis is real even when x left-parenthesis t right-parenthesis 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 x left-parenthesis t right-parenthesis is given by

where w left-parenthesis tau right-parenthesis is a window function.

The Wigner distribution of discrete time series x left-bracket k right-bracket is defined as follows (Claasen and Mecklenbräuker 1980b, 1980a; Debnath 2002):

From the preceding formula, it follows that upper W Subscript n Baseline left-parenthesis n comma f slash 2 right-parenthesis is the discrete-time Fourier transform of x left-bracket n plus k right-bracket ModifyingAbove x left-bracket n minus k right-bracket With bar and provides the basis for the computation here.

Given an input time series x left-parenthesis t right-parenthesis, the computation can be considered to be the evaluation of a function upper U Subscript x Baseline left-parenthesis n comma f right-parenthesis, which measures the value of the pseudo-Wigner-Ville distribution at time n and frequency f slash 2 for different values of n and f. Now upper U Subscript x Baseline left-parenthesis n comma f right-parenthesis can be defined: given a possibly complex-valued time series x equals left-parenthesis x left-bracket 0 right-bracket comma x left-bracket 2 right-bracket comma ellipsis comma x left-bracket upper L minus 1 right-bracket right-parenthesis and a window of odd length 2 m plus 1, where window=(w left-bracket 0 right-bracket comma ellipsis comma w left-bracket 2 m right-bracket right-parenthesis, define

The preceding summation is performed with the following convention: any term in the summation for which both n plus k and n minus k do not lie between 0 and series_length – 1 is replaced with 0.

If upper S equals sans-serif w sans-serif i sans-serif n sans-serif d sans-serif o sans-serif w sans-serif bar sans-serif l sans-serif e sans-serif n sans-serif g sans-serif t sans-serif h minus sans-serif-italic overlap and k equals left floor StartFraction sans-serif s sans-serif e sans-serif r sans-serif i sans-serif e sans-serif s sans-serif bar sans-serif l sans-serif e sans-serif n sans-serif g sans-serif t sans-serif h minus sans-serif-italic overlap Over upper S EndFraction right floor, the output of the PWV function is determined by the evaluation of the complex value upper U Subscript x Baseline left-parenthesis n comma f right-parenthesis for n equals 0 comma upper S comma 2 upper S comma ellipsis comma k upper S and for
f equals 0 comma 1 slash sans-serif-italic fftlen comma ellipsis comma left-parenthesis sans-serif-italic fftlen negative 1 right-parenthesis slash sans-serif-italic fftlen. If u denotes the real part of upper U Subscript x Baseline left-parenthesis n comma f right-parenthesis, then a row of output consists of the triplet of values left-parenthesis f slash 2 comma n comma u right-parenthesis as f varies over 1 slash sans-serif-italic fftlen comma ellipsis comma left-parenthesis sans-serif-italic fftlen negative 1 right-parenthesis slash sans-serif-italic fftlen and n varies over 0 comma upper S comma 2 upper S comma ellipsis comma k upper S.

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
ftpwv
004.4222912
0.12504.4222912
0.2504.4222912
0.37504.4222912
0329.422291
0.125329.422291
0.25329.422291
0.375329.422291
0664.422291
0.125664.422291
0.25664.422291
0.375664.422291


Last updated: April 16, 2021