|
power spectrum estimation 有幾種方式,. i+ r1 O) N5 s7 }
Peroidogram
8 V9 N+ L- K$ k- zModified periodogram* {2 d9 T- ^2 ~. }9 n1 x
Bartlett method: x! B! ^) l' I; C/ J
Welch method
4 R, z" ^+ f1 s/ Q kBlackman-Tukey method+ M5 k4 H# @; W: x* Q. M: ~
$ S6 x+ j+ t9 S/ S# {* v
若用simple Peroidogram m file 方式如下,estimated 跟 actual 會有Bias
, J3 V/ A& ]# Z$ nx : input sequence! W: f. C& b9 Y |% s7 t9 C7 @
n1 : starting index, x(n1). C# H$ _' Z4 b, A( b- P
n2 : ending index, x(n2)
% b; `% m' `5 |, h9 x# ]$ v& D! E" t1 N# @! m! f4 F' |
function Px = per(x,n1,n2)2 g% ?& \6 h; {
x = x(;
C! v% k6 j9 K) v% g3 s Vif nargin == 1
2 G/ R# l" [ Z+ J n1 = 1; n2 = length(x); end;, `6 }- E# ^' ?6 K
Px = abs(fft(x(n1:n2),1024)).^2/(n2-n1+1);+ o+ ]0 I+ k' T6 Q9 y3 t
Px(1) = Px(2); |
|