|
power spectrum estimation 有幾種方式,
7 [% M7 r/ Y+ h3 F, {2 `Peroidogram
; c1 p3 q9 \! h" Z4 @Modified periodogram
1 z6 v+ W o- V! E% ?) jBartlett method
0 x% e+ d9 `( }( }& ]Welch method
' K2 j, W3 G4 D& i; a4 VBlackman-Tukey method* K; j0 q/ B& S3 D4 g" N* z" }' y
* @4 A" M& y& w; I H0 g( n+ [; G若用simple Peroidogram m file 方式如下,estimated 跟 actual 會有Bias. v2 r7 S" K8 |: z; P# i) h/ n+ G' a9 H
x : input sequence" Z9 y% l, Z# {+ W8 n
n1 : starting index, x(n1)
3 I9 l1 A% t+ c' ~5 X1 A- r: Mn2 : ending index, x(n2)2 k- [) Z' v r0 K$ L0 u0 G
0 b3 o r# m, Y# `# Q: l: e- p
function Px = per(x,n1,n2)! p2 `9 B0 y1 [% K
x = x(;* n# j% _ A' b9 t6 _0 p2 x
if nargin == 1
& o+ z% T2 E& X& g5 E/ B5 M n1 = 1; n2 = length(x); end;
/ D# P7 B; S+ T! y7 F9 d1 x6 D$ r3 sPx = abs(fft(x(n1:n2),1024)).^2/(n2-n1+1);/ ^1 J" Z Z9 d/ S
Px(1) = Px(2); |
|