Now listen to both signals by typing:
and also plot their normalized auto-correlation functions using the commands:
plot(-6999:6999,xcorr(Exercise1,'coeff'));
grid;
figure;
plot(-10000:10000,xcorr(Exercise2,'coeff'));
grid;
N=2000; % delay in samples
y=Exercise2; % Signal with echo
x(1:N)=y(1:N); % First N samples of x and y agree
for i=N+1:length(y)
x(i)=y(i)-0.75*x(i-N); % Inverse filtering
end
subplot(211)
plot(y); % Plot signal with echo
title('SIGNAL WITH ECHO');
subplot(212)
plot(x); % Plot signal without echo
title('SIGNAL WITHOUT ECHO');
soundsc(y); % Listen to signal with echo
soundsc(x); % Listen to signal without echo