git-svn-id: http://moon:8086/svn/matlab/trunk@29 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
2015-04-19 18:32:47 +00:00
parent 2a65062181
commit 652fbde455
2 changed files with 0 additions and 24 deletions
-24
View File
@@ -1,24 +0,0 @@
function [omega, err, dmod, omega_coarse, omega_est, Xm] = fdet(x, N, Ng, off, omega_min, omega_step, omega_max)
%
K = fix((length(x)-Ng)/(N+Ng));
% Initial guess
[omega_coarse, Xm] = fdet_coarse(x, N, Ng, omega_min, omega_step, omega_max);
phi_est = 0;
omega_est = omega_coarse;
for k=1:K
omega(k) = omega_est;
xp = x((k-1)*(N+Ng)+off+1:k*(N+Ng)+off);
x_est = exp(-j*(2*pi*omega_est*(0:N-1)' + phi_est));
iq = xp(Ng+1:N+Ng).*x_est;
dmod(k) = sum(iq);
phi = angle(dmod(k));
omega_f = phi/N/(2*pi);
err(k) = omega_f;
omega_est = omega_est + omega_f;
dphi_est = 2*pi*mod(omega_est*N, 1);
phi_est = mod(phi_est + dphi_est, 2*pi);
end;