% computerSound.m

% The following plays an excerpt of a famous speech
% from Winstin Churchill.
[x,fs,bits] = wavread('fh.wav'); sound(x,fs);
pause;

% Plot a tiny part of the signal
seg = 24675:24860; plot(seg,x(seg),'o',seg,x(seg),'-');
pause;

% Sound of a pure tone.
% Note that abrupt termination of the pure tone signal
% creates noisy metallic tone.
% The signal needs to ramp up at the beginning and 
% ramp down at the end.
sf=8196; tone1 = puretone(sf,1000,0.5,1,[]);
sound(tone1,sf);
pause;

% The following plays the sound of a whistle and plots
% the signal.
[w,fs,bits] = wavread('whistle.wav'); sound(w,fs); 
plot(w); wLength = length(w); 
wDuration = wLength/fs;
