capon.m

来自「现代信号谱估计算法的matlab代码 调用函数代码」· M 代码 · 共 35 行

M
35
字号
function phi=capon(y,m,L)
%
% The Capon spectral estimator.
%
% phi=capon(y,m,L);
%
%    y   <- the data vector (length N)
%    m   <- the length of the Capon filter
%    L   <- the number of estimated spectral samples
%    phi -> the estimated spectrum
%

% Copyright 1996 by R. Moses

y=y(:);
N=length(y);       % data length

% form the sample covariance matrix
R=zeros(m+1,m+1);
for i = m+1 : N,
   R=R+y(i:-1:i-m)*y(i:-1:i-m)';
end
R=R/(N-m);

% compute the inverse of R
IR=inv(R);

% compute the spectrum
phi=zeros(L,1);
for k = 1 : L, 
   a=exp(- j*2*pi*(k-1)/L*[0:m].');      % form the a(w) vector
   phi(k)=real(a'*IR*a);
end
phi=(m+1)./phi;

⌨️ 快捷键说明

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