I have a bit of project that I'm doing for SIN interference removal. Just not sure Am I doing everything correct: enter image description here

Fs = 1000;

Ts = 1/Fs;

order = 12;

t = 0:Ts:1-Ts;

x = sin(2*pi*4*t);

noise = rand(size(x),1);

x = x + noise; % Generating signal plus noise

x = x/max(x); %Normalization

x = x';

x1= delayseq(x,15) %Delay

b = fir1(order, 0.3, 'low'); %Filter

d = filter(b, 1, x1); %Filter

mu = 0.8;

lms = dsp.LMSFilter(order+1, 'StepSize', mu, 'WeightsOutputPort', true);

[y, e, w]= step(lms, x, d);

figure(2); plot(t,x,t,y,t,d) legend('Signal and noise','filtered','before lms')


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.