Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Discussion Groups | Matlab DSP | lms adaptive notch filter(urgent!)

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

lms adaptive notch filter(urgent!) - ashwiny - Feb 27 10:53:56 2008



Hi everyone,im doing a project regarding development of an adaptive 
notch filter to eliminate 50Hz noise from the biomedical signal.im a 
newbie to matlab so im sorry if there is any term that I 
misunderstood..correct me please..here i found one `lms adaptive 
notch filter' code from the post.i tried to run it..i felt like there 
is something wrong with the spectrum of initial signal(output).i can 
see there are few sharp(spikes).i don't really know how to say 
it..why it is like that?then i've tried with giving an ecg signal 
with 50hz noise and im getting an unexpected result like the filtered 
signal is worse than the initial signal..can anybody guide me 
please..awaiting for your reply..

This is the code from the post:
(one component at 200Hz, one at 280Hz, one at 60Hz plus white noise. 
In the sequel i design an lms adaptive filter which removes the 60Hz 
component from the initial signal.`from the author')

clear all

Fs = 1000;
N = 1000;
i = [0 : N-1]';

%create the initial signal
x = sin(2*pi*200* i/Fs) + 0.66*sin(2*pi* 280*i/Fs) + 0.59*sin(2*pi* 
60*i/Fs) + 0.5^0.5*randn( N,1);

%create the reference signal of the adaptive filter
u = sin(2*pi*60* i/Fs);

%adaptive filter architecture
L = 20;
step_size = 0.005;
w = zeros(1,L);

%run the adaptive filter
e(L) = x(L);
for k = L : N
regressor = flipud(u(k-L+ 1:k)); 
w = w + step_size * regressor' * e(k);
e(k+1) = x(k) - w * regressor;
end

%compute the spectrum of the initial signal and the filtered signal
f = [0 : Fs/N : Fs - Fs/N]';
F = abs(fft(x));
E = abs(fft(e));

%plot
figure;
subplot(411) ;plot(x); title('initial signal');
subplot(412) ;plot(e); title('initial signal after filtering');
subplot(413) ;plot(f,F( 1:length( f)));title( 'spectrum of initial 
signal');
subplot(414) ;plot(f,E( 1:length( f)));title( 'spectrum of initial 
signal after filtering');



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: lms adaptive notch filter(urgent!) - el01...@mail.ntua.gr - Feb 27 13:03:43 2008


Hi everyone,im doing a project regarding development of an adaptive 
>notch filter to eliminate 50Hz noise from the biomedical signal.im a 
>newbie to matlab so im sorry if there is any term that I 
>misunderstood..correct me please..here i found one `lms adaptive 
>notch filter' code from the post.i tried to run it..i felt like there 
>is something wrong with the spectrum of initial signal(output).i can 
>see there are few sharp(spikes).i don't really know how to say 
>it..why it is like that?then i've tried with giving an ecg signal 
>with 50hz noise and im getting an unexpected result like the filtered 
>signal is worse than the initial signal..can anybody guide me 
>please..awaiting for your reply..
>
>This is the code from the post:
>(one component at 200Hz, one at 280Hz, one at 60Hz plus white noise. 
>In the sequel i design an lms adaptive filter which removes the 60Hz 
>component from the initial signal.`from the author')
>
>clear all
>
>Fs = 1000;
>N = 1000;
>i = [0 : N-1]';
>
>%create the initial signal
>x = sin(2*pi*200* i/Fs) + 0.66*sin(2*pi* 280*i/Fs) + 0.59*sin(2*pi* 
>60*i/Fs) + 0.5^0.5*randn( N,1);
>
>%create the reference signal of the adaptive filter
>u = sin(2*pi*60* i/Fs);
>
>%adaptive filter architecture
>L = 20;
>step_size = 0.005;
>w = zeros(1,L);
>
>%run the adaptive filter
>e(L) = x(L);
>for k = L : N
>regressor = flipud(u(k-L+ 1:k)); 
>w = w + step_size * regressor' * e(k);
>e(k+1) = x(k) - w * regressor;
>end
>
>%compute the spectrum of the initial signal and the filtered signal
>f = [0 : Fs/N : Fs - Fs/N]';
>F = abs(fft(x));
>E = abs(fft(e));
>
>%plot
>figure;
>subplot(411) ;plot(x); title('initial signal');
>subplot(412) ;plot(e); title('initial signal after filtering');
>subplot(413) ;plot(f,F( 1:length( f)));title( 'spectrum of initial 
>signal');
>subplot(414) ;plot(f,E( 1:length( f)));title( 'spectrum of initial 
>signal after filtering');
>
*************************************************************
hello,

i wrote this code.
if you want send to my mail your ECG signal and i will test it.

Manolis C. Tsakiris
>



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )