Commit dc636f2b authored by Xiwen JIANG's avatar Xiwen JIANG

calculate channel level for TM7

parent b6b7bd1c
......@@ -280,8 +280,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
avg,
symbol,
nb_rb);
else
dlsch_channel_level(lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
else if (beamforming_mode==7)
dlsch_channel_level_TM7(lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
frame_parms,
avg,
symbol,
......@@ -2972,6 +2972,76 @@ void dlsch_channel_level_TM56(int **dl_ch_estimates_ext,
#endif
}
//compute average channel_level for TM7
void dlsch_channel_level_TM7(int **dl_bf_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms,
int *avg,
uint8_t symbol,
unsigned short nb_rb)
{
#if defined(__x86_64__)||defined(__i386__)
short rb;
unsigned char aatx,aarx,nre=12,symbol_mod;
__m128i *dl_ch128,avg128D;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
//clear average level
avg128D = _mm_setzero_si128();
// 5 is always a symbol with no pilots for both normal and extended prefix
dl_ch128=(__m128i *)&dl_bf_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) {
// printf("rb %d : ",rb);
// print_shorts("ch",&dl_ch128[0]);
avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],dl_ch128[0]));
avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],dl_ch128[1]));
if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->mode1_flag==0)) {
dl_ch128+=2;
} else {
avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[2],dl_ch128[2]));
dl_ch128+=3;
}
/*
if (rb==0) {
print_shorts("dl_ch128",&dl_ch128[0]);
print_shorts("dl_ch128",&dl_ch128[1]);
print_shorts("dl_ch128",&dl_ch128[2]);
}
*/
}
if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1))))
nre=10;
else if ((frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12))
nre=9;
else if ((frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==9))
nre=8;
else
nre=12;
avg[(aatx<<1)+aarx] = (((int*)&avg128D)[0] +
((int*)&avg128D)[1] +
((int*)&avg128D)[2] +
((int*)&avg128D)[3])/(nb_rb*nre);
// printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
}
_mm_empty();
_m_empty();
#elif defined(__arm__)
#endif
}
void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp,
......
......@@ -1046,6 +1046,12 @@ void dlsch_channel_level_TM56(int32_t **dl_ch_estimates_ext,
uint8_t symbol_mod,
uint16_t nb_rb);
void dlsch_channel_level_TM7(int32_t **dl_bf_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t *avg,
uint8_t pilots_flag,
uint16_t nb_rb);
void dlsch_scale_channel(int32_t **dl_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_DLSCH_t **dlsch_ue,
......
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