- remove cyclic prefix
git-svn-id: http://moon:8086/svn/matlab/trunk@21 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
+5
-7
@@ -1,11 +1,8 @@
|
||||
function [omega, err, dmod, omega_coarse, omega_est] = fdet(x, N, omega_min, omega_step, omega_max)
|
||||
function [omega, err, dmod, omega_coarse, omega_est] = fdet(x, N, Ng, omega_min, omega_step, omega_max)
|
||||
%
|
||||
% Example: fdet_eval(1200, pi/4, -10, [1100 1350 1])
|
||||
|
||||
K = fix(length(x)/N);
|
||||
|
||||
% Initial guess
|
||||
omega_coarse = fdet_coarse(x, N, omega_min, omega_step, omega_max);
|
||||
K = fix(length(x-Ng)/(N+Ng));
|
||||
|
||||
% Initial guess
|
||||
omega_coarse = fdet_coarse(x, N, omega_min, omega_step, omega_max);
|
||||
@@ -13,11 +10,12 @@ omega_coarse = fdet_coarse(x, N, omega_min, omega_step, omega_max);
|
||||
phi_est = 0;
|
||||
omega_est = omega_coarse;
|
||||
|
||||
off = 0;
|
||||
for k=1:K
|
||||
omega(k) = omega_est;
|
||||
xp = x((k-1)*N+1:k*N);
|
||||
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));
|
||||
dmod(k) = sum(xp.*x_est);
|
||||
dmod(k) = sum(xp(Ng+1:N+Ng).*x_est);
|
||||
phi = angle(dmod(k));
|
||||
omega_f = phi/N/(2*pi);
|
||||
err(k) = omega_f;
|
||||
|
||||
Reference in New Issue
Block a user