0% found this document useful (0 votes)
13 views2 pages

All All Short 'Enter The Symbol Interval T' 'Enter The Bit Rate Value BR' 'Enter The Roll Off Factor RF'

This document contains MATLAB code to simulate an echo cancellation system. It takes in parameters for the transmission system, generates an echo signal by convolving the near end signal with the room impulse response, and adds echo to the desired signal. It then uses an LMS adaptive filter to estimate and cancel the echo from the received signal to recover the desired signal. The key steps are: 1) Generate near end signal, room impulse response, desired signal. 2) Create echo signal by convolving near end signal with room response. 3) Add echo to desired signal. 4) Use LMS adaptive filter to estimate echo and subtract estimate from received signal.

Uploaded by

Mage Natarajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

All All Short 'Enter The Symbol Interval T' 'Enter The Bit Rate Value BR' 'Enter The Roll Off Factor RF'

This document contains MATLAB code to simulate an echo cancellation system. It takes in parameters for the transmission system, generates an echo signal by convolving the near end signal with the room impulse response, and adds echo to the desired signal. It then uses an LMS adaptive filter to estimate and cancel the echo from the received signal to recover the desired signal. The key steps are: 1) Generate near end signal, room impulse response, desired signal. 2) Create echo signal by convolving near end signal with room response. 3) Add echo to desired signal. 4) Use LMS adaptive filter to estimate echo and subtract estimate from received signal.

Uploaded by

Mage Natarajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

clc; clear all;close all;

format short
T = input('enter the symbol interval T');
br= input('enter the bit rate value br');
rf= input('enter the roll off factor rf');
n = [-10 10];
y = 5000*rcosfir(rf,n,br,T);
ds = [5 2 5 2 5 2 5 2 5 5 5 5 2 2 2 5 5 5 5];
m = length(ds);
n1 = length(y);
i = 1;
z = conv(ds(i),y);
while(i)
z = conv(ds(i+1),y);
z1 = [z,zeros(1,1.75*br)];
z2= [zeros(1,1*1.7*br),z];
z = z1 + z2;
i = i+1;
end
%plot(z);
h =randn(l,length(ds));
rs1 = filer(h,1,z);
for i = 1;
length(ds);
rs(i) = rs1(i)/15;
end
for i = 1:round(x3/3),
rs(i) = randn(1);
end
fs = [5 5 2 2 2 2 2 5 2 2 2 5 5 5 2 5 2 5 2];
m = length(ds);
n1 = length(y);
i = 1;
z = conv(fs(i),y);
while(i)
z = conv(fs(i+1),y);
z1 = [z, zeros(1,1.75*br)];
z2 = [zeros(1,i*1.75*br),z];
z = z1 + z2;
i = i+1;
end
fs1 = rs+fs;
ar = xcorr(ds,ds);
crd = xcorr(rs,ds);
l1 = length(ar);
j = 1;
for i = round(l1/2):l1,
ar1(j)=ar(i);
j = j+1;
end
r = toeplitz(ar1);
l2 = length(crd);
j = 1;
for i = round(l1/2):l2,
crd1(j) = crd(i);
j = j+1;
end

p = crd1;
lam = max(eig(r));
la = min(eig(r));
l = lam/la;
w = inv(r)*p;
e = rs - filter(w,1,ds);
s = 1; mu = 1.5/lam;
ni = 1;
while(sle_10)
w1 = w-2*mu*(e.*ds);
rs
y4 = filter(w1,1,ds);
e = y4-rs;
s = 0; e1 = xcorr(e);
for i = 1:length(e1);
s = s/length(e1);
if(y4 == rs)
break
end
ni = ni + 1;
w = w1;
end
end
figure(1);
subplot(2,2,1);
plot(z);
title('near end signal');
subplot(2,2,2);
plot(rs);
title('echo produced in the hybrid');
subplot(2,2,3);
plot(fs);
title('desired signal');
subplot(2,2,4);
plot(fs1);
title('echo added with desired signal');
figure(2);
subplot(2,1,1);
plot(y4);
title('estimated echo signal using LMS algorithm');
subplot(2,1,2);
plot(fs1-y4);
title('echo cancelled signal');

You might also like