{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ch78sol - 7-9 continued%PR7-9-1 m f=-5.01:5 W l=(sinc(f"2...

This preview shows pages 1–6. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
7-9. / continued %PR7-9-1. m f=-5:.01:5; W l=(sinc(f))."2; W2=sinc(2*f)+.5*sinc(2*f+ones(size(f))+,5*~inc(2*f-ones(size(f)); W3=1.08 *sinc(2*f)+.46'sinc(2*f+ones(size(f))+,46*sinc(2*f-ones(size(f)); clg axis([-5,5,l e-5,101); whitebg subplot(l,3,1);sernilogy(f,abs(W l),'k');yIabel('/W(f,~') title('Bartlet ') axis([-5,5,le-5, !0]); subplot(l,3,2);semilogy(f,abs(W2),'k'); xlabel('Frequencyl); title('Hanning '); axis([-5,5,1e-5, lo]); subplot(l,3,3);semilogy(f,abs(W3),'k') title('Hamming '); axis([-5,5,l e-5,101); Bartlet Hanninq Hamming Frequency
0.25,0.23,-0.91,-0.19,0.24]; fs=100; %Sampling frequency M-8 %Number points in lag window (even) [a, b]=size(x); if a < b % make x a column vector x=x9; N=b; else N=a; end x 1 =detrend(x,O); %remove the dc component x1(2*N-2)=0; %zero pad to length of 2N-2 Rl=real(ifft(abs(fFt(x1))."2)); %raw autocorrelation %compute weighted autocorrelation W-triang(2 *N- 1); R2=[Rl (rJ:2*N-2);RI (1 :N-I)]./((N)*W(1:2*N-2)); R3=R2(N-M:N+M- 1); H=hamming(2*M+ 1); R4=R3 .*H(1:2*M); I~2~(ceil(log2(2*MJ) +2); %make length FFT power of 2 and add zeros S 1 =abs((l/fs)*fR(R4,k)); f=O:fS/k:fdZ; Scor=S l(1: W2+ 1); %positive frequency part of spectral density sernilogy(f, Scor);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}