1
// Spectral power estimation
2
// ( form Sawaragi et all)
5
a=[1,-1.3136,1.4401,-1.0919,+0.83527]
6
b=[0.0,0.13137,0.023543,0.10775,0.03516]
8
z=arsimul(a,b,[0],0,u);
11
//----The theorical result
12
deff('[gx]=gxx(z)',['gx=(abs( a* exp(-%i*2*%pi*z*(0:4))'')**2)';...
13
'gx=abs( b* exp(-%i*2*%pi*z*(0:4))'')**2/gx']);
15
for x=fr,res=[ res, gxx(x)];end;
16
//----using armax estimation of order (4,4)
17
// it's a bit tricky because we are not supposed to know the order
19
[arc,la,lb,sig,resid]=armax(4,4,z,u);
23
for x=fr,res1=[ res1, gxx(x)];end;
25
leg="log(p) :using macro mese @ theoriqal value@log(p) : arma identifcation"
28
xtitle('Spectral power','frequency','spectral estimate')
29
plot2d([fr;fr;fr]',[20*log(sm/sm(1))/log(10);...
30
20*log(res/res(1))/log(10);...
31
20*log(res1/res1(1))/log(10)]',...
32
[2,1,-1],"111",leg, [0,-70,0.5,60]);