clg
clear
Nw=input('window length');
Nlap=input('overlap');
Nfft=input('FFT length');
woff=pi/Nw;
coff=(Nw-1)/2;
wrec=ones(1,Nw);
wsin=cos(woff*((0:Nw-1)-coff));
whan=.5*wrec+.5*cos(2*woff*((0:Nw-1)-coff));
wham=.54*wrec+.46*cos(2*woff*((0:Nw-1)-coff));
data=getspeech('0af1s1t0.wav');
Fs=12500;
plot(data)
end1=input('end1?')
end2=input('end2?')
datar=data(end1:end2);
clear data
plot(datar)
[d,dsize]=size(datar);
sound(datar,Fs)
pause
plot(datar)
input('spectrogram');
subplot(221)
specgram(datar,Nfft,12500,wrec',Nlap)
title('rect window')
pack
subplot(222)
specgram(datar,Nfft,12500,wsin',Nlap)
title('sine window')
pack
subplot(223)
specgram(datar,Nfft,12500,whan',Nlap)
title('Hanning window')
pack
subplot(224)
specgram(datar,Nfft,12500,wham',Nlap)
title('Hamming window')




