clf
clear
data=getspeech('0af1s1t0.wav');
Fs=12500;
soundsc(data,Fs)
plot(data)
end1=input('end1?')
end2=input('end2?')
%end1=2000;
%end2=12500;
datar=data(end1:end2);
plot(datar)
[d,dsize]=size(datar);
deltaf=Fs/8192;
freq=-Fs/2:deltaf:Fs/2-deltaf;
dftdatar=abs(fftshift(fft(datar,8192)));
plot(freq,dftdatar)
axis([-Fs/2 Fs/2 0 max(dftdatar)])
xlabel('Analog Frequency (Hz)')
ylabel('Spectral Magnitude')
% soundsc(datar,Fs)
% plot(datar)
% %end1=input('end1?')
% %end2=input('end2?')
% end1=2000;
% end2=10000;
% datar2=datar(end1:end2);
% plot(datar2)
pause
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(datar,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(datar,'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;



