% Use to motivate vectors and vector addition, vector compatibility, and have
% students create their own

% What is the playback speed?
PlaybackFrequency = 54000;

% Load the wav-file
u = wavread('boomchick.wav');

% Play the wav-file
disp('Original Signal')
sound(u,PlaybackFrequency)

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

return
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 = 2000; 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)

return
