function w=music(y,n,m)
%
% The Root MUSIC method for frequency estimation.
%
% w=music(y,n,m);
%
% y -> the data vector
% n -> the model order
% m -> the order of the covariance matrix in (4.5.14)
% w <- the frequency estimates
%
% Copyright 1996 by R. Moses
y=y(:);
N=length(y); % data length
% compute the sample covariance matrix
R=zeros(m,m);
for i = m : N,
R=R+y(i:-1:i-m+1)*y(i:-1:i-m+1)'/N;
end
% to use the forward-backward approach, uncomment the next line
% R=(R+fliplr(eye(m))*R.'*fliplr(eye(m)))/2;
% get the eigendecomposition of R; use svd because it sorts eigenvalues
[U,D,V]=svd(R);
G=U(:,n+1:m);
C=G*G'; % mxm
% find the coefficients of the polynomial in (4.5.16)
for kk=1:2*m-1,
a(kk,1)=sum(diag(C,kk-m));
end
ra=roots(a);
% find the m-1 roots of the a polynomial that are nearest and inside the unit circle,
% occasionally, due to numerical inaccuracies, you will get two roots on the
% unit circle and at slightly different angles, instead of two roots at the same
% angle and at slightly different amplitudes. For this reason we first sort the root
% magnitudes and take the first m-1, then take the n closest of these
[dum,ind]=sort(abs(ra));
rb=ra(ind(1:m-1));
% pick the n roots that are closest to the unit circle
[dumm,I]=sort(abs(abs(rb)-1));
w=angle(rb(I(1:n)));
return
ch4.zip_spectral estimation_stoica
版权申诉
158 浏览量
2022-09-23
09:47:46
上传
评论
收藏 4KB ZIP 举报
林当时
- 粉丝: 100
- 资源: 1万+
最新资源
- Music-Player +PlayerActivity+ rockplayer+ SeeJoPlayer 播放器JAVA源码
- vscode-1.46.0.tar源码文件
- 最近很火植物大战僵尸杂交版2.08苹果+安卓+PC+防闪退工具V2+修改工具+高清工具+通关存档整合包更新
- 超级好用的截图工具PixPin,可录制Gif图
- Screenshot_2024-05-21-17-06-42-64_2332cb9b27b851b548ba47a91682926c.jpg
- 毕业设计参考 - 基于树莓派、OpenCV及Python的人脸识别
- node-v18.20.2-linux-arm64
- 222222222222
- 16张相机标定图片,可复现本文畸变矫正
- dbeaver-ce-23.3.1-x86_64-setup.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