I need help in matlabThe task is echo removing from the sign
I need help in matlab.The task is echo removing from the signal.Suppose we have a musical signal include echoes, so we have to design the filter to remove echo.
In attach pics, there is complete description about the question.
where h[O] is the signal attenuation of the direct path between the source of music and the microphone, and h[k]for k >0 can be viewed as the coefficients of the echoes. Choose the coefficients of the echoes as follows: h[0] = 1, h[50001 0.5 h[90001 0.02 STEP 1 Compute, plot, and play the following music signal yfn: y[n] = h[k]x(n-k] k=0 where xfk] is your own original musical signal from project deliverable 2. When you listen to the y[n], you should feel the echoes in the signal. STEP 2: In the second step, we pretend like we do not know the original signal, and all we have is the musical signal with echoes, which is yln]. Now, your task is to design a filter, whose impulse response is denoted as gln), in order to remove the echoes. So, the overall system (including STEP 1 and STEP 2) looks likeSolution
%clearing window, variables and figures
clear all;
close all;
clf;
clc;
n=10000;
for i=1:1:19999
xa(i)=i-1;
end
x=rand(1,10000);
h=zeros(1,10000);
h(1)=1;
h(5001)=0.5;
h(9001)=0.2;
y = conv(x, h);
stem(xa,y);
title(\'Signal with echo\');
soundsc(y);
for i=1:1:19999
if i==1
v(i)=y(i)-y(i);
elseif i==5001
v(i)=y(i)-0.5*y(i);
elseif i==9001
v(i)=y(i)-0.2*y(i);
else
v(i)=y(i);
end
end
figure;
stem(xa,v)
title(\'original signal\');
soundsc(v);
