Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

single or multitone cancellor

Status
Not open for further replies.

ayina

Newbie level 6
Joined
Oct 19, 2013
Messages
14
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
pakistan
Activity points
124
i am doing work on a project in which undesired frequencies are added as noise in base band communication signal. now i want to cancel that frequency effect by estimating its amplitude ,phase and frequency. there are two approaches in my mind
1) notch filter (but it is not so reasonable atleast for my work)
2)estimating its amplitude ,phase and frequency. i want to adapt that.
kindly give me suggestion and code to implement that in matlab
 

i wrote the code for this but it is for known frequency interference cancellation.

%% step 1 proj adsp
clear;
clc
close all;
N=2000;
Fs=1000;
Length=Fs*10;
f_signal=20/Fs;
x=sin(2*pi*20/Fs*(1:N));
%plot (x)
f1=50;%freq of noise signal in Hz
i=1:length(x);
Noise_signal = sin(2*pi*f1*i/Fs); % Power Line Interference
n=Noise_signal;
% Range of the Noise Signal embedded in the signal x
Mixed = x+ Noise_signal; % received Signal with periodic Noise
%%%%%%%%%%%%%%%% POWER LINE INTERFERENCE %%%%%%%%%%%%%%%

%% LMS algo for adaptive filtering
m=Mixed;
d=x+n+m;
n1=rand()*Noise_signal;% harmonic noise with some unknown amplitude
FilterTap=16;
w=ones(FilterTap,1);% no of taps of estiamted filter
mu=0.05; % Lest Mean Square (LMS) step size.

for i=1:length(x)

if i<FilterTap
u=[n1(i:-1:1) ,zeros(1,FilterTap-i)]';
else
u=[n1(i:-1:i-(FilterTap-1))]';

end

y(i)=w'*u;
e(i)=d(i)-y(i);
w=w+mu*u*e(i);
if (sum(w)<=10^-9)
break
end
end
d_ref=conv(w,x);
plot(e)
figure(2)
plot(x)
figure(3)
plot(m)
Output_without_Noise_signal=e;
M=100;
fc=0.25;
for i=1:M
h(i)=sin(2*pi*fc*(i-M/2))*(0.42- 0.5*cos(2*pi*i/M) + 0.08*cos(4*pi/M) )/(i-M/2);
end
h(ceil(M/2))=2*pi*fc;
h=h/sum(h);
Final_filter_Output=filter(h,1,Output_without_Noise_signal);
figure(4),plot(Final_filter_Output)
plot(abs(fft (Final_filter_Output)))
figure(5)
plot(abs(fft(m)))
chech this all of you. here final_filter_output has just changed amplitude. mean amplitude detection is somewhat false. all idea are welcomed.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top