📄 dmusic.m
字号:
function dmusic(y,K,J)
% function dmusic(y,K,J)
%
% 1D Damped MUSIC (DMUSIC) Algorithm
%
% y = signal
% K = # of damped sinusoids
% J = Subsample of prediction matrix
%
% Ex:
% dmusic(y,2,12);
%
% References:
% [1] Y. Li, J. Razavilar, and K. Liu, "A Super-Resolution Parameter
% Estimation Algorithm for Multi- Dimensional NMR Spectroscopy,"
% University of Maryland, College Park, MD 1995.
%
% [2] E. Yilmaz and E. Dilaveroglu, "A Performance Analysis for DMUSIC,"
% presented at 5TH International Conference on Electrical and
% Electronics Engineering (ELECO 2007), Bursa, Turkey, 2007.
%
% Coded by: Kenneth John Faller II January 07, 2008
%
warning('off','all');
N = length(y)-1;
if((N-J) < K || J < K)
error('J has to be between K and N-K');
end
% Prediction Matrix
H = hankel(y,1:J);
A = H(1:J,:);
% Singular Value Decomposition
[U D V] = svd(A);
Vn = V(:,K+1:J);
% MUSIC Spectrum
indB = 1;
indW = 1;
s = zeros(21,629);
f = s;
for B=0:0.05:1
for w=0:0.01:2*pi
s(indB,indW) = -B + j*w;
r = 0;
for indR=0:J-1
n=indR+1;
r(n,1) = exp(indR*s(indB,indW));
end
rt = r/norm(r);
f(indB,indW) = real(1/((rt')*(conj(Vn)*(Vn.'))*rt));
indW = indW + 1;
end
indW = 1;
indB = indB + 1;
end
contour(imag(s),-real(s),f,20);
xlabel('Frequency');
ylabel('Damping Factor');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -