merged chest_dl fixes from master and adapted to uplink

master
Ismael Gomez 9 years ago
commit 9618135423

@ -6,7 +6,7 @@ clear
plot_noise_estimation_only=false; plot_noise_estimation_only=false;
SNR_values_db=linspace(0,30,5); SNR_values_db=100;%linspace(0,30,5);
Nrealizations=1; Nrealizations=1;
w1=1/3; w1=1/3;
@ -54,7 +54,7 @@ legends={'matlab','ls',num2str(w1)};
colors={'bo-','rx-','m*-','k+-','c+-'}; colors={'bo-','rx-','m*-','k+-','c+-'};
colors2={'b-','r-','m-','k-','c-'}; colors2={'b-','r-','m-','k-','c-'};
addpath('../../build/srslte/lib/ch_estimation/test') addpath('../../debug/srslte/lib/ch_estimation/test')
offset = -1; offset = -1;
for nreal=1:Nrealizations for nreal=1:Nrealizations

@ -12,7 +12,7 @@ Nrealizations=1;
w1=0.1; w1=0.1;
w2=0.3; w2=0.3;
enb.NDLRB = 25; % Number of resource blocks enb.NDLRB = 6; % Number of resource blocks
enb.CellRefP = 1; % One transmit antenna port enb.CellRefP = 1; % One transmit antenna port
enb.NCellID = 0; % Cell ID enb.NCellID = 0; % Cell ID
@ -26,7 +26,7 @@ P=K/6;
cfg.Seed = 0; % Random channel seed cfg.Seed = 0; % Random channel seed
cfg.InitTime = 0; cfg.InitTime = 0;
cfg.NRxAnts = 1; % 1 receive antenna cfg.NRxAnts = 1; % 1 receive antenna
cfg.DelayProfile = 'EPA'; cfg.DelayProfile = 'EVA';
% doppler 5, 70 300 % doppler 5, 70 300
@ -55,7 +55,7 @@ L = gridsize(2); % Number of OFDM symbols in one subframe
Ports = gridsize(3); % Number of transmit antenna ports Ports = gridsize(3); % Number of transmit antenna ports
%% Allocate memory %% Allocate memory
Ntests=4; Ntests=2;
hest=cell(1,Ntests); hest=cell(1,Ntests);
tmpnoise=cell(1,Ntests); tmpnoise=cell(1,Ntests);
for i=1:Ntests for i=1:Ntests

@ -79,6 +79,7 @@ SRSLTE_API void srslte_interp_linear_vector(srslte_interp_linsrslte_vec_t *q,
cf_t *in0, cf_t *in0,
cf_t *in1, cf_t *in1,
cf_t *between, cf_t *between,
uint32_t in1_in0_d,
uint32_t M); uint32_t M);
SRSLTE_API void srslte_interp_linear_vector2(srslte_interp_linsrslte_vec_t *q, SRSLTE_API void srslte_interp_linear_vector2(srslte_interp_linsrslte_vec_t *q,
@ -86,6 +87,7 @@ SRSLTE_API void srslte_interp_linear_vector2(srslte_interp_linsrslte_vec_t *q,
cf_t *in1, cf_t *in1,
cf_t *start, cf_t *start,
cf_t *between, cf_t *between,
uint32_t in1_in0_d,
uint32_t M); uint32_t M);
SRSLTE_API void srslte_interp_linear_vector3(srslte_interp_linsrslte_vec_t *q, SRSLTE_API void srslte_interp_linear_vector3(srslte_interp_linsrslte_vec_t *q,
@ -93,6 +95,7 @@ SRSLTE_API void srslte_interp_linear_vector3(srslte_interp_linsrslte_vec_t *q,
cf_t *in1, cf_t *in1,
cf_t *start, cf_t *start,
cf_t *between, cf_t *between,
uint32_t in1_in0_d,
uint32_t M, uint32_t M,
bool to_right, bool to_right,
uint32_t len); uint32_t len);

@ -240,33 +240,25 @@ static void interpolate_pilots(srslte_chest_dl_t *q, cf_t *pilot_estimates, cf_t
/* Now interpolate in the time domain between symbols */ /* Now interpolate in the time domain between symbols */
if (SRSLTE_CP_ISNORM(q->cell.cp)) { if (SRSLTE_CP_ISNORM(q->cell.cp)) {
if (nsymbols == 4) { if (nsymbols == 4) {
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(0), &cesymb(4), &cesymb(1), 3); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(0), &cesymb(4), &cesymb(1), 4, 3);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(4), &cesymb(7), &cesymb(5), 2); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(4), &cesymb(7), &cesymb(5), 3, 2);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(7), &cesymb(11), &cesymb(8), 3); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(7), &cesymb(11), &cesymb(8), 4, 3);
srslte_interp_linear_vector2(&q->srslte_interp_linvec, &cesymb(7), &cesymb(11), &cesymb(11), &cesymb(12), 2); srslte_interp_linear_vector2(&q->srslte_interp_linvec, &cesymb(7), &cesymb(11), &cesymb(11), &cesymb(12), 4, 2);
} else { } else {
srslte_vec_sub_ccc(&cesymb(1), &cesymb(8), q->srslte_interp_linvec.diff_vec, q->srslte_interp_linvec.vector_len); srslte_interp_linear_vector2(&q->srslte_interp_linvec, &cesymb(8), &cesymb(1), &cesymb(1), &cesymb(0), 7, 1);
srslte_vec_sc_prod_cfc(q->srslte_interp_linvec.diff_vec, (float) 1/7, q->srslte_interp_linvec.diff_vec, srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(8), &cesymb(2), 7, 6);
q->srslte_interp_linvec.vector_len); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(8), &cesymb(9), 7, 5);
srslte_vec_sum_ccc(q->srslte_interp_linvec.diff_vec, &cesymb(1), &cesymb(0), q->srslte_interp_linvec.vector_len);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(8), &cesymb(2), 6);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(8), &cesymb(9), 5);
} }
} else { } else {
if (nsymbols == 4) { if (nsymbols == 4) {
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(0), &cesymb(3), &cesymb(1), 2); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(0), &cesymb(3), &cesymb(1), 3, 2);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(3), &cesymb(6), &cesymb(4), 2); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(3), &cesymb(6), &cesymb(4), 3, 2);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(6), &cesymb(9), &cesymb(7), 2); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(6), &cesymb(9), &cesymb(7), 3, 2);
srslte_interp_linear_vector2(&q->srslte_interp_linvec, &cesymb(6), &cesymb(9), &cesymb(9), &cesymb(10), 2); srslte_interp_linear_vector2(&q->srslte_interp_linvec, &cesymb(6), &cesymb(9), &cesymb(9), &cesymb(10), 3, 2);
} else { } else {
srslte_vec_sub_ccc(&cesymb(1), &cesymb(7), q->srslte_interp_linvec.diff_vec, q->srslte_interp_linvec.vector_len); srslte_interp_linear_vector2(&q->srslte_interp_linvec, &cesymb(7), &cesymb(1), &cesymb(1), &cesymb(0), 6, 1);
srslte_vec_sc_prod_cfc(q->srslte_interp_linvec.diff_vec, (float) 1/6, q->srslte_interp_linvec.diff_vec, srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(7), &cesymb(2), 6, 5);
q->srslte_interp_linvec.vector_len); srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(7), &cesymb(8), 6, 4);
srslte_vec_sum_ccc(q->srslte_interp_linvec.diff_vec, &cesymb(1), &cesymb(0), q->srslte_interp_linvec.vector_len);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(7), &cesymb(2), 5);
srslte_interp_linear_vector(&q->srslte_interp_linvec, &cesymb(1), &cesymb(7), &cesymb(8), 4);
} }
} }
} }

@ -168,9 +168,12 @@ static void interpolate_pilots(srslte_chest_ul_t *q, cf_t *ce, uint32_t nrefs)
uint32_t NL = 2*SRSLTE_CP_NSYMB(q->cell.cp); uint32_t NL = 2*SRSLTE_CP_NSYMB(q->cell.cp);
/* Interpolate in the time domain between symbols */ /* Interpolate in the time domain between symbols */
srslte_interp_linear_vector3(&q->srslte_interp_linvec, &cesymb(L2), &cesymb(L1), &cesymb(L1), &cesymb(L1-1), L1, false, nrefs); srslte_interp_linear_vector3(&q->srslte_interp_linvec,
srslte_interp_linear_vector3(&q->srslte_interp_linvec, &cesymb(L1), &cesymb(L2), NULL, &cesymb(L1+1), (L2-L1)-1, true, nrefs); &cesymb(L2), &cesymb(L1), &cesymb(L1), &cesymb(L1-1), (L2-L1), L1, false, nrefs);
srslte_interp_linear_vector3(&q->srslte_interp_linvec, &cesymb(L1), &cesymb(L2), &cesymb(L2), &cesymb(L2+1), (NL-L2)-1, true, nrefs); srslte_interp_linear_vector3(&q->srslte_interp_linvec,
&cesymb(L1), &cesymb(L2), NULL, &cesymb(L1+1), (L2-L1), (L2-L1)-1, true, nrefs);
srslte_interp_linear_vector3(&q->srslte_interp_linvec,
&cesymb(L1), &cesymb(L2), &cesymb(L2), &cesymb(L2+1), (L2-L1), (NL-L2)-1, true, nrefs);
} }

@ -122,22 +122,26 @@ void srslte_interp_linear_vector_free(srslte_interp_linsrslte_vec_t *q) {
} }
void srslte_interp_linear_vector(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *between, uint32_t M) void srslte_interp_linear_vector(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *between,
uint32_t in1_in0_d, uint32_t M)
{ {
srslte_interp_linear_vector2(q, in0, in1, NULL, between, M); srslte_interp_linear_vector2(q, in0, in1, NULL, between, in1_in0_d, M);
} }
void srslte_interp_linear_vector2(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *start, cf_t *between, uint32_t M) void srslte_interp_linear_vector2(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *start, cf_t *between,
uint32_t in1_in0_d, uint32_t M)
{ {
srslte_interp_linear_vector3(q, in0, in1, start, between, M, true, q->vector_len); srslte_interp_linear_vector3(q, in0, in1, start, between, in1_in0_d, M, true, q->vector_len);
} }
void srslte_interp_linear_vector3(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *start, cf_t *between, uint32_t M, bool to_right, uint32_t len) void srslte_interp_linear_vector3(srslte_interp_linsrslte_vec_t *q, cf_t *in0, cf_t *in1, cf_t *start, cf_t *between,
uint32_t in1_in0_d, uint32_t M, bool to_right, uint32_t len)
{ {
uint32_t i; uint32_t i;
srslte_vec_sub_ccc(in1, in0, q->diff_vec, len); srslte_vec_sub_ccc(in1, in0, q->diff_vec, len);
srslte_vec_sc_prod_cfc(q->diff_vec, (float) 1/(M+1), q->diff_vec, len); srslte_vec_sc_prod_cfc(q->diff_vec, (float) 1/in1_in0_d, q->diff_vec, len);
if (start) { if (start) {
srslte_vec_sum_ccc(start, q->diff_vec, between, len); srslte_vec_sum_ccc(start, q->diff_vec, between, len);
} else { } else {

Loading…
Cancel
Save