clf
clear
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);
deltaf=Fs/8192;
freq=-Fs/2:deltaf:Fs/2-deltaf;
dftdatar=abs(fftshift(fft(hamming(dsize)'.*datar,8192)));
plot(freq,dftdatar)
axis([-Fs/2 Fs/2 0 max(dftdatar)])
xlabel('Analog Frequency (Hz)')
ylabel('Spectral Magnitude')
pause
soundsc(datar,Fs)
pause
plot(datar)
end1=input('end1?')
end2=input('end2?')
datar2=datar(end1:end2);
plot(datar2)
input('wideband spectrogram')
specgram(datar,512,12500,65,45)
title('wideband spectrogram')
input('narrowband spectrogram')
specgram(datar,1024,12500,650,550)
title('narrowband spectrogram')
% Npoles=16;
% [A,G]=lpc(datar2,Npoles);
% e=conv(datar2,A);
% Np=65; Ls=2049;
% ex=zeros(1,Ls);
% ex(1:Np:Ls)=1;
% s(1:Npoles)=zeros(size(1:Npoles));
% for n=Npoles:Ls,
% s(n)=ex(n);
% for m=1:Npoles-1;
% s(n)=s(n)-A(m+1)*s(n-m);
% end
% end
% input('totally synthesized sound')
% soundsc(s,Fs)
% %Here's where we show computational savings of
% %using Levinson Durbin algorithm
% %
% rest=xcorr(datar2,'biased').';
% [Y,I]=max(rest);
% rvec=rest(I(1):I(1)+Npoles+1,1);
% Rc=toeplitz(rvec(1:Npoles,1));
% %
% %flopsTemp=flops;
% aInv=-inv(Rc)*rvec(2:Npoles+1,1);
% %flopsInv=flops-flopsTemp;
% %
% %flopsTemp=flops;
% aLev=levinson(rvec,Npoles).';
% %flopsLev=flops-flopsTemp;
% %flopsInv-flopsLev


