0% found this document useful (0 votes)
36 views

Chapter 6 Slides

Uploaded by

Afwan Ariffin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Chapter 6 Slides

Uploaded by

Afwan Ariffin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Chapter 6: Adaptive Digital

Filters

• Introduction to Adaptive Filtering


• Wiener Filter Theory
• Least Mean Square Algorithm
• Application Examples

1
Conventional Filter

• A conventional digital filter performs weighted


averaging of the input signal
• Consider an FIR filter
• y[n] = w0x[n] + w1x[n-1] (a 2-tap FIR filter)
• The filter coefficients w0 and w1 are fixed when
deployed
• Frequency response is fixed
• Unable to perform well in the presence of
changing signal and noise
2
Adaptive Filter
• An adaptive digital filter automatically adjusts
its coefficients to adapt to input signal via an
adaptive algorithm
• The filter coefficients are not fixed
• The filter coefficients are adapted to meet the filter
requirement and to accommodate the changing
input signal (i.e. iteratively found by using an
optimization algorithm to adapt to changing signal
characteristics)

3
Adaptive Filter
• Adaptive filters are used for
• adaptation of signal-changing environments
• unknown or time-varying noise
• spectral overlap between noise and signal
• Applications:
• Signal enhancement
• Active noise control
• Noise cancellation
• Telephone echo cancellation
4
Adaptive Filter
• Adaptive filters used for
– Spectral overlap between noise and signal

Interference noise is strong


=> its spectrum overlaps
that of the desired signal

Removing the interference


using conventional filter
(fixed coefficients) will fail
to preserve the desired
signal spectrum

5
Adaptive Filter
• Advantages
• Able to operate satisfactorily in unknown and
possibly time-varying environments without user
intervention.
• Able to improve the performance during
operation by learning statistical characteristics
from current signal observations.
• Able to track variations in the signal operating
environment.
• Able to handle spectral overlap between noise
and useful signal.
6
Noise Canceller

• Use 2 microphones
• Microphone 1 detects useful signal and noise
• Microphone 2 detects pure noise from a
different source
• Adaptive filter predicts the noise
detected in microphone 1 based on
measured noise in microphone 2

7
Noise Canceller
Microphone with ADC Noise is cancelled;
used to capture The signal is contaminated; error signal e(n) approximates s(n)
the desired speech s(n) channel produces d(n) when noise estimate y(n)≈≈n(n)
(signal with the noise)

Channel captured
noise x(n)
Adaptive filter
y(n) is the estimate of n(n)
wn: adjustable coefficient

Microphone with ADC


used to capture noise LMS algorithm
Modify the coefficient value
for next sample

Coming from the same noise source, x(n) is correlated with n(n)
Both n(n) and x(n) are not correlated to desired signal s(n) 8
Adaptive FIR filter with a simple and popular least mean square (LMS) algorithm
Filtering Operation
y(n): noise estimate
wn: coefficient used for the current sample
wn+1: coefficient obtained from LMS algorithm, to be used for the next coming input sample

9
Filtering Operation
The first 16 processed values for corrupted signal, reference noise, clean signal,
original signal and adaptive filter coefficients

wn

10
The processed output is close to the original signal.
Filtering Operation

The processed
output e(n) is close
to the original
signal s(n).

The adaptative
coeff. converges
close to the optimal
value of 0.5.
After 7 adaptations, the adaptive filter learns noise characteristics
11
and cancels the noise in the corrupted signal.
Filtering Operation
• The simple noise canceller shown used a simple one-
tap adaptive filter.
• In general, an FIR filter with N multiple taps is used.

= −

= + −1 +…+ − +1

where wi , 0 ≤ i ≤ N -1, represents the FIR filter coefficients and


N denotes the FIR filter length.
12
Wiener Filter
• Many adaptive algorithms can be viewed as approximation of the discrete
Wiener filter.
• The Wiener filter adjusts its weight(s) to produce a desired filter output y(n),
close to the noise n(n) contained in the corrupted signal d(n).
• At the subtracted output, the noise is cancelled or attenuated, and the output
e(n) contains a clean signal.

• C

• N

13
Wiener Filter
• Taking the statistical expectation of squared error signal

• Using notations

• Statistical expectation => an average of the N signal terms, each being a


product of two individual samples

14
Wiener Filter
Example 1:

15
Wiener Filter
• The optimal solution (Wiener solution) is w * = R -1P
• Note that:
– Optimal coefficient(s) can be different for every block of data.
The autocorrelation and cross-correlation may vary.
– If a larger number of coefficients (weights) are used, the inverse
matrix R -1 may require a larger number of computations.
– The optimal solution is based on statistics; this assumes that the
size of data block is sufficiently long => long processing delay.
• Solving the Wiener solution w * = R -1P requires many
computations, including matrix inversion for a general
multiple-tap FIR filter.
• Steepest descent method: minimize the MSE sample by
sample to locate the filter coefficient(s), without matrix
inversion.
16
Steepest Descent Method
• Update w step by step to incrementally reduce J

also referred to as the step-size

