Commit cf4a005e authored by Xiwen JIANG's avatar Xiwen JIANG
Browse files

Beamforming channel estimation based on UE specific reference signal

parent 5adc20ca
...@@ -948,8 +948,8 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS ...@@ -948,8 +948,8 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->rxdataF_uespec_pilots[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * frame_parms->N_RB_DL*12); pdsch->rxdataF_uespec_pilots[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * frame_parms->N_RB_DL*12);
pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_bf_ch_estimates[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_bf_ch_estimates[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * frame_parms->ofdm_symbol_size*7*2);
pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->symbols_per_tti*(frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
......
filter_length = 12; filt_len = 16;
F = -3/4:1/4:7/4; F = -3/4:1/4:7/4;
F_l = zeros(8,12); F_l = zeros(8,filt_len);
F_r = zeros(8,12); F_r = zeros(8,filt_len);
F_m = zeros(8,12); F_m = zeros(8,filt_len);
F2 =-3/5:1/5:8/5; F2 =-3/5:1/5:8/5;
for i=0:3 for i=0:3
F_l(i+1,:) = floor(16384*[F(8+i:-1:4) zeros(1,7-i)]); F_l(i+1,:) = floor(16384*[F(8+i:-1:4) zeros(1,7-i) zeros(1,4)]);
F_r(i+1,:) = floor(16384*[zeros(1,4+i) F(4:end-i)]); F_r(i+1,:) = floor(16384*[zeros(1,4+i) F(4:end-i) zeros(1,4)]);
F_m(i+1,:) = floor(16384*[F(4-i:8) F(7:-1:1+i)]); F_m(i+1,:) = floor(16384*[F(4-i:8) F(7:-1:1+i) zeros(1,4)]);
end end
for i=0:1 for i=0:1
F_l(i+5,:) = floor(16384*[F(8:-1:4-i) zeros(1,7-i)]); F_l(i+5,:) = floor(16384*[F(8:-1:4-i) zeros(1,7-i) zeros(1,4)]);
F_r(i+5,:) = floor(16384*[zeros(1,5+i) F2(5+i) F2(7:end-i)]); F_r(i+5,:) = floor(16384*[zeros(1,5+i) F2(5+i) F2(7:end-i) zeros(1,4)]);
F_m(i+5,:) = floor(16384*[F(4-i:8) F2(8-i) F2(6:-1:1+i)]); F_m(i+5,:) = floor(16384*[F(4-i:8) F2(8-i) F2(6:-1:1+i) zeros(1,4)]);
end end
for i=2:3 for i=2:3
F_l(i+5,:) = floor(16384*[F2(end:-1:7) F2(8-i) zeros(1,5)]); F_l(i+5,:) = floor(16384*[F2(end:-1:7) F2(8-i) zeros(1,5) zeros(1,4)]);
F_r(i+5,:) = floor(16384*[zeros(1,4+i) F(4:end-i)]); F_r(i+5,:) = floor(16384*[zeros(1,4+i) F(4:end-i) zeros(1,4)]);
F_m(i+5,:) = floor(16384*[F2(4-i:6) F2(4+i) F(8:-1:1+i)]); F_m(i+5,:) = floor(16384*[F2(4-i:6) F2(4+i) F(8:-1:1+i) zeros(1,4)]);
end end
fd = fopen("filt12_32.h","w"); fd = fopen("filt16_32.h","w");
for i=0:3 for i=0:3
fprintf(fd,"short filt12_l%d[12] = {\n",i); fprintf(fd,"short filt%d_l%d[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_l(i+1,1:end-1)); fprintf(fd,"%d,",F_l(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_l(i+1,end)); fprintf(fd,"%d};\n\n",F_l(i+1,end));
fprintf(fd,"short filt12_r%d[12] = {\n",i); fprintf(fd,"short filt%d_r%d[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_r(i+1,1:end-1)); fprintf(fd,"%d,",F_r(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_r(i+1,end)); fprintf(fd,"%d};\n\n",F_r(i+1,end));
fprintf(fd,"short filt12_m%d[12] = {\n",i); fprintf(fd,"short filt%d_m%d[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_m(i+1,1:end-1)); fprintf(fd,"%d,",F_m(i+1,1:end-1));
fprintf(fd,"%d};\n\n",F_m(i+1,end)); fprintf(fd,"%d};\n\n",F_m(i+1,end));
end end
for i=0:3 for i=0:3
fprintf(fd,"short filt12_l%d_dc[12] = {\n",i); fprintf(fd,"short filt%d_l%d_dc[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_l(i+5,1:end-1)); fprintf(fd,"%d,",F_l(i+5,1:end-1));
fprintf(fd,"%d};\n\n",F_l(i+5,end)); fprintf(fd,"%d};\n\n",F_l(i+5,end));
fprintf(fd,"short filt12_r%d_dc[12] = {\n",i); fprintf(fd,"short filt%d_r%d_dc[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_r(i+5,1:end-1)); fprintf(fd,"%d,",F_r(i+5,1:end-1));
fprintf(fd,"%d};\n\n",F_r(i+5,end)); fprintf(fd,"%d};\n\n",F_r(i+5,end));
fprintf(fd,"short filt12_m%d_dc[12] = {\n",i); fprintf(fd,"short filt%d_m%d_dc[%d] = {\n",filt_len,i,filt_len);
fprintf(fd,"%d,",F_m(i+5,1:end-1)); fprintf(fd,"%d,",F_m(i+5,1:end-1));
fprintf(fd,"%d};\n\n",F_m(i+5,end)); fprintf(fd,"%d};\n\n",F_m(i+5,end));
end end
......
...@@ -123,7 +123,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -123,7 +123,6 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
uint8_t l, uint8_t l,
uint8_t symbol); uint8_t symbol);
int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
module_id_t eNB_id, module_id_t eNB_id,
uint8_t eNB_offset, uint8_t eNB_offset,
......
...@@ -70,3 +70,17 @@ short filt12_r3_dc[12] = { ...@@ -70,3 +70,17 @@ short filt12_r3_dc[12] = {
short filt12_m3_dc[12] = { short filt12_m3_dc[12] = {
-9831,-6554,-3277,0,3276,6553,9830,16384,12288,8192,4096,0}; -9831,-6554,-3277,0,3276,6553,9830,16384,12288,8192,4096,0};
short filt12_1[12] = {
16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384};
short filt12_2l0[12] = {
16384,12288,8192,4096,-4096,0,0,0,0,0,0,0};
short filt12_2r0[12] = {
0,4096,8192,12288,16384,20480,0,0,0,0,0,0};
short filt12_2l1[12] = {
20480,16384,12288,8192,4096,0,0,0,0,0,0,0};
short filt12_2r1[12] = {
-4096,0,4096,8192,12288,16384,0,0,0,0,0,0};
...@@ -54,6 +54,8 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14] ...@@ -54,6 +54,8 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14]
void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_table[2][20][2][21],uint16_t Nid_cell, uint16_t *n_idDMRS); void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_table[2][20][2][21],uint16_t Nid_cell, uint16_t *n_idDMRS);
void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_t Nid_cell, uint16_t n_rnti);
/*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL UE-specific reference signals for antenna ports 7..14. /*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL UE-specific reference signals for antenna ports 7..14.
@param frame_parms LTE DL Frame parameters @param frame_parms LTE DL Frame parameters
@param lte_gold_uespec_table pointer to table where sequences are stored @param lte_gold_uespec_table pointer to table where sequences are stored
...@@ -96,7 +98,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -96,7 +98,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Ns, uint8_t Ns,
uint8_t lprime, uint8_t lprime,
uint8_t p, uint8_t p,
int SS_flag ); int SS_flag);
/*! \brief This function generates the MBSFN reference signal sequence (36-211, Sec 6.10.1.2) /*! \brief This function generates the MBSFN reference signal sequence (36-211, Sec 6.10.1.2)
@param phy_vars_eNB Pointer to eNB variables @param phy_vars_eNB Pointer to eNB variables
...@@ -130,7 +132,9 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -130,7 +132,9 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
mod_sym_t *output, mod_sym_t *output,
unsigned char Ns, unsigned char Ns,
unsigned char p, unsigned char p,
int SS_flag); int lprime,
int SS_flag,
uint16_t nRB_PDSCH);
int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue, int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue,
int *output, int *output,
......
...@@ -59,12 +59,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -59,12 +59,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Ns, uint8_t Ns,
uint8_t lprime, uint8_t lprime,
uint8_t p, uint8_t p,
int SS_flag ) int SS_flag)
{ {
mod_sym_t qpsk[4],nqpsk[4]; /* mod_sym_t qpsk[4],nqpsk[4];
int16_t k=0,a; int16_t k=0,a;
int mprime,mprime_dword,mprime_qpsk_symb; int mprime,ind,ind_dword,ind_qpsk_symb;
unsigned nushift,kprime; unsigned nushift,kprime;
// LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0]; // LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0];
...@@ -103,12 +103,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -103,12 +103,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
k = kprime+phy_vars_eNB->lte_frame_parms.first_carrier_offset; k = kprime+phy_vars_eNB->lte_frame_parms.first_carrier_offset;
printf("lte_dl_ue_spec:k=%d\n",k); printf("lte_dl_ue_spec:k=%d\n",k);
for (mprime=0;mprime<3*phy_vars_eNB->lte_frame_parms.N_RB_DL-1;mprime++) { for (mprime=0;mprime<3*nRB_PDSCH-1;mprime++) {
mprime_dword = mprime>>4; ind = 3*lprime*nRB_PDSCH+mprime;
mprime_qpsk_symb = mprime&0xf; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
//output[k] = qpsk[(phy_vars_eNB->lte_gold_uespec_port5_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; output[k] = qpsk[(phy_vars_UE->lte_gold_uespec_port5_table[Ns][ind_dword]>>(2*ind_qpsk_symb))&3];
output[k] = 0xffffffff; //output[k] = 0xffffffff;
k += 4; k += 4;
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) { if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) {
...@@ -125,7 +126,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -125,7 +126,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
LOG_E(PHY,"Illegal p %d UE specific pilots\n",p); LOG_E(PHY,"Illegal p %d UE specific pilots\n",p);
} }
return(0); return(0);*/
} }
...@@ -133,11 +134,13 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -133,11 +134,13 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
mod_sym_t *output, mod_sym_t *output,
unsigned char Ns, unsigned char Ns,
unsigned char p, unsigned char p,
int SS_flag) int lprime,
int SS_flag,
uint16_t nRB_PDSCH)
{ {
mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
int16_t a; int16_t a;
int w,lprime,mprime,ind,l,ind_dword,ind_qpsk_symb,nPRB; int w,mprime,ind,l,ind_dword,ind_qpsk_symb,nPRB;
short pamp; short pamp;
// Compute the correct pilot amplitude, sqrt_rho_b = Q3.13 // Compute the correct pilot amplitude, sqrt_rho_b = Q3.13
...@@ -169,7 +172,7 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -169,7 +172,7 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
output_p = output; output_p = output;
for (lprime=0; lprime<2; lprime++) { //for (lprime=0; lprime<2; lprime++) {
ind = 3*lprime*phy_vars_ue->lte_frame_parms.N_RB_DL; ind = 3*lprime*phy_vars_ue->lte_frame_parms.N_RB_DL;
l = lprime + ((Ns&1)<<1); l = lprime + ((Ns&1)<<1);
...@@ -288,25 +291,29 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -288,25 +291,29 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
output_p++; output_p++;
ind++; ind++;
} }
} // }
} else { } else {
LOG_E(PHY,"Special subframe not supported for UE specific pilots yet\n"); LOG_E(PHY,"Special subframe not supported for UE specific pilots yet\n");
} }
} }
} else if (p==5) { } else if (p==5) {
if (SS_flag==0) { if (SS_flag==0) {
if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL) { output_p = output;
for (lprime=0;lprime<2;lprime++) { if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL) {
ind = 3*lprime*phy_vars_ue->lte_frame_parms.N_RB_DL; //for (lprime=0;lprime<4;lprime++) {
for (mprime=0;mprime<3*nRB_PDSCH;mprime++) {
for (mprime=0;mprime<3*phy_vars_ue->lte_frame_parms.N_RB_DL-1;mprime++) { ind = 3*lprime*nRB_PDSCH+mprime;
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_port5_table[Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
*output_p = qpsk[(phy_vars_ue->lte_gold_uespec_port5_table[Ns][ind_dword]>>(2*ind_qpsk_symb))&3];
//printf("lprime=%d,ind=%d,Ns=%d,output_p=(%d,%d)\n",lprime,ind,Ns,((short *)&output_p[0])[0],((short *)&output_p[0])[1]);
*output_p++; *output_p++;
} }
} // }
} }
} }
} else { } else {
......
...@@ -142,7 +142,7 @@ void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_t ...@@ -142,7 +142,7 @@ void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_t
} }
} }
void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][2][21],uint16_t Nid_cell, uint16_t n_rnti) void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_t Nid_cell, uint16_t n_rnti)
{ {
unsigned char ns,l; unsigned char ns,l;
...@@ -151,7 +151,7 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][2][21],uint ...@@ -151,7 +151,7 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][2][21],uint
for (ns=0; ns<20; ns++) { for (ns=0; ns<20; ns++) {
for (l=0; l<2; l++) { //for (l=0; l<2; l++) {
x2 = ((((ns>>1)+1)*((Nid_cell<<1)+1))<<16) + n_rnti; x2 = ((((ns>>1)+1)*((Nid_cell<<1)+1))<<16) + n_rnti;
...@@ -171,16 +171,16 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][2][21],uint ...@@ -171,16 +171,16 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][2][21],uint
// printf("x1 : %x, x2 : %x\n",x1,x2); // printf("x1 : %x, x2 : %x\n",x1,x2);
} }
for (n=0; n<14; n++) { for (n=0; n<38; n++) {
x1 = (x1>>1) ^ (x1>>4); x1 = (x1>>1) ^ (x1>>4);
x1 = x1 ^ (x1<<31) ^ (x1<<28); x1 = x1 ^ (x1<<31) ^ (x1<<28);
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
lte_gold_uespec_port5_table[ns][l][n] = x1^x2; lte_gold_uespec_port5_table[ns][n] = x1^x2;
// printf("n=%d : c %x\n",n,x1^x2); // printf("n=%d : c %x\n",n,x1^x2);
} }
} // }
} }
} }
......
...@@ -246,15 +246,16 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -246,15 +246,16 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
} }
} else if (beamforming_mode==7) { //else n_tx>1 } else if (beamforming_mode==7) { //else n_tx>1
nb_rb = dlsch_extract_rbs_TM7(lte_ue_common_vars->rxdataF, nb_rb = dlsch_extract_rbs_TM7(lte_ue_common_vars->rxdataF,
lte_ue_common_vars->dl_ch_estimates[eNB_id], lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates,
lte_ue_pdsch_vars[eNB_id]->rxdataF_ext, lte_ue_pdsch_vars[eNB_id]->rxdataF_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext, lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
dlsch0_harq->rb_alloc, dlsch0_harq->rb_alloc,
symbol, symbol,
subframe, subframe,
phy_vars_ue->high_speed_flag, phy_vars_ue->high_speed_flag,
frame_parms); frame_parms);
printf("dlsch extract: symbol %d, dl_bf_estimates_ext[0][300] %d \n",symbol, lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext[0][300]);
} else if(beamforming_mode>7) { } else if(beamforming_mode>7) {
LOG_W(PHY,"dlsch_demodulation:beamforming mode not supported yet.\n"); LOG_W(PHY,"dlsch_demodulation:beamforming mode not supported yet.\n");
...@@ -275,11 +276,19 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -275,11 +276,19 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
nb_rb); nb_rb);
*/ */
if (first_symbol_flag==1) { if (first_symbol_flag==1) {
if (beamforming_mode==0)
dlsch_channel_level(lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext, dlsch_channel_level(lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
frame_parms, frame_parms,
avg, avg,
symbol, symbol,
nb_rb); nb_rb);
else
dlsch_channel_level(lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
frame_parms,
avg,
symbol,
nb_rb);
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_D(PHY,"[DLSCH] avg[0] %d\n",avg[0]); LOG_D(PHY,"[DLSCH] avg[0] %d\n",avg[0]);
#endif #endif
...@@ -329,6 +338,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -329,6 +338,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
aarx = frame_parms->nb_antennas_rx; aarx = frame_parms->nb_antennas_rx;
if (dlsch0_harq->mimo_mode<LARGE_CDD) {// SISO or ALAMOUTI if (dlsch0_harq->mimo_mode<LARGE_CDD) {// SISO or ALAMOUTI
printf("dlsch compensation: symbol %d, dl_estimates_ext[0][300] %d \n",symbol, *(short*)&lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][300]);
printf("dlsch compensation: symbol %d, dl_estimates_ext[0][2400] %d \n",symbol, lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][2400]);
dlsch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext, dlsch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext, lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
...@@ -546,9 +557,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -546,9 +557,11 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
1); 1);
} }
} else if (dlsch0_harq->mimo_mode==TM7) { //TM7 } else if (dlsch0_harq->mimo_mode==TM7) { //TM7
printf("dlsch compensation: symbol %d, dl_bf_estimates_ext[0][300] %d \n",symbol, *(short*)&lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext[0][300]);
printf("dlsch compensation: symbol %d, dl_bf_estimates_ext[0][2400] %d \n",symbol, lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext[0][2400]);
dlsch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext, dlsch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext, lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0, lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0,
lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0, lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0, lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
...@@ -558,6 +571,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -558,6 +571,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
first_symbol_flag, first_symbol_flag,
get_Qm(dlsch0_harq->mcs), get_Qm(dlsch0_harq->mcs),
nb_rb, nb_rb,
//9,
lte_ue_pdsch_vars[eNB_id]->log2_maxh, lte_ue_pdsch_vars[eNB_id]->log2_maxh,
phy_measurements); // log2_maxh+I0_shift phy_measurements); // log2_maxh+I0_shift
} }
...@@ -4209,9 +4223,9 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -4209,9 +4223,9 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
} }
unsigned short dlsch_extract_rbs_TM7(int **rxdataF, unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
int **dl_ch_estimates, int **dl_bf_ch_estimates,
int **rxdataF_ext, int **rxdataF_ext,
int **dl_ch_estimates_ext, int **dl_bf_ch_estimates_ext,
unsigned int *rb_alloc, unsigned int *rb_alloc,
unsigned char symbol, unsigned char symbol,
unsigned char subframe, unsigned char subframe,
...@@ -4240,7 +4254,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4240,7 +4254,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
uespec_pilots = 1; uespec_pilots = 1;
} }
if (frame_parms->frame_type == TDD) { // TDD if (frame_parms->frame_type == TDD) {// TDD
sss_symb = nsymb-1; sss_symb = nsymb-1;
pss_symb = 2; pss_symb = 2;
} else { } else {
...@@ -4257,15 +4271,17 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4257,15 +4271,17 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (high_speed_flag == 1) if (high_speed_flag == 1)
dl_ch0 = &dl_ch_estimates[aarx][5+(symbol*(frame_parms->ofdm_symbol_size))]; //dl_ch0 = &dl_bf_ch_estimates[aarx][5+(symbol*(frame_parms->ofdm_symbol_size))];
dl_ch0 = &dl_bf_ch_estimates[aarx][symbol*(frame_parms->ofdm_symbol_size)];
else else
dl_ch0 = &dl_ch_estimates[aarx][5]; //dl_ch0 = &dl_bf_ch_estimates[aarx][5];
dl_ch0 = &dl_bf_ch_estimates[aarx][0];
dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*(frame_parms->N_RB_DL*12)]; dl_ch0_ext = &dl_bf_ch_estimates_ext[aarx][symbol*(frame_parms->N_RB_DL*12)];
rxF_ext = &rxdataF_ext[aarx][symbol*(frame_parms->N_RB_DL*12)]; rxF_ext = &rxdataF_ext[aarx][symbol*(frame_parms->N_RB_DL*12)];
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))]; rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
printf("symbol:%d, (symbol-1)/3:%d\n",symbol,(symbol-1)/3); //printf("symbol:%d, (symbol-1)/3:%d\n",symbol,(symbol-1)/3);
//rxF_uespec = &rxdataF_uespec_pilots[aarx][(symbol-1)/3*frame_parms->N_RB_DL*(3+frame_parms->Ncp)]; //rxF_uespec = &rxdataF_uespec_pilots[aarx][(symbol-1)/3*frame_parms->N_RB_DL*(3+frame_parms->Ncp)];
//printf("symbol, rxF_uespec offset:%d\n",symbol,(symbol-1)/3*frame_parms->N_RB_DL*(3+frame_parms->Ncp)); //printf("symbol, rxF_uespec offset:%d\n",symbol,(symbol-1)/3*frame_parms->N_RB_DL*(3+frame_parms->Ncp));
...@@ -4291,7 +4307,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4291,7 +4307,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
//*pmi_ext = (pmi>>((rb>>2)<<1))&3; //*pmi_ext = (pmi>>((rb>>2)<<1))&3;
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int)); //memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
/* /*
printf("rb %d\n",rb); printf("rb %d\n",rb);
...@@ -4300,11 +4316,10 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4300,11 +4316,10 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
printf("\n"); printf("\n");
*/ */
if (pilots==0 && uespec_pilots==0) { if (pilots==0 && uespec_pilots==0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
for (i=0; i<12; i++) { for (i=0; i<12; i++) {
rxF_ext[i]=rxF[i]; rxF_ext[i]=rxF[i];
/*
printf("%d : (%d,%d)\n",(rxF+i-&rxdataF[aarx][( (symbol*(frame_parms->ofdm_symbol_size)))]),
((short*)&rxF[i])[0],((short*)&rxF[i])[1]);*/
} }