Friday, December 4, 2009

Yule Walker Method Versus Welch Method

In this section I compare ARYule with Pwelch for a short data set. The emphasis is on the superior performance of the Yule Method for the short data set.

The figure shows a comparison between the YULE method of PSD Estimation and Welches method for the same amount of data. The code is shown below. Comments please. I can write a lot about this but it is self explanatory. DO you think?



ARYule Figure:
b=1;a=[1 -0.9 .5];
[H,w]=freqz(b,a);

for i=1:1
N=2^7;n=0:N-1;w=randn(size(n));

x=filter(b,a,w);

%ARYuleRGH1;
A=aryule(x,2);

[H1,w]=freqz(b0,A);
subplot(1,2,1)
plot(w,10*log10(abs(H)))
hold on
plot(w,10*log10(abs(H1)),'r')
subplot(1,2,2)
th=0:.05:2*pi;plot(cos(th),sin(th));hold on;
plot(roots(a),'x')
plot(roots(A),'xr')
drawnow
end

subplot(1,2,1);plot(w,10*log10(abs(H)),'LineWidth',3)
title('Yule-Walker Method: N=2^7,M=2^6, no overlap')
hold off
subplot(1,2,2);plot(roots(a),'x','LineWidth',3)
title('POLE plot')
hold off




PWELCH Figure

b=1;a=[1 -0.9 .5];
[H,w]=freqz(b,a);
for i=1:1
N=2^7;n=0:N-1;v=randn(size(n));M=2^6;
x=filter(b,a,v);
[Px,F]=pwelch(x,rectwin(M),0,M,1);
plot(F,10*log10(Px/2),'r')
hold on
drawnow
end
plot(w/2/pi,10*log10(abs(H).^2),'LineWidth',3)
title('welch method: N=2^7,M=2^6, no overlap')
hold off

1 comment:

  1. I have just looked more carefully at the comparison results and the original systems (thick blue) are not coming out the same in both plots. I have to get them right. Next blog!

    ReplyDelete