Commit e7acad26 authored by Xiwen JIANG's avatar Xiwen JIANG

bug fix in the receiver for UE spec RS demodulation

parent c03803da
...@@ -233,12 +233,12 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -233,12 +233,12 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15); ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fl,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fl,ch,dl_bf_ch,16);
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15); ch[0] = (short)(((int)pil[2]*rxF[8] - (int)pil[3]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15); ch[1] = (short)(((int)pil[2]*rxF[9] + (int)pil[3]*rxF[8])>>15);
multadd_real_vector_complex_scalar(fm,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fm,ch,dl_bf_ch,16);
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15); ch[0] = (short)(((int)pil[4]*rxF[16] - (int)pil[5]*rxF[17])>>15);
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15); ch[1] = (short)(((int)pil[4]*rxF[17] + (int)pil[5]*rxF[16])>>15);
multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16);
} else { } else {
msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n"); msg("lte_dl_bf_channel_estimation(lte_dl_bf_channel_estimation.c):TM7 beamgforming channel estimation not supported for extented CP\n");
...@@ -251,6 +251,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -251,6 +251,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
nb_rb++; nb_rb++;
} }
pil+=6;
rxF+=24; rxF+=24;
dl_bf_ch+=24; dl_bf_ch+=24;
} }
...@@ -321,7 +322,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -321,7 +322,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
skip_half=2; skip_half=2;
} }
//printf("symbol=%d,pil_offset=%d\ni,rb_alloc_ind=%d,uespec_pilots=%d,beamforming_mode=%d,Ncp=%d,skip_half=%d\n",symbol,pil_offset,rb_alloc_ind,uespec_pilots,beamforming_mode,frame_parms->Ncp,skip_half); //printf("symbol=%d,rb=%d,pil_offset=%d\ni,rb_alloc_ind=%d,uespec_pilots=%d,beamforming_mode=%d,Ncp=%d,skip_half=%d\n",symbol,rb,pil_offset,rb_alloc_ind,uespec_pilots,beamforming_mode,frame_parms->Ncp,skip_half);
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
if (uespec_pilots==1) { if (uespec_pilots==1) {
if (beamforming_mode==7) { if (beamforming_mode==7) {
...@@ -332,42 +333,27 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -332,42 +333,27 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15); ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15); ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(f2l,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(f2l,ch,dl_bf_ch,16);
pil+=2; #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
#endif
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15); ch[0] = (short)(((int)pil[2]*rxF[8] - (int)pil[3]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15); ch[1] = (short)(((int)pil[2]*rxF[9] + (int)pil[3]*rxF[8])>>15);
multadd_real_vector_complex_scalar(f2r,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(f2r,ch,dl_bf_ch,16);
pil+=2; #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[2],pil[3],ch[0],ch[1]);
#endif
} else { } else {
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15); ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15); ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(f1,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(f1,ch,dl_bf_ch,16);
pil+=2;
} }
} else if (skip_half==2) { } else if (skip_half==2) {
if (pil_offset<2) { printf("ERR: skip_half==2 happens in the first half band.\n");
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15);
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15);
multadd_real_vector_complex_scalar(f1,ch,dl_bf_ch,16);
pil+=2;
} else {
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15);
multadd_real_vector_complex_scalar(f2l,ch,dl_bf_ch,16);
pil+=2;
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15); } else { // no need to consider the case skip_half == 2
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15);
multadd_real_vector_complex_scalar(f2r,ch,dl_bf_ch,16);
pil+=2;
}
} else {
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15); ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15); ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
...@@ -375,23 +361,20 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -375,23 +361,20 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]); printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
#endif #endif
pil+=2;
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15); ch[0] = (short)(((int)pil[2]*rxF[8] - (int)pil[3]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15); ch[1] = (short)(((int)pil[2]*rxF[9] + (int)pil[3]*rxF[8])>>15);
multadd_real_vector_complex_scalar(fm,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fm,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[0],pil[1],ch[0],ch[1]); printf("symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[2],pil[3],ch[0],ch[1]);
#endif #endif
pil+=2;
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15); ch[0] = (short)(((int)pil[4]*rxF[16] - (int)pil[5]*rxF[17])>>15);
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15); ch[1] = (short)(((int)pil[4]*rxF[17] + (int)pil[5]*rxF[16])>>15);
multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[8]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[16],rxF[17],pil[0],pil[1],ch[0],ch[1]); printf("symbol=%d,rxF[8]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[16],rxF[17],pil[4],pil[5],ch[0],ch[1]);
#endif #endif
pil+=2;
} }
} else { } else {
...@@ -406,6 +389,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -406,6 +389,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
nb_rb++; nb_rb++;
} }
pil+=6;
rxF+=24; rxF+=24;
dl_bf_ch+=24; dl_bf_ch+=24;
} // first half loop } // first half loop
...@@ -453,59 +437,54 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -453,59 +437,54 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15); ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fl_dc,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fl_dc,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
//printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]); printf("**symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
#endif #endif
pil+=2;;
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15); ch[0] = (short)(((int)pil[2]*rxF[8] - (int)pil[3]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15); ch[1] = (short)(((int)pil[2]*rxF[9] + (int)pil[3]*rxF[8])>>15);
multadd_real_vector_complex_scalar(fm_dc,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fm_dc,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
//printf("symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[0],pil[1],ch[0],ch[1]); printf("**symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[2],pil[3],ch[0],ch[1]);
#endif #endif
pil+=2;;
rxF = (short *)&rxdataF[aarx][symbol*(frame_parms->ofdm_symbol_size)]; rxF = (short *)&rxdataF[aarx][symbol*(frame_parms->ofdm_symbol_size)];
ch[0] = (short)(((int)pil[0]*rxF[6] - (int)pil[1]*rxF[7])>>15); ch[0] = (short)(((int)pil[4]*rxF[6] - (int)pil[5]*rxF[7])>>15);
ch[1] = (short)(((int)pil[0]*rxF[7] + (int)pil[1]*rxF[6])>>15); ch[1] = (short)(((int)pil[4]*rxF[7] + (int)pil[5]*rxF[6])>>15);
multadd_real_vector_complex_scalar(fr_dc,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fr_dc,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
//printf("symbol=%d,rxF[3]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[6],rxF[7],pil[0],pil[1],ch[0],ch[1]); printf("**symbol=%d,rxF[3]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[6],rxF[7],pil[4],pil[5],ch[0],ch[1]);
#endif #endif
pil+=2;;
} else { } else {
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15); ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15); ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(fl_dc,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fl_dc,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
//printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]); printf("**symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
#endif #endif
pil+=2;;
rxF = (short *)&rxdataF[aarx][symbol*(frame_parms->ofdm_symbol_size)]; rxF = (short *)&rxdataF[aarx][symbol*(frame_parms->ofdm_symbol_size)];
ch[0] = (short)(((int)pil[0]*rxF[2] - (int)pil[1]*rxF[3])>>15); ch[0] = (short)(((int)pil[2]*rxF[2] - (int)pil[3]*rxF[3])>>15);
ch[1] = (short)(((int)pil[0]*rxF[3] + (int)pil[1]*rxF[2])>>15); ch[1] = (short)(((int)pil[2]*rxF[3] + (int)pil[3]*rxF[2])>>15);
multadd_real_vector_complex_scalar(fm_dc,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fm_dc,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
//printf("symbol=%d,rxF[1]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[2],rxF[3],pil[0],pil[1],ch[0],ch[1]); printf("**symbol=%d,rxF[1]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[2],rxF[3],pil[2],pil[3],ch[0],ch[1]);
#endif #endif
pil+=2;;
ch[0] = (short)(((int)pil[0]*rxF[10] - (int)pil[1]*rxF[11])>>15); ch[0] = (short)(((int)pil[4]*rxF[10] - (int)pil[5]*rxF[11])>>15);
ch[1] = (short)(((int)pil[0]*rxF[11] + (int)pil[1]*rxF[10])>>15); ch[1] = (short)(((int)pil[4]*rxF[11] + (int)pil[5]*rxF[10])>>15);
multadd_real_vector_complex_scalar(fr_dc,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fr_dc,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
//printf("symbol=%d,rxF[5]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[10],rxF[11],pil[0],pil[1],ch[0],ch[1]); printf("**symbol=%d,rxF[5]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[10],rxF[11],pil[4],pil[5],ch[0],ch[1]);
#endif #endif
pil+=2;;
} }
} // rballoc==1 } // rballoc==1
else { else {
rxF = (short *)&rxdataF[aarx][pil_offset+((symbol*(frame_parms->ofdm_symbol_size)))]; rxF = (short *)&rxdataF[aarx][symbol*(frame_parms->ofdm_symbol_size)];
} }
pil+=6+2*frame_parms->Ncp;
rxF+=14+2*pil_offset; rxF+=14+2*pil_offset;
dl_bf_ch+=24; dl_bf_ch+=24;
rb++; rb++;
...@@ -574,46 +553,31 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -574,46 +553,31 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
if (uespec_pilots==1) { if (uespec_pilots==1) {
if (beamforming_mode==7) { if (beamforming_mode==7) {
if (frame_parms->Ncp==0) { if (frame_parms->Ncp==0) {
if (skip_half==1) { if (skip_half==2) {
if (pil_offset<2) {
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(f2l,ch,dl_bf_ch,16);
pil+=2;
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15);
multadd_real_vector_complex_scalar(f2r,ch,dl_bf_ch,16);
pil+=2;
} else {
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
multadd_real_vector_complex_scalar(f1,ch,dl_bf_ch,16);
pil+=2;
}
} else if (skip_half==2) {
if (pil_offset<2) { if (pil_offset<2) {
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15); ch[0] = (short)(((int)pil[4]*rxF[16] - (int)pil[5]*rxF[17])>>15);
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15); ch[1] = (short)(((int)pil[4]*rxF[17] + (int)pil[5]*rxF[16])>>15);
multadd_real_vector_complex_scalar(f1,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(f1,ch,dl_bf_ch,16);
pil+=2; #ifdef DEBUG_BF_CH
printf("++symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[16],rxF[17],pil[4],pil[5],ch[0],ch[1]);
#endif
} else { } else {
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15); ch[0] = (short)(((int)pil[2]*rxF[8] - (int)pil[3]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15); ch[1] = (short)(((int)pil[2]*rxF[9] + (int)pil[3]*rxF[8])>>15);
multadd_real_vector_complex_scalar(f2l,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(f2l,ch,dl_bf_ch,16);
pil+=2; #ifdef DEBUG_BF_CH
printf("++symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[2],pil[3],ch[0],ch[1]);
#endif
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15); ch[0] = (short)(((int)pil[4]*rxF[16] - (int)pil[5]*rxF[17])>>15);
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15); ch[1] = (short)(((int)pil[4]*rxF[17] + (int)pil[5]*rxF[16])>>15);
multadd_real_vector_complex_scalar(f2r,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(f2r,ch,dl_bf_ch,16);
pil+=2; #ifdef DEBUG_BF_CH
printf("++symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[16],rxF[17],pil[4],pil[5],ch[0],ch[1]);
#endif
} }
} else { } else {
...@@ -624,23 +588,20 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -624,23 +588,20 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]); printf("symbol=%d,rxF[0]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[0],rxF[1],pil[0],pil[1],ch[0],ch[1]);
#endif #endif
pil+=2;
ch[0] = (short)(((int)pil[0]*rxF[8] - (int)pil[1]*rxF[9])>>15); ch[0] = (short)(((int)pil[2]*rxF[8] - (int)pil[3]*rxF[9])>>15);
ch[1] = (short)(((int)pil[0]*rxF[9] + (int)pil[1]*rxF[8])>>15); ch[1] = (short)(((int)pil[2]*rxF[9] + (int)pil[3]*rxF[8])>>15);
multadd_real_vector_complex_scalar(fm,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fm,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[0],pil[1],ch[0],ch[1]); printf("symbol=%d,rxF[4]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[8],rxF[9],pil[2],pil[3],ch[0],ch[1]);
#endif #endif
pil+=2;
ch[0] = (short)(((int)pil[0]*rxF[16] - (int)pil[1]*rxF[17])>>15); ch[0] = (short)(((int)pil[4]*rxF[16] - (int)pil[5]*rxF[17])>>15);
ch[1] = (short)(((int)pil[0]*rxF[17] + (int)pil[1]*rxF[16])>>15); ch[1] = (short)(((int)pil[4]*rxF[17] + (int)pil[5]*rxF[16])>>15);
multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16); multadd_real_vector_complex_scalar(fr,ch,dl_bf_ch,16);
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("symbol=%d,rxF[8]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[16],rxF[17],pil[0],pil[1],ch[0],ch[1]); printf("symbol=%d,rxF[8]=(%d,%d),pil=(%d,%d),ch=(%d,%d)\n",symbol,rxF[16],rxF[17],pil[4],pil[5],ch[0],ch[1]);
#endif #endif
pil+=2;
} }
} else { } else {
...@@ -655,6 +616,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -655,6 +616,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
nb_rb++; nb_rb++;
} }
pil+=6+frame_parms->Ncp*2;
rxF+=24; rxF+=24;
dl_bf_ch+=24; dl_bf_ch+=24;
} // second half of RBs } // second half of RBs
...@@ -669,6 +631,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -669,6 +631,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
#endif #endif
if (phy_vars_ue->high_speed_flag == 0) { if (phy_vars_ue->high_speed_flag == 0) {
//TODO:the time average does not work well for subframe 0 where some resources are allocated to common channels
multadd_complex_vector_real_scalar(dl_bf_ch, multadd_complex_vector_real_scalar(dl_bf_ch,
32767-phy_vars_ue->ch_est_alpha, 32767-phy_vars_ue->ch_est_alpha,
dl_bf_ch-(frame_parms->ofdm_symbol_size<<1),0,frame_parms->ofdm_symbol_size); dl_bf_ch-(frame_parms->ofdm_symbol_size<<1),0,frame_parms->ofdm_symbol_size);
...@@ -742,7 +705,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -742,7 +705,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
} //aarx } //aarx
#ifdef DEBUG_BF_CH #ifdef DEBUG_BF_CH
printf("[dlsch_bf_ch_est.c]: dl_bf_estimates[0][600] %d, %d \n",*(short *)&dl_bf_ch_estimates[0][600],*(short*)&phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0][600]); printf("[dlsch_bf_ch_est.c]: dl_bf_estimates[0][600] %d, %d \n",*(short *)&dl_bf_ch_estimates[0][600],*(short*)&phy_vars_ue->ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0][600]);
#endif #endif
return(0); return(0);
......
...@@ -4639,7 +4639,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4639,7 +4639,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i]; rxF_ext[j]=rxF[i];
dl_ch0_ext[j++]=dl_ch0[i]; dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
#endif #endif
} }
} }
...@@ -4652,7 +4652,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4652,7 +4652,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i]; rxF_ext[j]=rxF[i];
dl_ch0_ext[j++]=dl_ch0[i]; dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
#endif #endif
} }
} }
...@@ -4667,7 +4667,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4667,7 +4667,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[(i+6)]; rxF_ext[j]=rxF[(i+6)];
dl_ch0_ext[j++]=dl_ch0[i+6]; dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
#endif #endif
} }
} }
...@@ -4692,11 +4692,13 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4692,11 +4692,13 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<12; i++){ for (i=0; i<12; i++){
if (frame_parms->Ncp==0){ if (frame_parms->Ncp==0){
if (i!=uespec_nushift+uespec_poffset && i!=uespec_nushift+uespec_poffset+4 && i!=(uespec_nushift+uespec_poffset+8)%12){ if ((i!=uespec_nushift+uespec_poffset) && (i!=uespec_nushift+uespec_poffset+4) && (i!=(uespec_nushift+uespec_poffset+8))%12){
rxF_ext[j] = rxF[i]; rxF_ext[j] = rxF[i];
dl_ch0_ext[j++] = dl_ch0[i]; dl_ch0_ext[j++] = dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d, j %d => (%d,%d)\n",symbol,rb,i,j-1,*(short *)&dl_ch0[j],*(1+(short*)&dl_ch0[i])); printf("uespec_nushift=%d, uespec_poffset=%d\n", uespec_nushift, uespec_poffset);
printf("extract rb %d, re %d rxF => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
printf("extract rb %d, re %d ch => (%d,%d)\n",rb,i,*(short *)&dl_ch0[j-1],*(1+(short*)&dl_ch0[j-1]));
#endif #endif
} }
} else{ } else{
...@@ -4775,7 +4777,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4775,7 +4777,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[i]=dl_ch0[i]; dl_ch0_ext[i]=dl_ch0[i];
rxF_ext[i]=rxF[i]; rxF_ext[i]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
...@@ -4785,13 +4787,13 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4785,13 +4787,13 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[i]=dl_ch0[i]; dl_ch0_ext[i]=dl_ch0[i];
rxF_ext[i]=rxF[(1+i-6)]; rxF_ext[i]=rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
dl_ch0_ext+=12; dl_ch0_ext+=12;
rxF_ext+=12; rxF_ext+=12;
} else if(pilots==1 && uespec_pilots==0){ // pilots==1 } else if(pilots==1 && uespec_pilots==0) { // pilots==1
j=0; j=0;
for (i=0; i<6; i++) { for (i=0; i<6; i++) {
...@@ -4799,7 +4801,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4799,7 +4801,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++]=rxF[i]; rxF_ext[j++]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -4811,7 +4813,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4811,7 +4813,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++]=rxF[(1+i-6)]; rxF_ext[j++]=rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -4827,7 +4829,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4827,7 +4829,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++] = rxF[i]; rxF_ext[j++] = rxF[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} else { } else {
...@@ -4835,7 +4837,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4835,7 +4837,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++] = rxF[i]; rxF_ext[j++] = rxF[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -4849,7 +4851,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4849,7 +4851,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++]=rxF[(1+i-6)]; rxF_ext[j++]=rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} else { } else {
...@@ -4857,7 +4859,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4857,7 +4859,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++] = rxF[(1+i-6)]; rxF_ext[j++] = rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -4959,7 +4961,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4959,7 +4961,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<6; i++) { for (i=0; i<6; i++) {
rxF_ext[i]=rxF[i]; rxF_ext[i]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
...@@ -4972,7 +4974,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4972,7 +4974,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<6; i++) { for (i=0; i<6; i++) {
rxF_ext[i]=rxF[i+6]; rxF_ext[i]=rxF[i+6];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
...@@ -4986,7 +4988,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -4986,7 +4988,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<12; i++) { for (i=0; i<12; i++) {
rxF_ext[i]=rxF[i]; rxF_ext[i]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
...@@ -5003,7 +5005,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -5003,7 +5005,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i]; rxF_ext[j]=rxF[i];
dl_ch0_ext[j++]=dl_ch0[i]; dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -5016,7 +5018,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -5016,7 +5018,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[(i+6)]; rxF_ext[j]=rxF[(i+6)];
dl_ch0_ext[j++]=dl_ch0[i+6]; dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -5076,7 +5078,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -5076,7 +5078,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i+6]; rxF_ext[j]=rxF[i+6];
dl_ch0_ext[j++]=dl_ch0[i+6]; dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -5089,7 +5091,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -5089,7 +5091,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[(i+6)]; rxF_ext[j]=rxF[(i+6)];
dl_ch0_ext[j++]=dl_ch0[i+6]; dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
...@@ -5104,7 +5106,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -5104,7 +5106,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j] = rxF[i]; rxF_ext[j] = rxF[i];
dl_ch0_ext[j++]=dl_ch0[i]; dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} else{ } else{
...@@ -5112,7 +5114,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF, ...@@ -5112,7 +5114,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j] = rxF[i]; rxF_ext[j] = rxF[i];
dl_ch0_ext[j++]=dl_ch0[i]; dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i])); printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif #endif
} }
} }
......
...@@ -16,7 +16,7 @@ int read_calibration_matrix(int32_t **tdd_calib_coeffs, char *calibF_fname, LTE_ ...@@ -16,7 +16,7 @@ int read_calibration_matrix(int32_t **tdd_calib_coeffs, char *calibF_fname, LTE_
if (openair_dir == NULL) { if (openair_dir == NULL) {
printf("ERR: OPENAIR_DIR not defined (did you source oaienv?)\n"); printf("ERR: OPENAIR_DIR not defined (did you source oaienv?)\n");
exit(1); return(1);
} }
sprintf(calibF_file_name, "%s/targets/PROJECTS/TDDREC/result/%s", openair_dir, calibF_fname); sprintf(calibF_file_name, "%s/targets/PROJECTS/TDDREC/result/%s", openair_dir, calibF_fname);
......
...@@ -294,6 +294,8 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne ...@@ -294,6 +294,8 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
int32_t **txdataF = eNB_common_vars->txdataF[eNB_id]; int32_t **txdataF = eNB_common_vars->txdataF[eNB_id];
int32_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id]; int32_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id];
int32_t **txdata = eNB_common_vars->txdata[eNB_id]; int32_t **txdata = eNB_common_vars->txdata[eNB_id];
char txsigF0_BF_fname[20];
char txsF0_BF_value[20];
aa = antenna; aa = antenna;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
...@@ -306,6 +308,10 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne ...@@ -306,6 +308,10 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa); beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
/*sprintf(txsigF0_BF_fname, "txsigF0_BF%d.m",l);
sprintf(txsF0_BF_value, "txsF0_BF%d",l);
write_output(txsigF0_BF_fname, txsF0_BF_value, txdataF_BF[0], frame_parms->ofdm_symbol_size,1,1);*/
//PMCH case not implemented... //PMCH case not implemented...
if (frame_parms->Ncp == 1) if (frame_parms->Ncp == 1)
......
...@@ -70,7 +70,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -70,7 +70,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
uint32_t bcch_pdu; uint32_t bcch_pdu;
uint64_t dlsch_pdu; uint64_t dlsch_pdu;
LOG_I(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode); //LOG_I(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode);
DCI_pdu->Num_common_dci = 0; DCI_pdu->Num_common_dci = 0;
DCI_pdu->Num_ue_spec_dci=0; DCI_pdu->Num_ue_spec_dci=0;
...@@ -282,15 +282,25 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -282,15 +282,25 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} else { } else {
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
harq_pid_value = ( ((proc->frame_tx * 10) + subframe) % 8 );
if (!(subframe&1)) // even subframe
dci_ndi_toggle_tmp = &(dci_ndi_toggle_even[harq_pid_value]);
else // odd subframe
dci_ndi_toggle_tmp = &(dci_ndi_toggle_odd[harq_pid_value]);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3); ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = harq_pid_value; //subframe % 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28); //((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = (*dci_ndi_toggle_tmp);//subframe / 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0;
(*dci_ndi_toggle_tmp) = ((*dci_ndi_toggle_tmp) + 1) & 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
/* /*
......
...@@ -655,11 +655,11 @@ int main(int argc, char **argv) ...@@ -655,11 +655,11 @@ int main(int argc, char **argv)
cell_spec_bf_weights[aa][re] = 0x00007fff>>4; cell_spec_bf_weights[aa][re] = 0x00007fff>>4;
} }
} }
*/
if (transmission_mode==7){ if (transmission_mode==7){
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],Nid_cell,n_rnti); lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],Nid_cell,n_rnti);
lte_gold_ue_spec_port5(UE->lte_gold_uespec_port5_table,Nid_cell,n_rnti); lte_gold_ue_spec_port5(UE->lte_gold_uespec_port5_table,Nid_cell,n_rnti);
}*/ }
eNB_id_i = UE->n_connected_eNB; eNB_id_i = UE->n_connected_eNB;
...@@ -2877,14 +2877,13 @@ PMI_FEEDBACK: ...@@ -2877,14 +2877,13 @@ PMI_FEEDBACK:
aa); aa);
if (n_frames==1) { if (n_frames==1) {
if (transmission_mode<7) write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
else if (transmission_mode==7) if (transmission_mode==7)
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size], write_output("txsigF5.m","txsF5", &eNB->common_vars.txdataF[eNB_id][5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
write_output("txsigF0_BF.m","txsF0_BF", &eNB->common_vars.txdataF_BF[eNB_id][0][0], //write_output("txsigF0_BF.m","txsF0_BF", &eNB->common_vars.txdataF_BF[eNB_id][0][0],
eNB->frame_parms.ofdm_symbol_size,1,1); // eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_tx>1)// to be updated if (eNB->frame_parms.nb_antennas_tx>1)// to be updated
write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size], write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
......
...@@ -1310,7 +1310,8 @@ void init_openair0() { ...@@ -1310,7 +1310,8 @@ void init_openair0() {
} }
if (frame_parms[0]->frame_type==TDD) if (frame_parms[0]->frame_type==TDD)
openair0_cfg[card].duplex_mode = duplex_mode_TDD; //openair0_cfg[card].duplex_mode = duplex_mode_TDD;
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
else //FDD else //FDD
openair0_cfg[card].duplex_mode = duplex_mode_FDD; openair0_cfg[card].duplex_mode = duplex_mode_FDD;
...@@ -1635,7 +1636,8 @@ int main( int argc, char **argv ) ...@@ -1635,7 +1636,8 @@ int main( int argc, char **argv )
for (j=0; j<frame_parms[CC_id]->nb_antennas_tx; j++) for (j=0; j<frame_parms[CC_id]->nb_antennas_tx; j++)
for (re=0; re<frame_parms[CC_id]->ofdm_symbol_size; re++) for (re=0; re<frame_parms[CC_id]->ofdm_symbol_size; re++)
//In softmodem: the power constraint is on each antenna, so we do not norm the beam weights //In softmodem: the power constraint is on each antenna, so we do not norm the beam weights
PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff;///sqrt(frame_parms[CC_id]->nb_antennas_tx); PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff;
//PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff/sqrt(frame_parms[CC_id]->nb_antennas_tx);
} }
if (phy_test==1) PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0; if (phy_test==1) PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
else PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1; else PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment