- cleaned up

git-svn-id: http://moon:8086/svn/matlab/trunk@59 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
2015-05-02 18:05:57 +00:00
parent bebf8dadd8
commit 3fc175c599
+15 -8
View File
@@ -225,7 +225,6 @@ symbols_per_frame = ofdm_drm_params.nspf;
symbols_to_delay = ofdm_drm_params.y;
frames_per_window = 2*ofdm_drm_params.y;
H_gain_cell = cell (frames_per_window, 1);
H_gain_carriers_cell = cell (frames_per_window, 1);
H_raw = zeros(length(ofdm_spec_occ.kmin:ofdm_spec_occ.kmax),1);
carriers = ofdm_spec_occ.kmin:ofdm_spec_occ.kmax;
carrier_indexes = c2i(N, carriers);
@@ -269,17 +268,24 @@ for k=start:length(Z_)
H_raw(carrier_gain_bins) = (H_);
H_gain_cell{m+1} = (H_);
H_gain_carriers_cell{m+1} = carrier_gain;
str = sprintf('Frame %d, s=%d, m=%d, n=%d', k, s, m, n);
if kk > 6
ii = 1+mod(m+symbols_to_delay-1+(0:frames_per_window-1), frames_per_window);
H_gain = [H_gain_cell{ii}];
H_syms = H_gain*W_syms{n+1};
H_pilots = (H_gain)*W_pilots{n+1};
ZZ = Z_(carrier_indexes, k-symbols_to_delay).';
hhh = H_gain_cell{mod(m-1, frames_per_window)+1};
df_track = 12000/(2*pi*N)*angle( (H_pilots) * hhh' + MIN_ABS_H);
% Get the correctly delayed symbols
sym = Z_(carrier_indexes, k-symbols_to_delay).';
% Get the correctly delayed raw channel estimate
Hr = H_gain_cell{mod(m-1, frames_per_window)+1};
% 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_ = [df_track_ df_track];
% check for too small values
@@ -288,13 +294,14 @@ for k=start:length(Z_)
H_too_small_index = find( abs(H_syms)<MIN_ABS_H );
H_syms( H_too_small_index ) = MIN_ABS_H;
sym_eq = ZZ ./ H_syms;
% equalize symbol
sym_eq = sym ./ H_syms;
sym_out(:, kk) = sym_eq;
if 0
subplot(2, 1, 1)
plot(1:length(hhh), abs(hhh), 'b-', 1:length(H_pilots), abs(H_pilots), 'r-'); grid;
plot(1:length(Hr), abs(Hr), 'b-', 1:length(H_pilots), abs(H_pilots), 'r-'); grid;
subplot(2, 1, 2)
plot(1:length(hhh), angle(hhh), 'b-', 1:length(H_pilots), angle(H_pilots), 'r-'); grid;
plot(1:length(Hr), angle(Hr), 'b-', 1:length(H_pilots), angle(H_pilots), 'r-'); grid;
title(str);
pause(0.01);
end