You are on page 1of 3

EX NO: Date:

DESIGN OF ADAPTIVE FILTER FOR ADAPTIVE WHITE NOISE REMOVAL

AIM: To design and simulate adaptive filter for white noise cancellation using Newtons Steepest Descent algorithm in MATLAB SOFTWARE REQUIRED: MATLAB THEORY: An adaptive system is that designed primarily for the purpose of adaptive control and adaptive signal processing. Such a system has the following characteristics. They can automatically adapt in the face of changing environments and changing system requirements. They can be trained to perform specific filtering and decision making tasks. To a limited extend they can adapt around certain kinds of interval defects. An adaptive filter is a filter that self-adjusts its transfer function according to an optimization algorithm driven by an error signal. Because of the complexity of the optimization algorithms, most adaptive filters are digital filters. Adaptive filters are required for some applications because some parameters of the desired processing operation (for instance, the locations of reflective surfaces in a reverberant space) are not known in advance. The adaptive filter uses feedback in the form of an error signal to refine its transfer function to match the changing parameters. ALGORITHM: 1. Generate the sine wave and noise signal. 2. Add the input signal with the noise signal. 3. Initial filter co efficient is computed for various inputs. 4. Calculate the error and absolute error. 5. If error is greater than a pre-defined value repeat the filtering process by using the Steepest Descent Algorithm. 6. Multiply filter co-efficient with new noise signal. 7. Find the error form noise signal and remove it. 8. Repeat the procedure till the error becomes tolerable. 9. Plot the waveform.

PROGRAM: clc;clear all; close all;clf; f=input('Enter the frequency of the signal,f='); fs=input('Enter the sampling frequency (>=2f),fs='); %Generation of input signal x=sin(2*3.14*(f/fs)*(0:99)); %Generation of noise n=randn(1,100); nn=max(abs(n)); n=n/nn; %output signal y=x+n; %Filter h=fir1(99,.025); xs=y.*h; e=x-xs; pp=1; ee=(abs(e)); while(ee>0.1) for i=1:100; hp(i)=h(i)+2*00.025*y(i).*e(i); h(i)=hp(i); xs(i)=y(i).*h(i); e(i)=x(i)-xs(i); end pp=pp+1; ee=abs(e); ee=max(ee); end; pp; figure; subplot(2,2,1); plot(x); title('input signal'); xlabel('--->time(sec)'); ylabel('--->amp'); subplot(2,2,2); plot(n); title('Noise signal'); xlabel('--->time(sec)'); ylabel('--->amp'); subplot(2,2,3);

plot(y); title('Noise added signal'); xlabel('--->time(sec)'); ylabel('--->amp'); subplot(2,2,4); plot(xs); title('Enhanced signal'); xlabel('--->time(sec)'); ylabel('--->amp'); WAVEFORM

RESULT Thus the adaptive filter for white noise cancellation using Steepest Descent algorithm was simulated using MATLAB.

You might also like