Modify the code in Subtheme 3, example 3 in order to design an echo filter that produces the original signal y[n] plus three echoes. Assume that the original signal arrives with zero (or negligible delay). The first echo is attenuated by 10% and occurs at 0.3 seconds after the original signal has arrived, the second echo is attenuated by 20% and occurs at 0.4 seconds after the original signal has arrived and the third echo is attenuated by 30% and occurs at 0.5 seconds after the arrival of the original signal. The system will be working at a sampling rate of Fs=8192. Upload the demo sound "splat" provided in MATLAB as demonstrated in Subtheme 3, example 3, in order to test your filter.
Plot the original signal and the echo signal in separate windows, show the time-axis in seconds.
Use the sound command to hear both signals.
Calculate the Unit-Sample Response of your filter (see Subtheme 3, example 3).
Calculate the System Function of your filter (see Subtheme 3, example 3).
Post in the discussion board part 4 , part 1 and at least one of parts 2, 3 as described below.
Your c and d answers to the proposed exercise.
Based on the delay in seconds of each echo (with respect to the arrival of the original signal) and the velocity of sound at sea level post your estimate of the extra distance that each echo travelled with respect to the original signal.
Post whether you consider that the most likely physical environment that could cause such delayed reflection of sound is a: i) Tennis or basketball court, ii) City blocks in an urban environment with large buildings or iii) Large mountain/canyon type geographical feature.
Example Code MATLAB
% Design an echo filter that produces the original signal plus two echoes.
% The first echo is attenuated by 20% and occurs at 1 Second.
% The second echo is attenuated by 30% and occurs at 1.5 Seconds.
% System Works at Fs=8192.
close all
clear all
load( 'splat' )
N=length(y); % y is the default name of the uploaded signal
a1=0.8; % 20% attenuation
a2=0.7; % 30% attenuation
td1=1; % time delay 1 in seconds
td2=1.5; % time delay 2 in seconds
Ts=1/Fs; % sampling period
n1= floor(td1/Ts); % time delay 1 in samples
n2= floor (td2/Ts); % time delay 1 in samples
h(1)=1; % unit-sample response coefficients
h(n1)=a1;
h(n2)=a2;
yecho=conv(h,y); % filter output
sound(y, Fs) % Hear the original signal
n=0:length(y)-1;
plot(n*Ts,y);
xlabel( 'seconds' , 'fontsize' ,14)
title( 'Input Signal' , 'fontsize' ,14)
sound(yecho) % Hear the output signal with echoes
figure
n=0:length(yecho)-1;
plot(n*Ts,yecho) % time axis is in seconds
xlabel( 'seconds' , 'fontsize' ,14)
title( 'Output Signal' , 'fontsize' ,14)