pisarenko.m

来自「Mathematical Methods by Moor n Stiling.」· M 代码 · 共 28 行

M
28
字号
function [f,P] = pisarenko(Ryy)
%
% Compute the the modal frequencies using Pisarenko's method,
% then find the amplitudes
%
% function [f,P] = pisarenko(Ryy)
%
% Ryy = autocorrelation function from observed data
%
% f = vector of frequencies
% P = vector of amplitudes

% Copyright 1999 by Todd K. Moon

[n,n] = size(Ryy);
[v,u] = eig(Ryy);
sigma2 = u(n,n);
vm = v(:,n);               % get eigenvector from smallest eigenvalue
r = roots(vm);             % find roots of the polynomial
f = angle(conj(r))/(2*pi); % get angle and convert to Hz/sample
% Now compute the amplitudes

% Build up the coefficient matrix
for k=1:n-1
   A(k,:) = exp(2*pi*j*k .* f)'
end
r = Ryy(1,2:n);
P = A\r;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?