From eab744f6f990c417e2f5041dccdaeeb524267a69 Mon Sep 17 00:00:00 2001 From: Xiwen JIANG Date: Tue, 22 Nov 2016 14:57:11 +0100 Subject: [PATCH] add in allocate_REs_in_RB the TM7 case --- openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c | 116 +++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index 7914437a53..84e4bddec2 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -619,10 +619,21 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB, int32_t tmp_sample1,tmp_sample2; int16_t tmp_amp=amp; int s=1; + int mprime2 = mprime,ind,ind_dword,ind_qpsk_symb; gain_lin_QPSK = (int16_t)((amp*ONE_OVER_SQRT2_Q15)>>15); // if (mimo_mode == LARGE_CDD) gain_lin_QPSK>>=1; + int32_t qpsk[4]; + ((int16_t *)&qpsk[0])[0] = gain_lin_QPSK; + ((int16_t *)&qpsk[0])[1] = gain_lin_QPSK; + ((int16_t *)&qpsk[1])[0] = -gain_lin_QPSK; + ((int16_t *)&qpsk[1])[1] = gain_lin_QPSK;; + ((int16_t *)&qpsk[2])[0] = gain_lin_QPSK;; + ((int16_t *)&qpsk[2])[1] = -gain_lin_QPSK;; + ((int16_t *)&qpsk[3])[0] = -gain_lin_QPSK;; + ((int16_t *)&qpsk[3])[1] = -gain_lin_QPSK; + if (dlsch1_harq) { x1 = dlsch1_harq->e; // Fill these in later for TM8-10 @@ -1285,8 +1296,111 @@ x0[1+*jj]); *re_allocated = *re_allocated + 1; } } + + if (mimo_mode == TM7) { + *re_allocated = *re_allocated + 1; - if (mimo_mode >= TM8) { //TM8,TM9,TM10 + if (is_not_UEspecRS(lprime,re,frame_parms->Nid_cell%3,frame_parms->Ncp,7)) { + + switch (mod_order0){ + case 2: //QPSK + + ((int16_t*)&txdataF[5][tti_offset])[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; + *jj = *jj + 1; + ((int16_t*)&txdataF[5][tti_offset])[1] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; + *jj = *jj + 1; + + //printf("%d(%d) : %d,%d => + //",tti_offset,*jj,((int16_t*)&tmp_sample1)[0],((int16_t*)&tmp_sample1)[1]); + break; + + case 4: //16QAM + + qam16_table_offset_re = 0; + qam16_table_offset_im = 0; + + if (x0[*jj] == 1) + qam16_table_offset_re+=2; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam16_table_offset_im+=2; + + *jj=*jj+1; + + + if (x0[*jj] == 1) + qam16_table_offset_re+=1; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam16_table_offset_im+=1; + + *jj=*jj+1; + + ((int16_t*)&txdataF[5][tti_offset])[0] = (int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); + ((int16_t*)&txdataF[5][tti_offset])[1] = (int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); + + break; + + case 6: //64QAM + + + qam64_table_offset_re = 0; + qam64_table_offset_im = 0; + + if (x0[*jj] == 1) + qam64_table_offset_re+=4; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam64_table_offset_im+=4; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam64_table_offset_re+=2; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam64_table_offset_im+=2; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam64_table_offset_re+=1; + + *jj=*jj+1; + + if (x0[*jj] == 1) + qam64_table_offset_im+=1; + + *jj=*jj+1; + + ((int16_t*)&txdataF[5][tti_offset])[0] = (int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); + ((int16_t*)&txdataF[5][tti_offset])[1] = (int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); + + break; + + } + } else { + //precoding UE spec RS + //printf("precoding UE spec RS\n"); + + ind = 3*lprime*dlsch0_harq->nb_rb+mprime2; + ind_dword = ind>>4; + ind_qpsk_symb = ind&0xf; + + txdataF[5][tti_offset] = qpsk[(phy_vars_eNB->lte_gold_uespec_port5_table[0][Ns][ind_dword]>>(2*ind_qpsk_symb))&3]; + mprime2++; + + } + + } else if (mimo_mode >= TM8) { //TM8,TM9,TM10 //uint8_t is_not_UEspecRS(int8_t lprime, uint8_t re, uint8_t nushift, uint8_t Ncp, uint8_t beamforming_mode) if (is_not_UEspecRS(lprime,re,frame_parms->nushift,frame_parms->Ncp,8)) {