Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 48 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
48
Dung lượng
424,19 KB
Nội dung
8
Adaptive Filtering
As discussed in previous chapters, filtering refers to the linear process designed to alter
the spectral content of an input signal in a specified manner. In Chapters 5 and 6, we
introduced techniques for designing and implementing FIR and IIR filters for given
specifications. Conventional FIR and IIR filters are time-invariant. They perform linear
operations on an input signal to generate an output signal based on the fixed coeffi-
cients. Adaptive filters are time varying, filter characteristics such as bandwidth and
frequency response change with time. Thus the filter coefficients cannot be determined
when the filter is implemented. The coefficients of the adaptive filter are adjusted
automatically by an adaptive algorithm based on incoming signals. This has the import-
ant effect of enabling adaptive filters to be applied in areas where the exact filtering
operation required is unknown or is non-stationary.
In Section 8.1, we will review the concepts of random processes that are useful in the
development and analysis of various adaptive algorithms. The most popular least-mean-
square (LMS) algorithm will be introduced in Section 8.2. Its important properties will be
analyzed in Section 8.3. Two widely used modified adaptive algorithms, the normalized
and leaky LMS algorithms, will be introduced in Section 8.4. In this chapter, we introduce
and analyze the LMS algorithm following the derivation and analysis given in [8]. In
Section 8.5, we will briefly introduce some important applications of adaptive filtering.
The implementation considerations will be discussed in Section 8.6, and the DSP imple-
mentations using the TMS320C55x will be presented in Section 8.7.
8.1 Introduction to Random Processes
A signal is called a deterministic signal if it can be described precisely and be reproduced
exactly and repeatedly. However, the signals encountered in practice are not necessarily
of this type. A signal that is generated in a random fashion and cannot be described by
mathematical expressions or rules is called a random (or stochastic) signal. The signals
in the real world are often random in nature. Some common examples of random
signals are speech, music, and noises. These signals cannot be reproduced and need to
be modeled and analyzed using statistical techniques. We have briefly introduced
probability and random variables in Section 3.3. In this section, we will review the
important properties of the random processes and introduce fundamental techniques
for processing and analyzing them.
Real-Time DigitalSignal Processing. Sen M Kuo, Bob H Lee
Copyright # 2001 John Wiley & Sons Ltd
ISBNs: 0-470-84137-0 (Hardback); 0-470-84534-1 (Electronic)
A random process may be defined as a set of random variables. We associate a time
function xnxn, A with every possible outcome A of an experiment. Each time
function is called a realization of the random process or a random signal. The ensemble
of all these time functions (called sample functions) constitutes the random process xn.
If we sample this process at some particular time n
0
, we obtain a random variable. Thus
a random process is a family of random variables.
We may consider the statistics of a random process in two ways. If we fix the time n at
n
0
and consider the random variable xn
0
, we obtain statistics over the ensemble. For
example, Exn
0
is the ensemble average, where EÁ is the expectation operation
introduced in Chapter 3. If we fix A and consider a particular sample function, we
have a time function and the statistics we obtain are temporal. For example, Exn, A
i
is the time average. If the time average is equal to the ensemble average, we say that the
process is ergodic. The property of ergodicity is important because in practice we often
have access to only one sample function. Since we generally work only with temporal
statistics, it is important to be sure that the temporal statistics we obtain are the true
representation of the process as a whole.
8.1.1 Correlation Functions
For many applications, one signal is often used to compare with another in order to
determine the similarity between the pair, and to determine additional information
based on the similarity. Autocorrelation is used to quantify the similarity between two
segments of the same signal. The autocorrelation function of the random process x(n)is
defined as
r
xx
n, kExnxk: 8:1:1
This function specifies the statistical relation of two samples at different time index n
and k, and gives the degree of dependence between two random variables of n À k
units apart. For example, consider a digital white noise x(n) as uncorrelated random
variables with zero-mean and variance s
2
x
. The autocorrelation function is
r
xx
n, kExnxk ExnExk
0, n T k
s
2
x
, n k.
&
8:1:2
If we subtract the means in (8.1.1) before taking the expected value, we have the
autocovariance function
g
xx
n, kEfxnÀm
x
nxkÀm
x
kg r
xx
n, kÀm
x
nm
x
k: 8:1:3
The objective in computing the correlation between two different random signals is
to measure the degree in which the two signals are similar. The crosscorrelation
and crosscovariance functions between two random processes x(n) and y(n) are defined
as
r
xy
n, kExnyk 8:1:4
352 ADAPTIVE FILTERING
and
g
xy
n, kEfxnÀm
x
nykÀm
y
kg r
xy
n, kÀm
x
nm
y
k: 8:1:5
Correlation is a very useful DSP tool for detecting signals that are corrupted
by additive random noise, measuring the time delay between two signals, determining
the impulse response of a system (such as obtain the room impulse response used in
Section 4.5.2), and many others. Signal correlation is often used in radar, sonar, digital
communications, and other engineering areas. For example, in CDMA digital commu-
nications, data symbols are represented with a set of unique key sequences. If one of
these sequences is transmitted, the receiver compares the received signal with every
possible sequence from the set to determine which sequence has been received. In radar
and sonar applications, the received signal reflected from the target is the delayed
version of the transmitted signal. By measuring the round-trip delay, one can determine
the location of the target.
Both correlation functions and covariance functions are extensively used in analyzing
random processes. In general, the statistical properties of a random signal such as the
mean, variance, and autocorrelation and autocovariance functions are time-varying
functions. A random process is said to be stationary if its statistics do not change
with time. The most useful and relaxed form of stationary is the wide-sense stationary
(WSS) process. A random process is called WSS if the following two conditions are
satisfied:
1. The mean of the process is independent of time. That is,
Exn m
x
, 8:1:6
1. where m
x
is a constant.
2. The autocorrelation function depends only on the time difference. That is,
r
xx
kExn kxn: 8:1:7
Equation (8.1.7) indicates that the autocorrelation function of a WSS process is inde-
pendent of the time shift and r
xx
k denotes the autocorrelation function of a time lag of
k samples.
The autocorrelation function r
xx
k of a WSS process has the following important
properties:
1. The autocorrelation function is an even function of the time lag k. That is,
r
xx
Àkr
xx
k: 8:1:8
2. The autocorrelation function is bounded by the mean squared value of the process
expressed as
jr
xx
kj r
xx
0, 8:1:9
INTRODUCTION TO RANDOM PROCESSES 353
2. where r
xx
0Ex
2
n is equal to the mean-squared value, or the power in the
random process.
In addition, if x(n) is a zero-mean random process, we have
r
xx
0Ex
2
n s
2
x
: 8:1:10
Thus the autocorrelation function of a signal has its maximum value at zero lag.
If x(n) has a periodic component, then r
xx
k will contain the same periodic com-
ponent.
Example 8.1: Given the sequence
xna
n
un,0< a < 1,
the autocorrelation function can be computed as
r
xx
k
I
nÀI
xn kxn
I
n0
a
nk
a
n
a
k
I
n0
a
2
n
:
Since a < 0, we obtain
r
xx
k
a
k
1 À a
2
:
Example 8.2: Consider the sinusoidal signal expressed as
xncos!n,
find the mean and the autocorrelation function of x(n).
(a) m
x
Ecos!n 0.
(b) r
xx
kExn kxn Ecos!n !kcos!n
1
2
Ecos2!n !k
1
2
cos!k
1
2
cos!k:
The crosscorrelation function of two WSS processes x(n) and y(n) is defined as
r
xy
kExn kyn: 8:1:11
This crosscorrelation function has the property
r
xy
kr
yx
Àk: 8:1:12
Therefore r
yx
k is simply the folded version of r
xy
k. Hence, r
yx
k provides exactly
the same information as r
xy
k, with respect to the similarity of x(n)toy(n).
354 ADAPTIVE FILTERING
In practice, we only have one sample sequence fxng available for analysis. As
discussed earlier, a stationary random process x(n) is ergodic if all its statistics can be
determined from a single realization of the process, provided that the realization is long
enough. Therefore time averages are equal to ensemble averages when the record length
is infinite. Since we do not have data of infinite length, the averages we compute differ
from the true values. In dealing with finite-duration sequence, the sample mean of x(n)
is defined as
m
x
1
N
NÀ1
n0
xn, 8:1:13
where N is the number of samples in the short-time analysis interval. The sample
variance is defined as
s
2
x
1
N
NÀ1
n0
Â
xnÀm
x
Ã
2
: 8:1:14
The sample autocorrelation function is defined as
r
xx
k
1
N À k
NÀkÀ1
n0
xn kxn, k 0, 1, , N À 1, 8:1:15
where N is the length of the sequence x(n). Note that for a given sequence of length
N, Equation (8.1.15) generates values for up to N different lags. In practice, we can
only expect good results for lags of no more than 5±10 percent of the length of the
signals.
The autocorrelation and crosscorrelation functions introduced in this section can be
computed using the MATLAB function xcorr in the SignalProcessing Toolbox. The
crosscorrelation function r
xy
k of the two sequences x(n) and y(n) can be computed
using the statement
c = xcorr(x, y);
where x and y are length N vectors and the crosscorrelation vector c has length 2N À 1.
The autocorrelation function r
xx
k of the sequence x(n) can be computed using the
statement
c = xcorr(x);
In addition, the crosscovariance function can be estimated using
v = xcov(x, y);
and the autocovariance function can be computed with
v = xcov(x);
See SignalProcessing Toolbox User's Guide for details.
INTRODUCTION TO RANDOM PROCESSES 355
8.1.2 Frequency-Domain Representations
In the study of deterministic digital signals, we use the discrete-time Fourier transform
(DTFT) or the z-transform to find the frequency contents of the signals. In this section,
we will use the same transform for random signals. Consider an ergodic random process
x(n). This sequence cannot be really representative of the random process because the
sequence x(n) is only one of infinitely possible sequences. However, if we consider the
autocorrelation function r
xx
k, the result is always the same no matter which sample
sequence is used to compute r
xx
k. Therefore we should apply the transform to r
xx
k
rather than x(n).
The correlation functions represent the time-domain description of the statistics of a
random process. The frequency-domain statistics are represented by the power density
spectrum (PDS) or the autopower spectrum. The PDS is the DTFT (or the z-transform)
of the autocorrelation function r
xx
k of a WSS signal x(n) defined as
P
xx
!
I
kÀI
r
xx
ke
Àj!k
, 8:1:16
or
P
xx
z
I
kÀI
r
xx
kz
Àk
: 8:1:17
A sufficient condition for the existence of the PDS is that r
xx
k is summable. The PDS
defined in (7.3.16) is equal to the DFT of the autocorrelation function. The windowing
technique introduced in Section 7.3.3 can be used to improve the convergence properties
of (7.3.16) and (7.3.17) if the DFT is used in computing the PDS of random signals.
Equation (8.1.16) implies that the autocorrelation function is the inverse DTFT of the
PDS, which is expressed as
r
xx
k
1
2p
p
Àp
P
xx
!e
j!k
d!: 8:1:18
From (8.1.10), we have the mean-square value
Ex
2
n r
xx
0
1
2p
p
Àp
P
xx
!d!: 8:1:19
Thus r
xx
0 represents the average power in the random signal x(n). The PDS is a
periodic function of the frequency !, with the period equal to 2p. We can show (in the
exercise problems) that P
xx
! of a WSS signal is a real-valued function of !.Ifx(n)isa
real-valued signal, P
xx
! is an even function of !. That is,
P
xx
!P
xx
À!8:1:20
or
P
xx
zP
xx
z
À1
: 8:1:21
356 ADAPTIVE FILTERING
The DTFT of the crosscorrelation function P
xy
! of two WSS signals x(n) and y(n)is
given by
P
xy
!
I
kÀI
r
xy
ke
Àj!k
, 8:1:22
or
P
xy
z
I
kÀI
r
xy
kz
Àk
: 8:1:23
This function is called the cross-power spectrum.
Example 8.3: The autocorrelation function of a WSS white random process can be
defined as
r
xx
ks
2
x
dkm
2
x
: 8:1:24
The corresponding PDS is given by
P
xx
!s
2
x
2pm
2
x
d!, j!j p: 8:1:25
An important white random signal is called white noise, which has zero mean.
Thus its autocorrelation function is expressed as
r
xx
ks
2
x
dk, 8:1:26
and the power spectrum is given by
P
xx
!s
2
x
, j!j < p, 8:1:27
which is of constant value for all frequencies !.
Consider a linear and time-invariant digital filter defined by the impulse response
h(n), or the transfer function H(z). The input of the filter is a WSS random signal x(n)
with the PDS P
xx
!. As illustrated in Figure 8.1, the PDS of the filter output y(n) can
be expressed as
P
yy
!
H!
2
P
xx
!8:1:28
or
P
yy
z
Hz
2
P
xx
z, 8:1:29
INTRODUCTION TO RANDOM PROCESSES 357
h(n)
H(w)
x(n)
P
xx
(w) P
yy
(w)
y(n)
Figure 8.1 Linear filtering of random processes
where H! is the frequency response of the filter. Therefore the value of the output
PDS at frequency ! depends on the squared magnitude response of the filter and the
input PDS at the same frequency.
Another important relationships between x(n) and y(n) are
m
y
E
I
lÀI
hlxn À l
45
I
lÀI
hlExn À l m
x
I
lÀI
hl, 8:1:30
and
r
yx
kEyn kxn E
I
lÀI
hlxn k Àlxn
45
I
lÀI
hlr
xx
k À lhkÃr
xx
k:
8:1:31
Taking the z-transform of both sides, we obtain
P
yx
zHzP
xx
z: 8:1:32
Similarly, the relationships between the input and the output signals are
r
xy
k
I
lÀI
hlr
xx
k lhkÃr
xx
Àk8:1:33
and
P
yx
zH
Ã
zP
xx
z: 8:1:34
If the input signal x(n) is a zero-mean white noise with the autocorrelation function
defined in (8.1.26), Equation (8.1.31) becomes
r
yx
k
I
lÀI
hls
2
x
dk À ls
2
x
hk: 8:1:35
This equation shows that by computing the crosscorrelation function r
yx
k, the impulse
response h(n) of a filter (or system) can be obtained. This fact can be used to estimate an
unknown system such as the room impulse response used in Chapter 4.
358 ADAPTIVE FILTERING
Example 8.4: Let the system shown in Figure 8.1 be a second-order FIR filter. The
input x(n) is a zero-mean white noise given by Example 8.3, and the I/O equation
is expressed as
ynxn3xn À 12xn À 2:
Find the mean m
y
and the autocorrelation function r
yy
k of the output y(n).
(a) m
y
Eyn Exn 3Exn À 1 2Exn À 2 0.
(b) r
yy
kEyn kyn
14r
xx
k9r
xx
k À 19r
xx
k 12r
xx
k À 22r
xx
k 2
14s
2
x
if k 0
9s
2
x
if k Æ1
2s
2
x
if k Æ2
0 otherwise.
V
b
b
b
`
b
b
b
X
8.2 Adaptive Filters
Many practical applications involve the reduction of noise and distortion for extraction
of information from the received signal. The signal degradation in some physical
systems is time varying, unknown, or possibly both. Adaptive filters provide a useful
approach for these applications. Adaptive filters modify their characteristics to achieve
certain objectives and usually accomplish the modification (adaptation) automatically.
For example, consider a high-speed modem for transmitting and receiving data over
telephone channels. It employs a filter called a channel equalizer to compensate for
the channel distortion. Since the dial-up communication channels have different char-
acteristics on each connection and are time varying, the channel equalizers must be
adaptive.
Adaptive filters have received considerable attention from many researchers over the
past 30 years. Many adaptive filter structures and adaptation algorithms have been
developed for different applications. This chapter presents the most widely used adap-
tive filter based on the FIR filter with the LMS algorithm. Adaptive filters in this class
are relatively simple to design and implement. They are well understood with regard to
convergence speed, steady-state performance, and finite-precision effects.
8.2.1 Introduction to Adaptive Filtering
An adaptive filter consists of two distinct parts ± a digital filter to perform the desired
signal processing, and an adaptive algorithm to adjust the coefficients (or weights) of
that filter. A general form of adaptive filter is illustrated in Figure 8.2, where d(n)isa
desired signal (or primary input signal), y(n) is the output of a digital filter driven by a
reference input signal x(n), and an error signal e(n) is the difference between d(n) and
y(n). The function of the adaptive algorithm is to adjust the digital filter coefficients to
ADAPTIVE FILTERS 359
x(n) y(n)
d(n)
e(n)
+
−
Adaptive
algorithm
Digital
filter
Figure 8.2 Block diagram of adaptive filter
y(n)
z
−1
z
−1
w
0
(n)
x(n)
x(n−1)
x(n−L+1)
w
L−1
(n)w
1
(n)
Figure 8.3 Block diagram of FIR filter for adaptive filtering
minimize the mean-square value of e(n). Therefore the filter weights are updated so that
the error is progressively minimized on a sample-by-sample basis.
In general, there are two types of digital filters that can be used for adaptive filtering:
FIR and IIR filters. The choice of an FIR or an IIR filter is determined by practical
considerations. The FIR filter is always stable and can provide a linear phase response.
On the other hand, the IIR filter involves both zeros and poles. Unless they are properly
controlled, the poles in the filter may move outside the unit circle and make the filter
unstable. Because the filter is required to be adaptive, the stability problems are much
difficult to handle. Thus the FIR adaptive filter is widely used for real-time applications.
The discussions in the following sections will be restricted to the class of adaptive FIR
filters.
The most widely used adaptive FIR filter is depicted in Figure 8.3. Given a set
of L coefficients, w
l
n, l 0, 1, , L À 1, and a data sequence, fxn xn À 1
xn À L 1g, the filter output signal is computed as
yn
LÀ1
l0
w
l
nxn À l, 8:2:1
where the filter coefficients w
l
n are time varying and updated by the adaptive algo-
rithms that will be discussed next.
We define the input vector at time n as
xnxn xn À 1 xn À L 1
T
8:2:2
360 ADAPTIVE FILTERING
[...]... primary signal This condition requires a close spacing between the primary and reference sensors Unfortunately, it is also critical to avoid the signal components from the signal source being picked up by the reference sensor This `crosstalk' effect will degrade the performance of ANC because the presence of the signal components in reference signal will cause the ANC to cancel the desired signal along... that of the unknown system When the plant is time varying, the adaptive algorithm has the task of keeping the modeling error small by continually tracking time variations of the plant dynamics 8.5.2 Adaptive Linear Prediction Linear prediction is a classic signal processing technique that provides an estimate of the value of an input process at a future time where no measured data is yet available... readjusted so that they can cancel correlated components in d(n) to minimize the error signal e(n) In this case, the output y(n) is the enhanced signal, which contains multiple sinusoidals as expressed in (8.5.5) In many digital communications and signal detection applications, the desired broadband (spread-spectrum) signal v(n) is corrupted by an additive narrowband interference s(n) From a filtering... idea is to measure the signals produced by the system and to use them to construct a model The paradigm of system identification is illustrated in Figure 8.6, where P(z) is an unknown system to be identified and W(z) is a digital filter used to model P(z) By exciting both the unknown system P(z) and the digital model W(z) with the same excitation signal x(n) and measuring the output signals y(n) and d(n),... the decision device is correct, the binary sequence can be used as the desired signal d(n) to generate the error signal for the LMS algorithm An equalizer for a one-dimensional baseband system has real input signals and filter coefficients However, for a two-dimensional quadrature amplitude modulation (QAM) system, both signals and coefficients are complex All operations must use complex arithmetic... memory transfer operations take as many machine cycles as the multiply±add, thus resulting in a dominant computational burden involved in the weight update Let Tp denote the total processingtime for each input sample Real- timeprocessing requires that Tp < T, where T is the sampling period This means that if the algorithm is too complicated, we need to reduce the complexity of computation to allow Tp... m is inversely proportional to L, a small m is used for largeorder filters 2 Since m is made inversely proportional to the input signal power, weaker signals use a larger m and stronger signals use a smaller m One useful approach is to normalize with respect to the input signal power Px The resulting algorithm is called the normalized LMS algorithm, which will be discussed in Section 8.4 8.3.2 Convergence... size m is difficult to determine Improper selection of m might make the convergence speed unnecessarily slow or introduce excess MSE If the signal is nonstationary and real- time tracking capability is crucial for a given application, then use a larger m If the signal is stationary and convergence speed is not important, use a smaller m to achieve better performance in a steady state In some practical... cancel the noise component in the primary signal picked up by the primary sensor As illustrated in Figure 8.8, the basic concept of adaptive noise cancellation is to process signals from two sensors and to reduce the level of the undesired noise with adaptive filtering techniques The primary sensor is placed close to the signal source in order to pick up the desired signal However, the primary sensor output... Primary sensor Signal source z−1 Reference sensor Noise source x(n) d(n) e(n) + − W(z) y(n) LMS Figure 8.8 Basic concept of adaptive noise canceling s(n) + + x′(n) d(n) P(z) x(n) Digital filter y(n) − + e(n) Adaptive algorithm Figure 8.9 Block diagram of adaptive noise canceler estimate of noise xH n, is then subtracted from the primary channel signal d(n), producing e(n) as the desired signal plus . processes and introduce fundamental techniques
for processing and analyzing them.
Real- Time Digital Signal Processing. Sen M Kuo, Bob H Lee
Copyright # 2001. d(n)isa
desired signal (or primary input signal) , y(n) is the output of a digital filter driven by a
reference input signal x(n), and an error signal e(n)