how to use PHD method to compute the frequency estimate?

2 ビュー (過去 30 日間)
modified covariance
modified covariance 2012 年 10 月 23 日
let x(t)=10cos(200*pi*t+1.2) which is a continuous-time sinusoid. The x(t) is sampled every Ts=0.001 sec. to obtain a sequence x[n] where x[n]=x(nTs) for n between 0 and 100 (including 0 and 100)
im trying to develop the MATLAB function for the PHD estimator, denoted by phd.
given the following: 1.that xcorr with “unbiased” can be utilized in implementing phd.m.
come up with the following code
function w = phd(x);
% w = phd(x) is used to estimate frequency
% the PHD method from the vector x
% x is supposed to be a noisy single-tone sequence
% w is the estimated frequency in radian
N=max(size(x));
for n=1:N-1
r1=(1/(N-1))*x(n)*x(n+1);
for n=1:N-2
r2=(1/(N-2))*x(n)*x(n+1);
t1=0;
t2=0;
t1=r2+((r2)^2+8*(r1)^2)^(1/2);
t2=t2+4/r1;
end
r = t1/t2;
if (r>1)
r=1;
end
if (r<-1)
r=-1;
end
w=acos(r);
now I want to use this phd method to determine the frquency estimate for x[n].
t = 0:0.001:0.1-0.001;
x = 10*cos(200*pi*t+1.2);
N=max(size(x));
for n=1:N-1
r1=(1/(N-1))*x(n)*x(n+1);
for n=1:N-2
r2=(1/(N-2))*x(n)*x(n+1);
t1=0;
t2=0;
t1=r2+((r2)^2+8*(r1)^2)^(1/2);
t2=t2+4/r1;
end
r = t1/t2;
if (r>1)
r=1;
end
if (r<-1)
r=-1;
end
w=acos(r);
but no results output, could anyone help to solve? thank u.

回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by