Digital Signal Processing 11, 110–119 (2001) doi:10.1006/dspr.2001.0389, available online at http://www.idealibrary.com on
On the Computation of an Averaged Coherence Function Gary D. Brushe and Jeremy R. Waller Signals Analysis Discipline, Communications Division, Defence Science and Technology Organisation, P.O. Box 1500, Salisbury, South Australia 5108, Australia E-mail:
[email protected],
[email protected]
Brushe, Gary D., and Waller, Jeremy R., On the Computation of an Averaged Coherence Function, Digital Signal Processing 11 (2001) 110–119. The coherence function provides a measure of the statistical independence of two stochastic processes and is computed by using the cross spectrum and auto spectra of those processes. This paper examines the computation of an averaged coherence function from multiple blocks of data obtained from two sensors. In signal detection theory, it is generally assumed that the channels through which a signal passes are wide-sense stationary. However, in practical situations this assumption may not be valid and the signal may actually have passed through nonstationary phase channels. This paper demonstrates that in these situations it may be better to average the cross spectrum (used to compute the coherence function) in the polar coordinate system instead of the Cartesian coordinate system. It is demonstrated that averaging the coherence function under the Cartesian coordinate system can produce an averaged estimate that is inconsistent with the meaning of the individual coherence functions that have been averaged. However, averaging the coherence function under the polar coordinate system produces an averaged coherence function that is consistent with the meaning of the individual coherence functions that have been averaged. 2001 Academic Press Key Words: averaged cross spectra; coherence function; averaging complex numbers; polar and Cartesian coordinates.
1. INTRODUCTION The averaging of complex numbers occurs in a variety of fields such as physics, array processing, signal detection, and control theory. This averaging is done to attempt to remove randomness (due to noise) by evaluating the expectation. How these complex numbers are averaged may result in obtaining a system
1051-2004/01 $35.00 Copyright 2001 by Academic Press All rights of reproduction in any form reserved.
Brushe and Waller: Computing an Averaged Coherence Function
111
performance which differs significantly. The computation of cross spectra has long been used in the field of digital signal processing, e.g., in signal detection. The cross spectrum represents the Fourier transform of the cross correlation function. The cross spectrum is a complex valued function whose magnitude and phase are used in signal processing to indicate the degree of correlation between two signals. As stated by Kay [1] the magnitude of the cross spectrum describes whether frequency components of one signal are associated with large or small amplitudes at the same frequency in the second signal, while the phase of the cross spectrum indicates the phase lag or lead of one signal with respect to the second signal for a given frequency component. The cross spectrum is used to determine the coherence function between two signals. Commonly used signal processing packages (such as Matlab) have routines which readily compute the cross spectrum of two signals and their coherence function. If the input signal length is two or more times the length of the Fourier transform size, then these routines compute two or more cross spectra and average them in order to output a single cross spectrum estimate. Previous investigations [3–6] into the computation of the coherence function between two signals assume that they are wide-sense stationary random processes. This assumption is common in signal processing analysis, as it makes the analysis tractable. But most practical situations are nonstationary. However, in the case of spectral analysis it has been shown [2] that the analysis performed using stationarity assumptions still holds in nonstationary situations. But care should be taken, in some nonstationary situations, before applying analysis based on stationarity—particularly, as we show, with the computation of an averaged cross spectrum and hence an averaged coherence function. In this paper we consider the problem of averaging cross spectra in order to produce an averaged estimate of the cross spectrum, used to compute the coherence function. We show that the method used to compute an averaged cross spectrum can affect the estimate and in extreme cases give completely misleading results compared to the results obtained from the individual cross spectrum used to compute the average.
2. THEORY Let x(t) and y(t) be the received measurements of a signal which has passed through two different channels. The Fourier transforms of x(t) and y(t) are F {x(t)} = X(f ) and F {y(t)} = Y (f ), respectively. The auto spectrum of x(t) is Sxx (f ) = X(f )X∗ (f ), 1 while the cross spectrum between x(t) and y(t) is Syx (f ) = Y (f )X∗ (f ). Commonly discrete Fourier transforms (DFTs) of x(t) and y(t) are computed over numerous blocks of data. Thus, the estimated complex coherence function for block k between x(t) and y(t) is given by Cˆ k (f ) = q
1
(Sˆyx (f ))k (Sˆxx (f ))k (Sˆyy (f ))k
Where X∗ (f ) is the complex conjugate of X(f ).
(1)
Digital Signal Processing Vol. 11, No. 2, April 2001
112
and the estimated magnitude squared coherence is |Cˆ k (f )|2 =
|(Sˆyx (f ))k |2 . (Sˆxx (f ))k (Sˆyy (f ))k
(2)
Now the averaged magnitude squared coherence over N blocks of DFTs between x(t) and y(t) may be computed as ¯ )|2 = |C(f
N 1 X ˆ |Ck (f )|2 . N
(3)
k=1
But exactly how should the averaged magnitude squared coherence be computed? A number of papers [3–6] compute the averaged cross spectrum and auto spectra as N 1 X Yk (f )Xk∗ (f ) S¯yx (f ) = N
(4)
N 1 X ¯ Xk (f )Xk∗ (f ) Sxx (f ) = N
(5)
N 1 X Yk (f )Yk∗ (f ) S¯yy (f ) = N
(6)
k=1
k=1
k=1
and then compute the averaged magnitude squared coherence as |(S¯yx (f ))|2 . (S¯xx (f ))(S¯yy (f ))
¯ )|2 = |C(f
(7)
However, in a nonstationary phase scenario this method may prevent any coherency that exists from being detected. Another method for computing the averaged magnitude squared coherence is ¯ )|2 = |C(f
1 N
PN
k=1 |(Syx (f ))k |
S¯xx (f )S¯yy (f )
2
.
(8)
The question now is which form of averaging is better suited for computing an averaged cross spectrum used in computing the averaged coherence function. If we represent the estimated cross spectrum for block k in Cartesian coordinates, we have (Sˆyx (f ))k = ak (f ) + j bk (f )
(9)
and thus an averaged cross spectrum computed using Cartesian coordinates c (f )) is (denoted by S¯yx N 1 X c (f ) = (ak (f ) + j bk (f )), S¯yx N k=1
(10)
Brushe and Waller: Computing an Averaged Coherence Function
113
c (f ) is where the magnitude of S¯yx
v u u c ¯ |Syx (f )| = t
N 1 X ak (f ) N
!2 +
k=1
N 1 X bk (f ) N
!2 (11)
k=1
c (f ) is and the phase of S¯yx
6
PN k=1 bk (f ) c −1 ¯ . Syx (f ) = tan PN k=1 ak (f )
(12)
While an averaged cross spectrum computed using polar coordinates (denoted p by S¯yx (f )) is p S¯yx (f ) = ρ(cos(φ) + j sin(φ)),
(13)
p where ρ is the magnitude of S¯yx (f ) computed as
ρ=
N 1 X |(Syx (f ))k | N
(14)
N q 1 X ak2 (f ) + bk2 (f ) N
(15)
k=1
=
k=1
p and φ is the phase of S¯yx (f ) computed as
φ=
N 1 X 6 (Syx (f ))k N
(16)
k=1
=
N bk (f ) 1 X tan−1 . N ak (f )
(17)
k=1
Clearly the only time Eqs. (11) and (15) are equal is when all the ak (f )’s are equal and all the bk (f )’s are equal, that is, in a situation where the cross spectra are not changing over time. In all other cases the value of the cross spectrum magnitude computed via averaging in polar coordinates is always greater than the value of the cross spectrum magnitude computed via averaging in Cartesian coordinates. In a practical signal detection scenario, where the cross spectra phase may be varying (for example, due to nonstationary phase channels and/or movement of the collection sensors relative to each other), then the difference in the averaged cross spectrum magnitude (and hence the averaged magnitude squared coherence function value) computed via polar and Cartesian averaging may be significant and could be the difference as to whether or not a signal is detected.
Digital Signal Processing Vol. 11, No. 2, April 2001
114
3. SIMULATIONS We wish to detect a signal that has been received at two different receiving sensors and has been subjected to nonstationary phase channels, which affects the cross spectrum phase (over time), causing it to fluctuate through + π2 and − π2 . In order to illustrate the difference between computing the averaged cross spectrum (and hence coherence function) in the polar and Cartesian coordinate systems, the following simulation has been proposed. A wide band signal was simulated to have passed through two nonstationary phase channels. The channel phase was changed halfway through the simulation, such that the cross spectrum’s phase (i.e., the phase spectrum) shifted by π2 radians. A total of 60,000 samples for each signal was used in the simulation. The averaged cross spectrum and averaged magnitude squared coherence function was then computed using 5000 point DFTs, initially for the following two cases. The first case using only the first half of the data (i.e., the first 30,000 points) and the second case using the second half of the data (i.e., the last 30,000 points). Since nothing has changed in each half of the data, the outcome is invariant to the type of averaging used. Figs. 1 and 2 show the average magnitude squared coherence function and average phase spec-
FIG. 1. Average magnitude squared coherence—first half of data.
Brushe and Waller: Computing an Averaged Coherence Function
115
FIG. 2. Average phase—first half of data.
trum, respectively, obtained for the first half of the data, while Figs. 3 and 4 show these for the second half of the data. The averaged cross spectrum and hence averaged magnitude squared coherence function was then computed using all 60,000 points using 5000-point DFTs. This was done by averaging in both the polar and the Cartesian coordinate systems. Note the Cartesian coordinate estimate for the averaged magnitude squared coherence function and averaged cross spectrum phase was obtained using Matlab “spectrum” command. Figs. 5 and 6 show the averaged magnitude squared coherence function and averaged phase spectrum, respectively, computed using polar coordinate averaging, while Figs. 7 and 8 show the result of computing the average magnitude squared coherence function and average phase spectrum via Cartesian coordinate averaging.
Note. The authors’ intention in this paper is to highlight the benefits of polar averaging over Cartesian averaging in some signal processing areas (such as signal detection) and that researchers should investigate which method is better suited to their particular application. We are not advocating that all complex number averaging should be done in the polar coordinate system; as one would remember from mechanics, equal and opposite forces cancel, and thus if one wishes to average complex numbers that represent forces the correct method would be to use Cartesian averaging.
Digital Signal Processing Vol. 11, No. 2, April 2001
116
FIG. 3. Average magnitude squared coherence—second half of data.
FIG. 4.
Average phase—second half of data.
Brushe and Waller: Computing an Averaged Coherence Function
FIG. 5.
Average magnitude squared coherence—polar average.
FIG. 6.
Average phase—polar average.
117
118
Digital Signal Processing Vol. 11, No. 2, April 2001
FIG. 7. Average magnitude squared coherence—Cartesian average.
FIG. 8. Average phase—Cartesian average.
Brushe and Waller: Computing an Averaged Coherence Function
119
4. CONCLUSIONS In this paper we have shown that it may be possible to obtain significant performance gains in the area of signal detection involving practical situations with nonstationary phase channels. The performance gain is possible if one averages the cross spectra, computed from finite length data blocks collected from two receivers, using the polar coordinate system as opposed to averaging in the Cartesian coordinate system. It should be noted that averaging in the polar coordinate system will cause the “noise floor” to increase (see Fig. 5), but this is compensated for by the fact that the coherence is visible and hence detectable.
REFERENCES 1. Kay, S. M., Modern Spectral Estimation: Theory and Application. Prentice Hall International, Englewood Cliffs, NJ, 1988. 2. Middleton, D., An Introduction to Statistical Communication Theory. IEEE Press, Piscataway, NJ, 1996. 3. Carter, G. C., Knapp, C. H., and Nuttall, A. H., Estimation of the magnitude-squared coherence function via overlapped fast Fourier transform prcessing. IEEE Trans. Audio Electroacoust. AU21, No. 4 (1973), 337–344. 4. Carter, G. C., Knapp, C. H., and Nuttall, A. H., Statistics of the estimate of the magnitudecoherence function. IEEE Trans. Audio Electroacoust. AU-21, No. 4 (1973), 388–389. 5. Barnard, T. E., Legendre polynomial expressions for the probability density function of magnitude-squared coherence estimates. IEEE Trans. Acoust. Speech Signal Process. ASSP-29, No. 1 (1981), 107–108. 6. Bendat, J. S. and Piersol, A. G., Engineering Applications of Correlation and Spectral Analysis. Wiley, New York, 1993.