Algorithms For Time-Frequency Signal Analysis
Algorithms For Time-Frequency Signal Analysis
net/publication/277165916
CITATIONS READS
109 744
2 authors, including:
Boualem Boashash
Qatar University
526 PUBLICATIONS 18,358 CITATIONS
SEE PROFILE
All content following this page was uploaded by Boualem Boashash on 20 May 2016.
Pz(t, f) =/!! e j27rv (u-t) g( v, r )z( u + ~ )z*( u - ~ )e- j27r!r dvdudr (1)
distribution. If the integration with respect to v is performed, then where (~) denotes the discrete time convolution, and fm-+k denotes the
the equation becomes: discrete Fourier transform from time (n) to frequency (k).
)/P'("kJ~ where HO is the Hilbert transform [11], and has the ideal impulse
response shown in equation 6.
R.(n, m) rAI, k)
2 sin 2 (7rn/2)
~A
( )
h n = { 7rn
for n =I 0 (6)
. 0, for n = 0
AAI,m)
Figure 7.2. Relationships between discrete time representations. The Hilbert transform can be implemented as a finite-impulse
response (FIR) digital filter, which may be more efficient than the
The expression to be used for discrete time implementation of these Fourier technique., depending on the length of the signal to be
transforms is the discrete time equivalent of equation 2, and is shown transformed, and the length of the filter impulse response used.
in equation 3. Although an ideal Hilbert transform filter has an infinite impulse
M M
response length, in practise an FIR filter length of 79 samples has
pz(n, k) = L L G(p, m)z(n+p+m)z*(n+p-m)e- j41l'mk/N (3) been shown to provide an adequate approximation[4].
This filter could be a rectangular-windowed version of the infinite
m=-Mp=-M
length filter, or it could be an optimal implementation calculated
This can also be expressed as: using one of the filter design algorithms, such as the Remez-exchange
algorithm. This produces a filter which is optimal in a minimax or
(4) Chebyschev sense [I1J.
166 Time-Frequency Signal Analysis Algorithms for TimecFrequency Signal Analysis 167
(I The obvious solution is to check each array index before 9 write(2,*) real(choiCi»
accessing the value, and return zero if the access is outside the 8 continue
array bounds. This is inefficient, since it requires a lot of extra
work in the inner loops of the convolution.
(I Another technique is to move the range checking outside the
loops, so that the indices never exceed the array bounds. This Table 7.1 Some TFDs and their determining functions G ( n, m)
can be quite efficient, especially where the analysis window is
very long. In that case the time required to do the checking, and
the reduced symmetry available may be offset by the reduction
in the number of computations required at the ends of the signal. Time-Frequency Representation G(n,m)
(I The technique used here is to pad the signal in the signal array
with sufficient zero values that the array will not be indexed
ben) mE [-(M-l) (M-l)]
out of bounds. Thus the correct windowing effect is achieved, Windowed Discrete WVD ., 2 ' 2
without any bounds checking within the convolution loops. Here 0 otherwise
the reduced overhead in the 'working' loops makes up for the
extra 'dead' iterations involving computation with zero values. Smoothed WVD using a rectangular window 1 n E [-(P-l) (P-l)]
p 2 ' 2
of odd length P 0 otherwise
This approach is shown in the code fragment below, extracted
frorp. a Choi-Williams distribution program. It reads the data into the Rihaczek-Margenau ~[b(n + m) + b(n - m)]
signal array, converts the signal to an analytic signal (with a call to
SIGANA), and then produces nplts spectra using an analysis window STFT using a Rectangular Window of odd 1 1m + nl ~ (P;-l)
P
of length lwin centered points with a time separation of res samples. length P, 0 otherwise
c end ...
do 10 i=l,LWINMAX-l
z(i)=(O.O,O.O)
10 z(n+LWINMAX+i)=(O.O,O.O)
3.6 Code fragments to generate G(n,m)
do 5 i=LWINMAX,LWINMAX+n-l
read (1, *) x Thi~ sectiOI~.shows example code fragments to generate the distri-
5 z(i)=cuaplx(x,O.O) butIOn specIfication matrix G( n, m) for the functions specified in ta-
ble 7.l.
form the analytic signal: (and get nl as power of 2 .ge. n) . Note that for many of these distributions, this computation tech-
c
call SIGANA(n,z(LWINMAX), .false. ,nl) mque ?f con,"olving the bilinear kernel with the G( n, m) array is obvi-
ously mefficlent, because most of the values of G( n, m) are zero, and
th~ others are a constant (e.g., Wigner-Ville distribution smoothed
do 8 ii=O,nplts-l ~lg~er-yille distri?utio~, Rihaczek-Margenau, and STFT). For these
t=ii*res+hlf+LWINMAX dlstnb~tIOns, algorlthm Improvements yield much higher performance.
call transform(z(t),G,FFTLEN,mf,hlf,KERNMAX,choi) The Wlgner-Ville distribution is the only one for which such an im-
do 9 i=i, FFTLEN provement will be demonstrated.
172 Time- Frequency Signal Analysis Algorithms for Time-Frequency Signal Analysis 173
In this routine, the variable 'wt' is used to ensure that the sum G( n,m) for Rihaczek-Margenau distribution
along every constant 'j' (parallel to the time axis) is exactly one, a
condition necessary to preserve the marginals of the distribution, as c calculate the distribution specification matrix "0"
described in [2], Property 2-7. These are repeated here: do 2 i=O,hlf
do 2 j=O ,hlf
2 G(i+l,j+1)= 0.0
n
do 3 i=l,hlf
L:pz(n, k) = Iz(n)12 3 G(i+1,i+1)= 0.5
k G(l, 1)=1. 0
This is obtained if
3.7 Effect of windowing 4. Where the distribution will be calculated for every time value
there is another optimization, presented by Eilouti and Khadr~
Time-windowed distributions will often be calculated in preference to [~l. Here a recursive technique is used to calculate the analytic
full-length distributions. Two reasons for this. practice are: sIgnal for successive windows. This will not be described here .
• To reduce unnecessary computation, when it is known that the 5. The formulation of the discrete Wigner-Ville distribution (and
signals of interest have a limited time-extent within the data all of the other distributions in Cohen's class) presented here
collected; or produces a result with a frequency scaling of f = M where
·
th t echmques, . 2M'
• When the data stream is continuous (real-time analysis). For oer such as the short-tIme Fourier transform result
this case, it is impractical to collect all of the data before in a scaling of f = ';;. The consequence of this is that the
analysis, as results are required on early sections before later resulting transforms are twice as long as one might expect. To
sections have been collected. overcome this Sun, Li, Sekhar and Sclabassi [12J have shown
how to pr~duce a transform with the usual length, and a saving
Instead of performing all of the operations on the entire signal, only of a~proxlInately half the computations. Since this technique
sections of the signal are read into the data arrays at once, displacing reqUIres the replacement of the fast Fourier transform with their
previous values, and the calculations are repeated for each 'window'. own 'fast Fourier transform in part' (FFTP) it will not be
If the windows are overlapped, then some data must be retained, and described further here. '
shifted forward within the data arrays by an amount equal to the
time-displacement of the window. Only the code for the outer loop and the transform routine will
be presented. It is assumed that the signal array 'z' and input and
out~ut files have been attended to by the surrounding code in a similar
fashIOn to that presented in section 3.5.
4 Wigner-Ville distribution implementation nplts=n/res
c
Although covered in conjunction with the other bilinear time-frequency
c since we're using the 'do two transforms at once'
distributions in the previous section, the implementation of the Wigner-
Ville distribution will be presented again here, as an example of how c optimization, nplts must be even, make it so (possibly
to optimize the general calculation for special cases. c at the expense of the last plot:
There are a number of optimizations applicable to the calculation c
of the Wigner--Ville distribution (some of these also apply to the nplts=(nplts/2)*2
calculation of other TFDs):
1. The array G( n, m) is trivial, and need not be stored or calcu- c Here is the outer loop of the actual distribution calculation:
lated. Instead, its effect can be incorporated into the algorithm. c Call the distribution routine for each two windows of the
2. The bilinear kernel has Hermitian symmetry, and so only values c signal. The signal array z() is passed with a time ojJ.set, t,
for positive lags need be calculated (This applies for all kernels.) c so that the transform2() routine can operate as though t was always
c zero.
3. Two result spectra can be calculated by each Fourier transform.
This is possible because the spectra are known to be real, the
do 8 ii=O,nplts/2-1
Fourier transform is known to be a linear operator, and the
fast Fourier transform routine being used operates exclusively t=ii*res*2+hlf+LWINMAX
on complex data. call transform2 (z(t) ,z(t+res) ,FFTLEN,mf,hlf,wvd)
do 9 i=l,FFTLEN
The best way to use this optimization is to multiply the second
set of lags by j, so that the resulting spectrum-slice will appear 9 write (2 ,*) real(wvdCi»
in the imaginary part of the Fourier transform result. That is: do 11 i=l,FFTLEN
11 write(2,*) aimag(wvd(i)
8 continue
Algorithms for Time-Frequency Signal Analysis 177
176 Time-Frequency Signal Analysis
R(m+i)=vi+cnnplx(-ainnag(v2),real(v2))
R(FFTLEN-m+i)=c°nUg(vi)+cnnplx(ainnag(v2),real(v2))
close (2) 1 continue
999 return c make sure any points not containing calculated values are set
end c to zero, as the FFT length may be greater than the window:
c -------------------
do 3 m=hlf+2,FFTLEN-hlf
subroutine transform2(zl,z2,FFTLEN,mf,hlf,R)
3 R(m)=(O.O,O.O)
connplex zi(i), z2(1), R(i)
connplex vi, v2 call FFT(R,mf ,FFTLEN)
integer FFTLEN,mf,hlf,m
return
end
c This routine forms the bilinear lag array for two kernel
c time-slices at once, for lag values up to hlf. (i. e., using
c a window of length 2*hlf+l centered on elements 0 and res.)
c
c The second set of lag values (those around res) are added
c into the lag array in an 'odd 'fashion, as opposed to the
'even' fashion that the first set were inserted.
5 Other· methods
c
c While the general approach presented will allow calculation of most
c Finally, the Fourier transform of the lag array is taken, time-frequency distributions, it does not cope with all possibilities
c forming the two time-slices at once, in the real and imaginary and. fo.r s~me popular cases it is not the most efficient approach:
parts of the array. OptimIzatIOns of the method for the Wigner-Ville distribution have
c
already been noted. If work is to center on one of these other
c
tech~iques, then more computationally efficient approaches may be
c This is achieved by multiplying the second array of lags by
c~nsidered. Some techniques not covered by the general technique
c j before performing the Fourier transform. Since this is a
wIll ~e commented on 15riefly in this section, and references will be
c linear operator, this also rotates the resulting spectrum into provIded for source~ of further information.
c the imaginary plane.
c
c Finally, it is known that the z array origin is not situated 5.1 The wavelet transform
c at the beginning of the signal array, but is at least 2*hlf
This is a linear transform, as opposed to the bilinear distributions
c from either end. Thus negative array indices may be used, and discuss~d in t~is chapter, and has the interesting property of time
c a substantial complexity reduction may be realized, as no resolutIOn whIch is a function of frequency. See [7) for more
c special cases are introduced at the beginning and end of the information.
c signal (see section 3.5)
3. Convolve the bilinear kernel with the distribution specification A rray Processing (Prentice-Hall Signal Processing Series), S.
function G(n, m), (sections 3.2, 3.6). Haykin, editor, Englewood Cliffs, NJ, Prentice-Hall, 1990.
4. Take the discrete Fourier transform with respect to lag (m) for [8J H. H. Eilouti and L. M. Khadra, "Optimized Implementation of
each time instant (section 3.3). Real-Time Discrete Wigner Distribution," Electronics Letters,
25, no. 11, pp. 706,707, 25 May 1989.
This process was demonstrated for the case of the Choi-Williams [9] S. Kay, Modern Spectral Analysis, Englewood Cliffs, NJ, Prentice-
distribution in the code fragments in sections 3.4 and 3.5. Hall, 1989.
This algorithm can be simplified and optimized quite significantly
[10J S. L. Marple, Jr, Digital Spectral Analysis with Applications,
for a number of common members of Cohen's class, due to extra
Englewood Cliffs, NJ, Prentice-Hall, 1987.
properties of the kernel. The Wigner-Ville distribution was presented
as an example of how the kernel selection function G(n, m) can be [11] A. V. Oppenheim and R. W. Schafer, Discrete-Time Signal
incorporated into the algorithm, rather than being stored or calculated Processing, Englewood Cliffs, NJ, Prentice-Hall, 1989.
(see section 4). [12] M. Sun, C. C., Li, L. N. Sekhar and R. J. Sclabassi, "Effi-
References were presentedfdr a number of other popular time- cient Computation of the Disc,r~tet'p'seudo- Wigner Distribution,"
frequency signal analysis techniques which do not fit into this frame- IEEE Trans. Acoust. Speech Signal. Process., 37, no. 11, pp.
work, in section 5. 1735-1742, November 1989.
The final section (6) briefly described a signal analysis package [13] H. J. Whitehouse, B. Boashash and J. M. Speiser, "High Res-
written by the authors and their colleagues which utilizes most of the olution Processing Techniques for Temporal and Spatial Sig-
techniques presented. nals," in High Resolution Techniques in Underwater Acoustics
(L~cture Notes in Control and Information Series), New York-
HeIdelberg-Berlin, Springer-Verlag, 1989.
[14J Y. Zhao, L. E. Atlas and R. J. Marks "The Use of Cone-Shaped
References Kernels for Generalized Time-Frequency Representations of
Nonstationary Signals," IEEE Trans. Acoust. Speech Signal.
[1] R. A. Altes, "Wideband, Proportional Bandwidth Wigner-Ville Process., 38, no. 7, July 1990.
Analysis," IEEE Trans. Acoust. Speech Signal. Process., 38,
June 1990.
[2J B. Boashash, "Time-Frequency Signal Analysis", in Advances
in Spectral Analysis and Array Processing (Prentice-Hall Signal
Processing Series), S. Haykin, editor, Englewood Cliffs, NJ,
Prentice-Hall, 1990.
[3J B. Boashash, "Note on the Use of the Wigner Distribution of
Time-Frequency Signal Analysis", IEEE Trans. Acoust. Speech
Signal. Process., 36, pp. 1518-1521, September 1988.
[4] B. Boashash and P. Black, "An Efficient Real Time Implemen-
tation of the Wigner-Ville Distribution", IEEE Trans. Acoust.
Speech Signal. Process. ASSP 35, no. 11, pp. 1611-1618,
November 1987, CRISSP Reference CSP 87/6.
[5J P. Boles, "Application of the Cross-Wigner-Ville Distribution
to Seismic Surveying" in TFSA Methods and Applications, B.
Boashash, editor, Longman Cheshire, 1991.
[6] L. Cohen, "Time-Frequency Distributions-A Review," IEEE
Proc., 77, no. 7, pp. 941-981, July 1989.
[7J 1. Daubechies, "The Wavelet Transform: a Method for Tirne-
Frequency Localization" in Advances in Spectral Analysis and
View publication stats