Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this code problem! The following code is requierd; % Design an echo filter that produces the original signal plus two echoes.

I need help with this code problem!
The following code is requierd;

% 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)

image text in transcribed
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.8 seconds after the original signal has arrived, the second echo is attenuated by 15% and occurs at 1.3 seconds after the original signal has arrived and the third echo is attenuated by 20% and occurs at 1.8 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. a. Plot the original signal and the echo signal in separate windows, show the time-axis in seconds. b. Use the sound command to hear both signals. c. Calculate the Unit-Sample Response of your filter (see Subtheme 3, example 3). d. Calculate the System Function of your filter (see Subtheme 3, example 3)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions