- removed hard coded numbers
git-svn-id: http://moon:8086/svn/matlab/trunk@61 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
+11
-9
@@ -187,13 +187,13 @@ fprintf('Frame timing acquisition\n');
|
||||
bins = c2i(N, carrier_time);
|
||||
kc_max = -1000;
|
||||
n_max = 0;
|
||||
skip_syms = 15*4;
|
||||
for n=0:15-1
|
||||
skip_syms = ofdm_drm_params.nspf*4;
|
||||
for n=0:ofdm_drm_params.nspf-1
|
||||
frame_timing_Z = 0;
|
||||
k = skip_syms+n;
|
||||
for m=1:2
|
||||
[kc valid frame_timing_Z] = timing_frame(Z_(bins, k)', bins, 15, frame_timing_Z);
|
||||
k = k + 15;
|
||||
[kc valid frame_timing_Z] = timing_frame(Z_(bins, k)', bins, ofdm_drm_params.nspf, frame_timing_Z);
|
||||
k = k + ofdm_drm_params.nspf;
|
||||
end
|
||||
if valid
|
||||
if kc > kc_max
|
||||
@@ -244,6 +244,8 @@ kk = 1;
|
||||
H_ = [];
|
||||
df_track_ = [];
|
||||
MIN_ABS_H = 1e-10;
|
||||
eps_abs_h = MIN_ABS_H;
|
||||
|
||||
start = skip_syms+frame_start;
|
||||
|
||||
for k=start:length(Z_)
|
||||
@@ -259,7 +261,7 @@ for k=start:length(Z_)
|
||||
H_gain_cell{m+1} = (H_);
|
||||
|
||||
str = sprintf('Frame %d, s=%d, m=%d, n=%d', k, s, m, n);
|
||||
if kk > 6
|
||||
if kk > frames_per_window
|
||||
ii = 1+mod(m+symbols_to_delay-1+(0:frames_per_window-1), frames_per_window);
|
||||
|
||||
H_gain = [H_gain_cell{ii}];
|
||||
@@ -274,14 +276,14 @@ for k=start:length(Z_)
|
||||
|
||||
% get frequency error
|
||||
% correlate wiener filtered channel with raw estimate
|
||||
df_track = 12000/(2*pi*N)*angle(H_pilots * Hr' + MIN_ABS_H);
|
||||
df_track = fs/(2*pi*N)*angle(H_pilots * Hr' + eps_abs_h);
|
||||
df_track_ = [df_track_ df_track];
|
||||
|
||||
% check for too small values
|
||||
rms_H = sqrt( abs( H_syms*H_syms' )/length(H_syms) );
|
||||
MIN_ABS_H = max( rms_H/20, 1e-10 ); %quick and dirty fixed settings
|
||||
H_too_small_index = find( abs(H_syms)<MIN_ABS_H );
|
||||
H_syms( H_too_small_index ) = MIN_ABS_H;
|
||||
eps_abs_h = max( rms_H/20, MIN_ABS_H ); %quick and dirty fixed settings
|
||||
H_too_small_index = find( abs(H_syms)<eps_abs_h );
|
||||
H_syms( H_too_small_index ) = eps_abs_h;
|
||||
|
||||
% equalize symbol
|
||||
sym_eq = sym ./ H_syms;
|
||||
|
||||
Reference in New Issue
Block a user