The new coefficient wn+1 will The new coefficient wn+1 will
be increased to approach be decreased to approach
the optimal value w*. the optimal value w*.

• When =0, the best coefficient wn+1 is reached. 17


Steepest Descent Method
Example 2:

• Iteration 1 (n=0)

• Iteration 2 (n=1)

18
Steepest Descent Method
• Iteration 3 (n=2)

• Substituting

• As we can see, after three iterations, the filter coefficient and minimum MSE
values are very close to the theoretical values obtained in Example 1.

19
Least Mean Square (LMS) Algorithm
• Application of steepest-descent method ( = − ) still needs
an estimation of the derivative of the MSE function that could include
statistical calculation of a block data.
• To change the algorithm to do sample-based processing, LMS algorithm
is used.
• For sample-based processing, take the statistical expectation out of J
and then take the derivative to obtain an approximation of ;

• Substituting into steepest descent method, we achieve the LMS algorithm for
updating a single-weight case:
= +2 ( )
20
Least Mean Square (LMS) Algorithm
• Input: Input signal corrupted by noise d(n) and noise signal
x(n), initial weight 0( = 0), step-size µ
• Repeat
• Compute output of adaptive filter
= 0( ) ( )
Note: 1-tap => N=1
• Compute error or filtered signal
= −
• Update the filter weight for next iteration
0( + 1) = 0( ) + 2
Note: The step size µ
- If too large, the weights may change by a large value so that gradient which
was negative at the first instant may now become positive. And at the second
instant, the weight may change in the opposite direction by a large amount
because of the negative gradient and would thus keep oscillating with a large
variance about the optimal weights.
- If too small, time to converge to the optimal weights will be too large. 21
Application 1: Noise Canceller
Microphone with ADC Noise is cancelled;
used to capture The signal is contaminated; error signal e(n) approximates s(n)
the desired speech s(n) channel produces d(n) when noise estimate y(n)≈≈n(n)
(signal with the noise)

Channel captured
noise x(n)
Adaptive filter
y(n) is the estimate of n(n)
wn: adjustable coefficient

Microphone with ADC


used to capture noise LMS algorithm
Modify the coefficient value
for next sample

Coming from the same noise source, x(n) is correlated to n(n) The step-size is 0.005
Both n(n) and x(n) are not correlated to desired signal s(n)
22
Application 1: Noise Canceller
• Adaptive FIR filter used to remove the noise
• Specifications:
• Sample rate: 8 kHz
• Noise reference:
Gaussian noise with a
power of 1
• Original speech
corrupted by the noise
reference delayed by 5
samples
• Adaptive FIR filter used
to remove the noise
• No. filter taps: 21
• Convergence factor
(LMS algo.): 0.01

The LMS algorithm


converges after
approx. 400
iterations.
23
Application 1: Noise Canceller

The clean speech


spectrum is very
close to the
original one.

24
Application 2: System Modelling
• The adaptive filter can keep tracking the behaviour of an unknown system
by using the unknown system input and output.

After the adaptive filter converges, the


output of the adaptive filter output y(n)
will approach the output of the unknown
system

• Both the unknown system and the adaptive filter respond to the same
input.
• The transfer function of the adaptive filter approximates the transfer
function of the unknown system.
25
Application 2: System Modelling
• Single tap (w0) adaptive filter, with initial weight w0(0) = 0
• LMS step-size µ = 0.5
• Given: input signal x(n), and signal d(n) of an unknown system
n 0 1 2 3 A digital amplifier
d(n) 1 2 -2 2 with a gain of 2
x(n) 0.5 1 -1 1

• Adaptive filtering results:


n 0 1 2 3
y(n) = w0(n)x(n) 0 0.5 -2 2
e(n) = d(n) – y(n) 1 1.5 0 0
w0(n + 1) = w0(n) + 2µe(n)x(n) 0.5 2 2 2

26
Application 3: ECG
Electrocardiography (ECG) Interference Cancellation
– There often exists unwanted 60-Hz interference, along with its
harmonics, in the recorded data.
Digital interference x(n) Adaptive filter uses x(n) to produce an estimate,
is acquired by the which approximates the 60-Hz interference n(n)
digital signal processor sensed from the ECG amplifier => y(n)≈ n(n)

After convergence
of the adaptive
filter, the
estimated
interference is
60-Hz reference input substracted from
from a wall outlet the primary signal
of the ECG
preamplifier to
produce e(n), in
which the 60-Hz
Primary input from interference is
the ECG preamplifier cancelled

27
Application 4: Fetal Monitoring
ECG acquired from the mother’s abdomen is contaminated by noise from
muscle activity, fetal motion, mother’s own ECG.
Output will be
the fetal ECG
with the reduced
mother’s ECG
Chest leads: acquire => signal (d)
the reference inputs xk(n)
(assume to contain only
the mother’s ECG)
=> signal (b)

Abdominal lead:
capture the fetal info. Adaptive filter
d(n), which may be predicts the
corrupted by the mother’s ECG,
mother’s ECG which will be
=> signal (c) substracted from
the corrupted fetal
signal d(n)

28

You might also like