10 adaptive filter

Upload: nikite-keraima

Post on 04-Jun-2018

233 views

Category:

Documents


2 download

TRANSCRIPT

  • 8/13/2019 10 Adaptive Filter

    1/65

    Adaptive Filters and

    Applications

    Agfianto Eko Putra

    http://agfi.staff.ugm.ac.id

    http://agfi.staff.ugm.ac.id/http://agfi.staff.ugm.ac.id/
  • 8/13/2019 10 Adaptive Filter

    2/65

    Objectives

    Principles of...

    Adaptive filters

    Adaptive least mean square (LMS) algorithm

    Illustrates how to apply the adaptive filters tosolve realworld application problems

    Adaptive noise cancellation,

    System modeling, Adaptive line enhancement, and

    Telephone echo cancellation

    2Adaptive Filters and Applications

  • 8/13/2019 10 Adaptive Filter

    3/65

    Introduction to LMS Adaptive FIR

    Filters An adaptive filter is a digital

    filter that has self-adjustingcharacteristics: It is capable of adjusting its

    filter coefficients

    automatically to adapt theinput signal via an adaptivealgorithm.

    Adaptive filters workgenerally for Adaptation of signal-changing

    environments, Spectral overlap between

    noise and signal, andunknown, or time-varying,noise.

    Adaptive Filters and Applications 3

  • 8/13/2019 10 Adaptive Filter

    4/65

    Introduction to LMS Adaptive FIR

    Filters

    Adaptive Filters and Applications 4

    When interference noise is strong and its spectrum overlaps that of the

    desired signal, the conventional approach will fail to preserve the desired

    signal spectrum while removing the interference using a traditional filter...

  • 8/13/2019 10 Adaptive Filter

    5/65

    Introduction to LMS Adaptive FIR

    Filters

    We only discuss about... Adaptive finite impulse response (FIR) filters with a

    simple and popular least mean square (LMS)algorithm.

    Further exploration into... Adaptive infinite impulse response (IIR) filters,

    Adaptive lattice filters, their associated algorithms andapplications, and so on...

    Can be found in comprehensive texts by Haykin(1991), Stearns (2003), and Widrow and Stearns(1985).

    Adaptive Filters and Applications 5

  • 8/13/2019 10 Adaptive Filter

    6/65

    Adaptive Filters and Applications 6

    The adaptive filter contains a digital filter with adjustable coefficient(s) and the LMS

    algorithm to modify the value(s) of the coefficient(s) for filtering each sample.

    When the noise estimate y(n) equals or approximates the noise n(n) in the corrupted

    signal, that is, y(n) = n(n), the error signal e(n) = s(n) + n(n) - y(n) = s(n) willapproximate the clean speech signal s(n) the noise is canceled.

  • 8/13/2019 10 Adaptive Filter

    7/65

    In our example...

    The adaptive filter is set to be a one-tap FIR

    filter to simplify numerical algebra.

    The filter adjustable coefficient wn is adjusted

    based on the LMS algorithm.

    Adaptive Filters and Applications 7

  • 8/13/2019 10 Adaptive Filter

    8/65

    In our example...

    Adaptive Filters and Applications 8

  • 8/13/2019 10 Adaptive Filter

    9/65

    In our example...

    Adaptive Filters and Applications 9

  • 8/13/2019 10 Adaptive Filter

    10/65

    In our example...

    In general, the FIR filter with multiple-taps is

    used and has the following format:

    Adaptive Filters and Applications 10

  • 8/13/2019 10 Adaptive Filter

    11/65

    Basic Wiener Filter Theory and Least

    Mean Square Algorithm

    Adaptive Filters and Applications 11

    Many adaptive algorithms can be viewed as

    approximations of the discrete Wiener filter

    The Wiener filter adjusts its weight(s) to produce filter output y(n), which

    would be as close as the noise n(n) contained in the corrupted signal d(n).

  • 8/13/2019 10 Adaptive Filter

    12/65

    Adaptive Filters and Applications 12

  • 8/13/2019 10 Adaptive Filter

    13/65

    Adaptive Filters and Applications 13

  • 8/13/2019 10 Adaptive Filter

    14/65

    Adaptive Filters and Applications 14

  • 8/13/2019 10 Adaptive Filter

    15/65

    Example 10.1.

    Given a quadratic MSE function for the

    Wiener filter:

    Find the optimal solution for wto achieve the

    minimum MSEJmin

    and determineJmin

    .

    Adaptive Filters and Applications 15

  • 8/13/2019 10 Adaptive Filter

    16/65

    Example 10.1: Solution

    Adaptive Filters and Applications 16

  • 8/13/2019 10 Adaptive Filter

    17/65

    Notice for Equation (10.7)

    1. Optimal coefficient(s) can be different for every block ofdata, since the corrupted signal and reference signal areunknown. The autocorrelation and cross-correlation mayvary.

    2. If a larger number of coefficients (weights) are used, theinverse matrix of R-1may require a larger number ofcomputations and may come to be illconditioned. This willmake real-time implementation impossible.

    3. The optimal solution is based on the statistics, assumingthat the size of the data block, N, is sufficiently long. Thiswill cause a long processing delay that will make real-timeimplementation impossible.

    Adaptive Filters and Applications 17

  • 8/13/2019 10 Adaptive Filter

    18/65

    The steepest descent algorithm

    Solving the Wiener solution Equation (10.7) requires

    a lot of computations, including matrix inversion for

    a general multiple-taps FIR filter.

    The well-known textbook by Widrow and Stearns(1985) describes a powerful LMS algorithm by using

    the steepest descent algorithmto minimize the MSE

    sample by sample and locate the filter coefficient(s).

    Adaptive Filters and Applications 18

  • 8/13/2019 10 Adaptive Filter

    19/65

    Ilustration of the steepest descent

    algorithm

    Adaptive Filters and Applications 19

  • 8/13/2019 10 Adaptive Filter

    20/65

    Example 10.2.

    Given a quadratic MSE function for the

    Wiener filter:

    Use the steepest descent method with an

    initial guess w0= 0as and = 0.04to find the

    optimal solution for w*and determine Jminby

    iterating three times.

    Adaptive Filters and Applications 20

  • 8/13/2019 10 Adaptive Filter

    21/65

    Example 10.2: Solution

    Adaptive Filters and Applications 21

  • 8/13/2019 10 Adaptive Filter

    22/65

    Example 10.2: Solution

    Adaptive Filters and Applications 22

  • 8/13/2019 10 Adaptive Filter

    23/65

    Develop the LMS Algorithm...

    To develop the LMS algorithm in terms of

    sample-based processing...

    Adaptive Filters and Applications 23

  • 8/13/2019 10 Adaptive Filter

    24/65

    Develop the LMS Algorithm...

    Adaptive Filters and Applications 24

  • 8/13/2019 10 Adaptive Filter

    25/65

    The LMS Algorithm...

    Adaptive Filters and Applications 25

  • 8/13/2019 10 Adaptive Filter

    26/65

    Noise Cancellation

    Adaptive Filters and Applications 26

  • 8/13/2019 10 Adaptive Filter

    27/65

    Example 10.3.

    Adaptive Filters and Applications 27

  • 8/13/2019 10 Adaptive Filter

    28/65

    Example 10.3.

    Adaptive Filters and Applications 28

  • 8/13/2019 10 Adaptive Filter

    29/65

    Example 10.3: Solution

    Adaptive Filters and Applications 29

  • 8/13/2019 10 Adaptive Filter

    30/65

    Example 10.3: Solution

    Adaptive Filters and Applications 30

  • 8/13/2019 10 Adaptive Filter

    31/65

    Example 10.3: Solution

    Adaptive Filters and Applications 31

  • 8/13/2019 10 Adaptive Filter

    32/65

    Example 10.3: Solution

    Adaptive Filters and Applications 32

  • 8/13/2019 10 Adaptive Filter

    33/65

    Examine the MSE function

    Adaptive Filters and Applications 33

  • 8/13/2019 10 Adaptive Filter

    34/65

    Examine the MSE function

    Adaptive Filters and Applications 34

  • 8/13/2019 10 Adaptive Filter

    35/65

    Simulation Example

    Sample rate = 8,000 Hz

    Original speech data: wen.dat

    Speech corrupted by Gaussian noise with a power of 1delayed by 5 samples from the noise reference

    Noise reference containing Gaussian noise with apower of 1

    Adaptive FIR filter used to remove the noise

    Number of FIR filter taps = 21

    Convergence factor for the LMS algorithm chosen to be0.01 (

  • 8/13/2019 10 Adaptive Filter

    36/65

    Simulation Example

    Adaptive Filters and Applications 36

  • 8/13/2019 10 Adaptive Filter

    37/65

    Adaptive Filters and Applications 37

  • 8/13/2019 10 Adaptive Filter

    38/65

    Adaptive Filters and Applications 38

  • 8/13/2019 10 Adaptive Filter

    39/65

    Simulation Example: Result

    Adaptive Filters and Applications 39

  • 8/13/2019 10 Adaptive Filter

    40/65

    System Modeling

    The adaptive filter can keep tracking the

    behavior of an unknown system by using the

    unknown systems input and output...

    Adaptive Filters and Applications 40

  • 8/13/2019 10 Adaptive Filter

    41/65

    Example 10.4

    Adaptive Filters and Applications 41

  • 8/13/2019 10 Adaptive Filter

    42/65

    Adaptive Filters and Applications 42

  • 8/13/2019 10 Adaptive Filter

    43/65

    Contoh lain...

    Diasumsikan sebuah sistem yang tak-diketahui

    (unknown system) merupakan tapis IIR Bandpass

    orde ke-4 dengan frekuensi cutoff bawah 1400Hz

    dan atas 1600Hz bekerja pada 8kHz. Digunakan masukan nada 500, 1500 dan 2500Hz.

    Tanggap frekuensi dari sistem yang tak-diketahui

    tersebut ditunjukkan pada Gambar 10.12!

    Adaptive Filters and Applications 43

  • 8/13/2019 10 Adaptive Filter

    44/65

    Gambar 10.12

    Adaptive Filters and Applications 44

    0 500 1000 1500 2000 2500 3000 3500 4000-200

    -100

    0

    100

    200

    Frequency (Hz)

    Phase(degree

    s)

    0 500 1000 1500 2000 2500 3000 3500 4000-80

    -60

    -40

    -20

    0

    Frequency (Hz)

    Magnitude(dB)

  • 8/13/2019 10 Adaptive Filter

    45/65

    Contoh lain...

    Bentuk gelombang masukan x(n) dengan tiga nadaditunjukkan pada plot pertama di Gambar 10.13.

    Luaran dari sistem yang tak-diketahui mengandung nada1500Hz saja, dua nada lainnya ditolak oleh sistem yang tak-diketahui.

    Hasil dari tapis adaptif: Gunakan tapis FIR adaptif dengan 21 tap dan faktor

    konvergensinya 0.01;

    Pada ranah waktu, luaran gelombang dari sistem tak-diketahuid(n) dan luaran tapis adaptif y(n) hampir identik setelah cuplikan

    ke-70 saat algoritma LMS konvergen; Sinyal ralat e(n) juga diplot untuk menunjukkan bahwa tapis

    adaptif tetap melalukan penjajakan terhadap luaran sistem tak-diketahui tanpa ada perbedaan setelah 50 cuplikan pertama.

    Adaptive Filters and Applications 45

  • 8/13/2019 10 Adaptive Filter

    46/65

    Figure 10.13

    Adaptive Filters and Applications 46

    0 100 200 300 400 500 600 700 800

    -2

    0

    2

    Systemi

    nput

    0 100 200 300 400 500 600 700 800

    -1

    0

    1

    System

    output

    0 100 200 300 400 500 600 700 800

    -1

    0

    1

    ADFoutput

    0 100 200 300 400 500 600 700 800

    -1

    0

    1

    Error

    Number of samples

  • 8/13/2019 10 Adaptive Filter

    47/65

    Figure 10.13

    Adaptive Filters and Applications 47

    0 500 1000 1500 2000 2500 3000 3500 40000

    0.5

    1

    Syst.inputspect.

    0 500 1000 1500 2000 2500 3000 3500 40000

    0.5

    1

    Syst.outputspect.

    0 500 1000 1500 2000 2500 3000 3500 40000

    0.5

    1

    ADFoutputspect.

    Frequency (Hz)

  • 8/13/2019 10 Adaptive Filter

    48/65

    Adaptive Filters and Applications 48

  • 8/13/2019 10 Adaptive Filter

    49/65

    Adaptive Filters and Applications 49

    Li E h U i Li

  • 8/13/2019 10 Adaptive Filter

    50/65

    Line Enhancement Using Linear

    Prediction

    If a signal frequency content is very narrow compared with the bandwidth

    and changes with time, then the signal can efficiently be enhanced by the

    adaptive filter, which is line enhancement.

    The adaptive filter is actually a linear predictor of the desired narrow band

    signal. A two-tap adaptive FIR filter can predict one sinusoid.

    The value of is usually determined by experiments or experience in

    practice to achieve the best enhanced signal.

    Adaptive Filters and Applications 50

  • 8/13/2019 10 Adaptive Filter

    51/65

    Simulation Example

    Our simulation example has the followingspecifications:

    Sampling rate = 8,000 Hz

    Corrupted signal = 500 Hz tone with unitamplitude added with white Gaussian noise

    Adaptive filter = FIR type, 21 taps

    Convergence factor = 0.001

    Delay value = 7

    LMS algorithm applied

    Adaptive Filters and Applications 51

  • 8/13/2019 10 Adaptive Filter

    52/65

    Adaptive Filters and Applications 52

  • 8/13/2019 10 Adaptive Filter

    53/65

    Adaptive Filters and Applications 53

  • 8/13/2019 10 Adaptive Filter

    54/65

    Figure 10.16

    Adaptive Filters and Applications 54

    0 100 200 300 400 500 600 700 800

    -2

    -1

    0

    1

    2

    Noisysignal

    0 100 200 300 400 500 600 700 800

    -2

    -1

    0

    1

    2

    ADFoutput(enhancedsignal)

    Number of samples

  • 8/13/2019 10 Adaptive Filter

    55/65

    Figure 10.17

    Adaptive Filters and Applications 55

    0 500 1000 1500 2000 2500 3000 3500 40000

    0.5

    1

    1.5

    N

    oisysignalspectrum

    0 500 1000 1500 2000 2500 3000 3500 40000

    0.5

    1

    1.5

    ADFoutputspe

    ctrum

    Frequency (Hz)

    C li P i di I t f

  • 8/13/2019 10 Adaptive Filter

    56/65

    Canceling Periodic Interferences

    Using Linear Prediction

    An audio signal may be corrupted by periodic

    interference and no noise reference is

    available. Such examples include the playback

    of speech or music with the interference oftape hum, turntable rumble, or vehicle engine

    or power line interference.

    We can use the modified line enhancementstructure as shown in Figure 10.18.

    Adaptive Filters and Applications 56

  • 8/13/2019 10 Adaptive Filter

    57/65

    Figure 10.18

    Adaptive Filters and Applications 57

  • 8/13/2019 10 Adaptive Filter

    58/65

    ECG Interference Cancellation

    As we discussed in Chapters 1 and 8, inrecording of electrocardiograms, there oftenexists unwanted 60-Hz interference, along

    with its harmonics, in the recorded data. This interference comes from the power line,

    including effects from magnetic induction,displacement currents in leads or in the body

    of the patient, and equipmentinterconnections and imperfections.

    Adaptive Filters and Applications 58

  • 8/13/2019 10 Adaptive Filter

    59/65

    Figure 10.19

    Adaptive Filters and Applications 59

    Echo Cancellat ion in Long Distance

  • 8/13/2019 10 Adaptive Filter

    60/65

    Echo Cancellat ion in Long-Distance

    Telephone Circuits

    Long-distance telephone transmission oftensuffers from impedance mismatches.

    This occurs primarily at the hybrid circuit

    interface. Balancing electric networks within the hybrid can

    never perfectly match the hybrid to thesubscriber loop due to temperature variations,

    degradation of the transmission line, and so on. As a result, a small portion of the received signal

    is leaked for transmission.

    Adaptive Filters and Applications 60

  • 8/13/2019 10 Adaptive Filter

    61/65

    Figure 10.20a

    Adaptive Filters and Applications 61

  • 8/13/2019 10 Adaptive Filter

    62/65

    Figure 10.20b

    Adaptive Filters and Applications 62

  • 8/13/2019 10 Adaptive Filter

    63/65

    Summary

    1. Adaptive filters can be applied to signal-changingenvironments, spectral overlap between noise and signal,and unknown, or time-varying, noises.

    2. Wiener filter theory provides optimal weight solutionsbased on statistics. It involves collection of a large block of

    data, calculation of an autocorrelation matrix and a cross-correlation matrix, and inversion of a large size of theautocorrelation matrix.

    3. The steepest descent algorithm can find the optimalweight solution using an iterative method, so a large

    matrix inversion is not needed. But it still requirescalculating an autocorrelation and cross-correlationmatrix.

    Adaptive Filters and Applications 63

  • 8/13/2019 10 Adaptive Filter

    64/65

    Summary

    4. The LMS is a sample-based algorithm, which does notneed collection of data or computation of statistics anddoes not involve matrix inversion.

    5. The convergence factor for the LMS algorithm is boundedby the reciprocal of the product of the number of filter

    coefficients and input signal power.6. The LMS adaptive FIR filter can be effectively applied for

    noise cancellation, system modeling, and lineenhancement.

    7. Further exploration includes other applications such ascancellation of periodic interference, biomedical ECGsignal enhancement, and adaptive telephone echocancellation.

    Adaptive Filters and Applications 64

  • 8/13/2019 10 Adaptive Filter

    65/65

    References...

    Haykin, S. (1991).Adaptive Filter Theory, 2nd ed.Englewood Cliffs, NJ: Prentice Hall.

    Ifeachor, E. C., and Jervis, B. W. (2002). DigitalSignal Processing: A Practical Approach, 2nd ed.

    Upper Saddle River, NJ: Prentice Hall. Stearns, S. D. (2003). Digital Signal Processing

    with Examples in MATLAB.Boca Raton, FL: CRCPress LLC.

    Widrow, B., and Stearns, S. (1985).AdaptiveSignal Processing.Upper Saddle River, NJ:Prentice Hall.