Use to motivate vectors and vector addition, vector compatibility, and have

Contents

students create their own

What is the playback speed?

PlaybackFrequency = 44000;

Load the wav-file

u = wavread('boomchick.wav');

Play the wav-file

disp('Original Signal')
sound(u,PlaybackFrequency)
Original Signal

Set the delay

Delay = 2000;

Create a delayed signal

Delayed_u = u(Delay:220000+Delay);

Chop off the original sound to match

the length of the delayed one

Shortened_u = u(1:length(Delayed_u));

Add the original and delayed sounds

to make an echo effect

disp(['Sum of two signals, one delayed by ',num2str(Delay)])
sound(Delayed_u + Shortened_u,PlaybackFrequency)

Delay = 3000; Different_Delayed_u = u(Delay:220000+Delay);
disp(['Sum of three signals, one delayed by ',num2str(Delay)])
sound(Delayed_u + Different_Delayed_u + Shortened_u,PlaybackFrequency)

Delay = 4000; StillDifferent_Delayed_u = a(Delay:220000+Delay);

sound(Delayed_u + Shortened_u + Different_Delayed_u + StillDifferent_Delayed_u,PlaybackFrequency)
sound(Delayed_u + Shortened_u + Different_Delayed_u + StillDifferent_Delayed_u,88000)
Sum of two signals, one delayed by 2000
Sum of three signals, one delayed by 3000
Undefined function 'a' for input arguments of type 'double'.

Error in FunWithSound (line 33)
Delay = 4000; StillDifferent_Delayed_u = a(Delay:220000+Delay);