[y,fs]=wavread('basin10sec.wav'); sound(y,fs) fs=8000; x=linspace(0,1,fs); z=cos(2*pi*440*x); %1 second at A 440 sound(z,fs) plot(dct(z)); %Note that we have one second of data, so the coefficient corresponding %to sound frequency 440Hz is 2*440=880. octavez=cos(2*2*pi*440*x); sound(octavez,fs); [yorig,fs2]=wavread('banjo.wav'); %This is an open A string on a banjo. sound(yorig,fs2); y=10*yorig(12000:20000); %So we can compare, we use one second of this data. sound(y,fs2); plot(dct(y)); %See all the harmonics that we predicted? Hint: they are integer multiples of 880. [flute,fsflute]=wavread('lownoteflute.wav'); sound(flute,fsflute) flutesec=flute(100:fsflute+100); sound(flutesec,fsflute); plot(dct(flutesec)); x=linspace(0,1,fsflute); middlec=cos(2*pi*261.63*x); sound(middlec,fsflute); [clarinet,fsclarinet]=wavread('lownoteclarinet.wav'); sound(clarinet,fsclarinet) clarinetsec=clarinet(100:fsclarinet+100); sound(clarinetsec,fsclarinet); plot(dct(clarinetsec));