% wavelets.m reads the data file wavelets.wav and plays it [w]=wavread('wavelets.wav'); % read "wavelets" data file [a]=wavread('a.wav'); sound(w,44100); % play back the sound figure(1); subplot(2,1,1); n=size(w); w=w-median(w); t=(1:n)/44100; plot(t,w); title('Signal from spoken word'); xlabel('Time in seconds (sampled 44,100 times per second)'); ylabel('Signal (integer values)'); subplot(2,1,2); n=size(a); a=a-median(a); t=(1:n)/44100; plot(t,a); title('Signal from spoken vowel'); xlabel('Time in seconds (sampled 44,100 times per second)'); ylabel('Signal (integer values)'); figure(2); subplot(2,1,1); ws = fft(w); k=[1:1:900]; plot(k,abs(ws(k))/5000); ylabel('Strength'); xlabel('Frequency (cycles per second)'); title('Fourier energy spectrum of the word "wavelets"'); subplot(2,1,2); as = fft(a); plot(k,abs(as(k))/5000); ylabel('Strength'); xlabel('Frequency (cycles per second)'); title('Fourier energy spectrum of the spoken "a"');