Commit 6df0e462 authored by lukashov's avatar lukashov

Fixed bug in lte_ue_measurements.c for subband pmi calculation

parent 55c1f581
...@@ -614,6 +614,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -614,6 +614,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
// For each RE in subband perform ch0 * conj(ch1) // For each RE in subband perform ch0 * conj(ch1)
// multiply by conjugated channel // multiply by conjugated channel
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]);
mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[0],_MM_SHUFFLE(2,3,0,1));//_MM_SHUFFLE(2,3,0,1) mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[0],_MM_SHUFFLE(2,3,0,1));//_MM_SHUFFLE(2,3,0,1)
mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1)); mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1));
mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate[0]); mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate[0]);
......
...@@ -5786,7 +5786,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb) ...@@ -5786,7 +5786,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
int i, aarx; int i, aarx;
uint16_t pmiq=0; uint16_t pmiq=0;
uint32_t pmivect = 0; // work with tyoe uint32_t pmivect = 0;
uint8_t rank = meas->rank[eNB_id]; uint8_t rank = meas->rank[eNB_id];
int pmi_re,pmi_im; int pmi_re,pmi_im;
int nb_subbands=0; int nb_subbands=0;
...@@ -5841,11 +5841,12 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb) ...@@ -5841,11 +5841,12 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
pmi_re += meas->subband_pmi_re[eNB_id][i][aarx]; pmi_re += meas->subband_pmi_re[eNB_id][i][aarx];
pmi_im += meas->subband_pmi_im[eNB_id][i][aarx]; pmi_im += meas->subband_pmi_im[eNB_id][i][aarx];
} }
if (pmi_re > pmi_im) if (pmi_re >= pmi_im)
pmiq = PMI_2A_R1_11; pmiq = PMI_2A_R1_11;
else //if (pmi_re < pmi_im) else //if (pmi_re < pmi_im)
pmiq = PMI_2A_R1_1j; pmiq = PMI_2A_R1_1j;
printf("subband %d, pmi_re %d, pmi_in %d, pmiq %d \n",i,pmi_re,pmi_im,pmiq); // printf("subband %d, pmi_re %d, pmi_im %d, pmiq %d \n",i,pmi_re,pmi_im,pmiq);
// printf("subband %d, pmi%d \n",i,pmiq);
//According to Section 7.2.4 of 36.213 //According to Section 7.2.4 of 36.213
pmivect |= ((pmiq-1)<<(i)); //shift 1 since only one bit pmivect |= ((pmiq-1)<<(i)); //shift 1 since only one bit
} }
...@@ -5853,9 +5854,10 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb) ...@@ -5853,9 +5854,10 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
LOG_E(PHY,"PMI feedback for rank>1 not supported!\n"); LOG_E(PHY,"PMI feedback for rank>1 not supported!\n");
pmivect = 0; pmivect = 0;
} }
} }
//printf( "pmivect %d \n", pmivect);
printf("subband %d pmivect %d \n",i, pmivect);
return(pmivect); return(pmivect);
} }
......
...@@ -203,7 +203,10 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -203,7 +203,10 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
frame_parms, frame_parms,
dlsch0_harq->mimo_mode); dlsch0_harq->mimo_mode);
//#ifdef DEBUG_DLSCH_MOD //#ifdef DEBUG_DLSCH_MOD
printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc,*lte_ue_pdsch_vars[eNB_id]->pmi_ext); /* printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
for (rb=0;rb<nb_rb;rb++)
printf("%d",lte_ue_pdsch_vars[eNB_id]->pmi_ext[rb]);
printf("\n");*/
//#endif //#endif
if (rx_type==rx_IC_single_stream) { if (rx_type==rx_IC_single_stream) {
...@@ -4138,11 +4141,13 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -4138,11 +4141,13 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
(symbol*(frame_parms->ofdm_symbol_size))]; (symbol*(frame_parms->ofdm_symbol_size))];
} }
/*
if (mimo_mode <= PUSCH_PRECODING1) if (mimo_mode <= PUSCH_PRECODING1)
*pmi_loc = (pmi>>((prb>>2)<<1))&3; *pmi_loc = (pmi>>((prb>>2)<<1))&3;
else else
*pmi_loc=(pmi>>prb)&1; *pmi_loc=(pmi>>prb)&1;*/
*pmi_loc = get_pmi(frame_parms->N_RB_DL,mimo_mode,pmi,prb);
pmi_loc++; pmi_loc++;
...@@ -4279,12 +4284,13 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, ...@@ -4279,12 +4284,13 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("symbol %d / rb %d: alloc %d skip_half %d (rxF %p, rxF_ext %p) prb_off (%d,%d)\n",symbol,prb,rb_alloc_ind,skip_half,rxF,rxF_ext,prb_off,prb_off2); printf("symbol %d / rb %d: alloc %d skip_half %d (rxF %p, rxF_ext %p) prb_off (%d,%d)\n",symbol,prb,rb_alloc_ind,skip_half,rxF,rxF_ext,prb_off,prb_off2);
#endif #endif
if (mimo_mode <= PUSCH_PRECODING1) /* if (mimo_mode <= PUSCH_PRECODING1)
*pmi_loc = (pmi>>((prb>>2)<<1))&3; *pmi_loc = (pmi>>((prb>>2)<<1))&3;
else else
*pmi_loc=(pmi>>prb)&1; *pmi_loc=(pmi>>prb)&1;
// printf("symbol_mod %d (pilots %d) rb %d, sb %d, pmi %d (pmi_loc %p,rxF %p, ch00 %p, ch01 %p, rxF_ext %p dl_ch0_ext %p dl_ch1_ext %p)\n",symbol_mod,pilots,prb,prb>>2,*pmi_loc,pmi_loc,rxF,dl_ch0, dl_ch1, rxF_ext,dl_ch0_ext,dl_ch1_ext); // printf("symbol_mod %d (pilots %d) rb %d, sb %d, pmi %d (pmi_loc %p,rxF %p, ch00 %p, ch01 %p, rxF_ext %p dl_ch0_ext %p dl_ch1_ext %p)\n",symbol_mod,pilots,prb,prb>>2,*pmi_loc,pmi_loc,rxF,dl_ch0, dl_ch1, rxF_ext,dl_ch0_ext,dl_ch1_ext);
*/
*pmi_loc = get_pmi(frame_parms->N_RB_DL,mimo_mode,pmi,prb);
pmi_loc++; pmi_loc++;
if (prb != (frame_parms->N_RB_DL>>1)) { // This PRB is not around DC if (prb != (frame_parms->N_RB_DL>>1)) { // This PRB is not around DC
......
...@@ -243,6 +243,8 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -243,6 +243,8 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
for (re=first_re; re<last_re; re++) { for (re=first_re; re<last_re; re++) {
// printf("element %d precoder_index for allocation %d\n",re, precoder_index );
if ((skip_dc == 1) && (re==6)) if ((skip_dc == 1) && (re==6))
re_off=re_off - frame_parms->ofdm_symbol_size+1; re_off=re_off - frame_parms->ofdm_symbol_size+1;
...@@ -1268,7 +1270,7 @@ uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb ...@@ -1268,7 +1270,7 @@ uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb
if (mode <= PUSCH_PRECODING1) if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb>>2)<<1))&3); return((pmi_alloc>>((rb>>2)<<1))&3);
else { else {
//printf("Getting pmi for RB %d => %d\n",rb,((pmi_alloc>>(rb>>2))&1)); // printf("Getting pmi for RB %d => %d\n",rb,((pmi_alloc>>(rb>>2))&1));
return((pmi_alloc>>(rb>>2))&1); return((pmi_alloc>>(rb>>2))&1);
} }
break; break;
......
...@@ -1662,7 +1662,7 @@ n(tikz_fname,"w"); ...@@ -1662,7 +1662,7 @@ n(tikz_fname,"w");
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 1; ((DCI2_1_5MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 2;
break; break;
case 25: case 25:
dci_length = sizeof_DCI2_5MHz_2A_TDD_t; dci_length = sizeof_DCI2_5MHz_2A_TDD_t;
...@@ -1697,7 +1697,7 @@ n(tikz_fname,"w"); ...@@ -1697,7 +1697,7 @@ n(tikz_fname,"w");
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 1; ((DCI2_10MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 2;
break; break;
case 100: case 100:
...@@ -1713,7 +1713,7 @@ n(tikz_fname,"w"); ...@@ -1713,7 +1713,7 @@ n(tikz_fname,"w");
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi2 = 1;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv2 = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tb_swap = 0;
((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 1; ((DCI2_20MHz_2A_TDD_t *)&DLSCH_alloc_pdu_1[k])->tpmi = 2;
dci_length = sizeof_DCI2_20MHz_2A_TDD_t; dci_length = sizeof_DCI2_20MHz_2A_TDD_t;
dci_length_bytes = sizeof(DCI2_20MHz_2A_TDD_t); dci_length_bytes = sizeof(DCI2_20MHz_2A_TDD_t);
break; break;
......
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