Presentation is loading. Please wait.

Presentation is loading. Please wait.

Adaptive Filters Common filter design methods assume that the characteristics of the signal remain constant in time. However, when the signal characteristics.

Similar presentations


Presentation on theme: "Adaptive Filters Common filter design methods assume that the characteristics of the signal remain constant in time. However, when the signal characteristics."— Presentation transcript:

1 Adaptive Filters Common filter design methods assume that the characteristics of the signal remain constant in time. However, when the signal characteristics vary with time, a time-varying filter is required. One such filter is the adaptive filter. The adaptive filter, as its name suggests, adapts itself to the varying input signal. The adaptive filter is useful when the signal is accompanied by a varying sinusoidal disturbance, when the disturbance is random, or when the disturbance is another signal which is of no interest to the user.

2 Adaptive Filters The following is a block diagram of the adaptive filter: The adaptive filter has two input signals: the desired signal, s(n), which is accompanied by a disturbance, w(n), and a reference signal, r(n), similar in characteristics to the disturbance. The FIR filter operates on the reference signal, and it adapts its impulse response such that its output resembles the disturbance accompanying the desired signal. Then, by subtracting the output of the filter from the desired signal plus disturbance, a good estimation of the desired signal is obtained + - Adaptive FIR Filter signal + disturbance a reference to the disturbance

3 Adaptive Filters The most important aspect of the adaptive filter is that it removes the disturbance from the desired signal without affecting the desired signal itself. This is because the FIR filter of the adaptive filter operates on the reference signal only When a desired signal is accompanied by a sinusoidal disturbance, the disturbance can be removed by a simple band-stop filter. However, the filter removes the stop band frequencies from the desired signal as well. With adaptive filter, the sinusoidal disturbance is removed with no effect on the desired signal

4 Adaptive Filters Similarly, when a desired signal is accompanied by a background random noise disturbance, and the disturbance is mostly of high frequencies, it can be partially removed by a simple low-pass filter. However, the filter removes the high frequencies from the desired signal as well. With adaptive filter, the background random noise disturbance is removed with no effect on the desired signal

5 Adaptive Filters As noted, the second input to the filter is the reference signal. This signal is with the same statistical characteristics as the disturbance added to the desired signal. When the disturbance is sinusoidal, the reference signal should be of the same frequency, though it can have any amplitude or phase (an LTI system cannot change its input frequency) The frequency of the disturbance may change (as in power lines), and if the frequency of the reference signal varies in a similar way, the disturbance will be removed

6 Adaptive Filters When the disturbance is a background random noise, the reference signal should be a similar noise. For example, if a person is talking in an engine room, or a pilot is talking while the airplane engines are in action, the audio signal is hardly intelligible because of the disturbance. The reference signal should in this case be the background noise alone, taken from another microphone located somewhere else

7 Adaptive Filters As noted, the FIR filter operates on the reference signal. Its output is derived from convolution between the reference signal and the impulse response of the filter. This output is subtracted from the signal + disturbance input, and the difference has two functions: In the stable state, it is the estimation of the desired signal It serves as a feedback to correct the FIR filter coefficients

8 Adaptive Filters The FIR filter coefficients vary in such a way that the filter output is as close as possible to the disturbance accompanying the signal. Then, subtracting the filter output from the desired signal + disturbance, generates a good estimate of the desired signal In other words, it may be said that the filter coefficients are modified such that the adaptive filter output, e(n), is minimized

9 Filter Coefficients Update
The expression for e2(n) at the filter output, which is also the square error at the output, is: Then, the mean square error is:

10 Filter Coefficients Update
To minimize the mean square error, the filter coefficients, h(n), should be calculated from: Following the expression for the mean square error presented before, the above N derivatives lead to the following set of equations: or in matrix form

11 Filter Coefficients Update
The solution above requires the inversion of the correlation matrix Rr on every input sample The LMS (Least Mean Squares) algorithm provides a different way to calculate the filter coefficients h(n) that contribute to a minimum mean square error at the filter output. The algorithm calculates the optimal filter coefficients iteratively, when the update of the coefficient is in the gradient direction, the direction of maximal change. This algorithm is thus named gradient descent.

12 Filter Coefficients Update
The iterative equation for the filter coefficients is then: where is the n-th iteration of the filter coefficients is the gradient vector is a constant dictating the rate of the algorithm convergence

13 Filter Coefficients Update
Practically, an approximation to the gradient is used in the iterative equation for the update of the filter coefficients. The simplified LMS algorithm updates the filter coefficients iteratively according to is the n-th iteration of the k-th filter coefficient b is a constant fixing the rate of adaptation (learning) N is the length of the FIR filter All N filter coefficients are updated with every input sample

14 The LMS Algorithm The algorithm progresses as follows:
(1) initial values to the filter coefficients are set, commonly, zero. (2) an input sample is read from the two inputs x(n) and r(n) (3) an output sample of the FIR filter y(n) is calculated (by convolution) (4) a sample of the overall output, e(n)=x(n)-y(n), is calculated (5) the filter coefficients are updated iteratively according to (the coefficients are updated with every input sample) (6) go back to (2)

15 Adaptive Filters - Example
The following figure shows the operation of the adaptive filter on an ECG signal accompanied by a sinusoidal disturbance (top). The second signal is the reference signal, and the third is the output from the FIR filter. The bottom figure is the estimation of the desired signal (at the output of the adaptive filter). It can be seen that initially, the disturbance is present at the output, and as the filter coefficients adapt, the disturbance is eliminated.

16 Adaptive Filters - Example
The following figure shows the operation of the adaptive filter on a speech signal accompanied by a varying frequency sinusoidal disturbance (top). The second signal is the varying sinusoidal reference signal, and the third is the output from the FIR filter. The bottom figure is the estimation of the desired speech signal (at the output of the adaptive filter). It can be seen that the filter adapts to the varying sinusoidal disturbance and eliminates it to restore the desired speech.

17 Adaptive Filters - Example
The following figure shows the operation of the adaptive filter on a speech signal accompanied by a random noise disturbance (top). The second signal is the random noise reference signal taken at a different location, and the third is the output from the FIR filter. The bottom figure is the estimation of the desired speech signal (at the output of the adaptive filter). It can be seen that the filter gradually adapts to the noise, and eliminates it to restore the desired speech.

18 Adaptive Filters - Example
The following figure shows the operation of the adaptive filter on a speech signal accompanied by a background music as a disturbance (top). The second signal is the background noise reference signal taken at a different location, and the third is the output from the FIR filter. The bottom figure is the estimation of the desired speech signal (at the output of the adaptive filter). It can be seen that the filter gradually adapts to the noise, and eliminates it to restore the desired speech.

19 Adaptive Filters - Example
The following figure shows the operation of the adaptive filter on a mother + fetus ECG signal to isolate the fetus ECG signal. The mother’s pulse is different from the fetus pulse and is not synchronized with it. It is also higher in amplitude. The reference signal in this case is the mother’s ECG, measured away from the womb (top). The signal plus disturbance is the combined signal measured near the womb (middle figure). The bottom figure is the estimation of the desired fetus ECG signal, where the mother’s ECG is largely eliminated.

20 Adaptive Filters Adaptive filters cannot remove a sinusoidal disturbance, if the reference signal has a different frequency from the disturbance – an LTI system cannot alter the frequency of its input Adaptive filters cannot remove a random disturbance, if the reference signal has no correlation with the disturbance – an LTI system cannot generate correlation between signals which are initially uncorrelated

21 Adaptive Filters on the DSK
The adaptive filter requires two input signals To allow the DSK meet this requirement, the two channels of its codec are used for the two input signals The codec is a stereo codec, designed to input and output the two channels of a stereo audio signal – the left and right channels. For the adaptive filter, the stereo codec is used in a slightly different way: on one of its input channels the main input to the adaptive signal is entered – that of the signal + disturbance

22 Adaptive Filters on the DSK
The second codec channel is used to enter the reference signal, correlated to the disturbance added to the desired signal. The two signals are sampled by the dual ADC available on the codec, operating with the same sampling rate. Of the two DAC’s on the codec, only one is used to output the adaptive filter output signal, after the removal of the disturbance.

23 Adaptive Filters on the DSK
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate #include "dsk6713_aic23.h" //codec-DSK support file #define LEFT 0 #define RIGHT 1 #define M 512 union {Uint32 combo; short channel[2];} AIC23_data; short sample_in_r[M], sample_in_l[M] ; short val= 0 ; short j ; void main() //main function { j = 0 ; comm_intr(); //init DSK, codec, McBSP while(1); //infinite loop }

24 Adaptive Filters on the DSK
interrupt void c_int11() //interrupt service routine { AIC23_data.combo = input_sample(); //input 32-bit sample from both channels if (val==0) output_sample(AIC23_data.combo) ; else if (val==1) output_left_sample(AIC23_data.channel[LEFT]); //output to to left channel else output_right_sample(AIC23_data.channel[RIGHT]); sample_in_r[j]=AIC23_data.channel[RIGHT] ; sample_in_l[j]=AIC23_data.channel[LEFT] ; j++ ; if (j>=M) j=0 ; return; }

25 Adaptive Filters on the DSK
The two operations performed by the adaptive filter: Applying an FIR filter to the reference signal Modifying the FIR filter coefficients after each sample are performed by the interrupt routine invoked by the sampling clock At each sampling clock a new sample is calculated at the FIR filter operating on the reference signal. The filter used, is the one whose coefficients (samples) have been updated in the previous sample.

26 Adaptive Filters on the DSK
The FIR filter operates in the same way as a common FIR filter, except that its coefficients vary on each sample The output sample from the FIR filter is subtracted from the input sample to form the current output sample of the adaptive filter. This same sample is used in the calculations to form the new iteration of the FIR filter coefficients, to be used in the next sample No calculations are done by the main program

27 Adaptive Filters with No Reference signal
Under certain conditions, adaptive filtering is possible even when no reference signal to the added noise is given Such is the case when the desired signal is a narrowband signal and the added noise is a wideband signal (or the reverse) Then, the structure of the filter is: + - Adaptive FIR Filter signal + disturbance De-correlation Delay

28 Adaptive Filters with No Reference signal
If the noise is a wideband signal, its autocorrelation function is narrow, implying no correlation between its samples, even close ones. Similarly, if the signal is a narrowband signal, its autocorrelation is wide, implying correlation between its adjacent samples. After the de-correlation delay, noise samples are not correlated with the original noise samples, while the signal samples are (correlated) Subtracting the signal after the delay from the original signal, will leave only the noise samples (the desired signal is canceled) Then, if at the global output, only the noise resides, the desired signal must be isolated at the output from the FIR filter. Hence, signal separation is accomplished.


Download ppt "Adaptive Filters Common filter design methods assume that the characteristics of the signal remain constant in time. However, when the signal characteristics."

Similar presentations


Ads by Google