Commit 459913de authored by Elena Lukashova's avatar Elena Lukashova

changes are mostly related to:

1. Introducing dlsch_16qam_llr_SIC.
2. New writing files format in file_output.c
3. Some comments addded.
parent f5c798e4
......@@ -1127,15 +1127,16 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
}
const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
for (k=0;k<8;k++) { //harq_pid
for (l=0;l<8;l++) { //round
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// ue_pdsch_vars[eNB_id]->clean_x1[k][l] = (int16_t*)malloc16_clear( sizeof(int32_t) * num);
for (int i=0; i<frame_parms->nb_antennas_rx; i++)
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
}
......
......@@ -5897,7 +5897,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
pmi_im += meas->subband_pmi_im[eNB_id][i][aarx];
//printf("meas->subband_pmi_im[eNB_id][i][%d]=%d\n",aarx, meas->subband_pmi_im[eNB_id][i][aarx]);
}
if (((pmi_re >= pmi_im) && (pmi_re >= -pmi_im)) || ((pmi_re >= pmi_im) && (pmi_re <= -pmi_im)))
if (((pmi_re >= pmi_im) && (pmi_re >= -pmi_im)) || ((pmi_re <= pmi_im) && (pmi_re >= -pmi_im)))
pmiq = PMI_2A_R1_11;
else
pmiq = PMI_2A_R1_1j;
......
......@@ -299,7 +299,7 @@ int dlsch_encoding(unsigned char *a,
printf("\n");
*/
// Add 24-bit crc (polynomial A) to payload
crc = crc24a(a,
crc = crc24a(a, //input bits for computation, A is a size of a
A)>>8;
a[A>>3] = ((uint8_t*)&crc)[2];
a[1+(A>>3)] = ((uint8_t*)&crc)[1];
......@@ -310,15 +310,15 @@ int dlsch_encoding(unsigned char *a,
// dlsch->harq_processes[harq_pid]->b = a;
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b,
dlsch->harq_processes[harq_pid]->c,
dlsch->harq_processes[harq_pid]->B,
&dlsch->harq_processes[harq_pid]->C,
&dlsch->harq_processes[harq_pid]->Cplus,
&dlsch->harq_processes[harq_pid]->Cminus,
&dlsch->harq_processes[harq_pid]->Kplus,
&dlsch->harq_processes[harq_pid]->Kminus,
&dlsch->harq_processes[harq_pid]->F)<0)
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b, // bits after CRC attachement
dlsch->harq_processes[harq_pid]->c, // output from segmentation
dlsch->harq_processes[harq_pid]->B, //size of B=L+A
&dlsch->harq_processes[harq_pid]->C, //number of codeblocks
&dlsch->harq_processes[harq_pid]->Cplus, //Number of segments of size K+
&dlsch->harq_processes[harq_pid]->Cminus,//Number of segments of size K_
&dlsch->harq_processes[harq_pid]->Kplus, //First segmentation size
&dlsch->harq_processes[harq_pid]->Kminus, //Second segmentation size
&dlsch->harq_processes[harq_pid]->F)<0) //Number of filler bits
return(-1);
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
......@@ -399,7 +399,7 @@ int dlsch_encoding(unsigned char *a,
r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r],
G, //G
dlsch->harq_processes[harq_pid]->w[r],
dlsch->harq_processes[harq_pid]->e+r_offset,
dlsch->harq_processes[harq_pid]->e+r_offset, // sequence of bits for transmission
dlsch->harq_processes[harq_pid]->C, // C
dlsch->Nsoft, // Nsoft,
dlsch->Mdlharq,
......
......@@ -58,8 +58,8 @@
//#define DEBUG_DLSCH_DEMOD 1
int avg[4];
int avg_0[4];
int avg_1[4];
int avg_0[2];
int avg_1[2];
// [MCS][i_mod (0,1,2) = (2,4,6)]
unsigned char offset_mumimo_llr_drange_fix=0;
......@@ -329,9 +329,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2) + interf_unaw_shift_tm1_mcs[dlsch0_harq->mcs];
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2); //+ interf_unaw_shift_tm1_mcs[dlsch0_harq->mcs];
// printf("TM4 I-A log2_maxh0 = %d\n", lte_ue_pdsch_vars[eNB_id]->log2_maxh);
}
......@@ -349,9 +348,9 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
lte_ue_pdsch_vars[eNB_id]->log2_maxh,
phy_measurements); // log2_maxh+I0_shift
if (symbol == 5) {
/*if (symbol == 5) {
write_output("rxF_comp_d.m","rxF_c_d",&lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
}
} */
if ((rx_type==rx_IC_single_stream) &&
(eNB_id_i<phy_vars_ue->n_connected_eNB)) {
......@@ -415,6 +414,10 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
dlsch0_harq->mimo_mode);
// write_output("dlsch0_r0_aver_chan_1.m","dl_aver_ch1_r0_0",&avg_1[0],1,1,2);
if (rx_type>rx_standard) {
// Shifts are needed to avoid tails in SNR/BLER curves.
// LUT will be introduced with mcs-dependent shift
......@@ -2961,7 +2964,7 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp0 =lte_ue_pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 =lte_ue_pdsch_vars->rxdataF_comp1[harq_pid][round];
int **dl_ch_rho_ext =lte_ue_pdsch_vars->dl_ch_rho_ext[harq_pid][round]; //for first stream
int **dl_ch_rho_ext =lte_ue_pdsch_vars->dl_ch_rho_ext[harq_pid][round]; //for second stream
int **dl_ch_rho2_ext =lte_ue_pdsch_vars->dl_ch_rho2_ext;
int **dl_ch_mag0 = lte_ue_pdsch_vars->dl_ch_mag0;
int **dl_ch_mag1 = lte_ue_pdsch_vars->dl_ch_mag1;
......@@ -2990,8 +2993,8 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
} }
// if (rho) {
rho128_0 = (__m128i *) &dl_ch_rho_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_1 = (__m128i *) &dl_ch_rho_ext[1][symbol*frame_parms->N_RB_DL*12];
rho128_0 = (__m128i *) &dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_1 = (__m128i *) &dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12];
for (i=0;i<nb_rb*3;i++) {
// print_shorts("mrc rho0:",&rho128_0[i]);
// print_shorts("mrc rho1:",&rho128_1[i]);
......@@ -3001,8 +3004,8 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
if (dual_stream_UE == 1) {
rho128_i0 = (__m128i *) &dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_i1 = (__m128i *) &dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12];
rho128_i0 = (__m128i *) &dl_ch_rho_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_i1 = (__m128i *) &dl_ch_rho_ext[1][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_i0 = (__m128i *)&rxdataF_comp1[0][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_i1 = (__m128i *)&rxdataF_comp1[1][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128_i0 = (__m128i *)&dl_ch_mag1[0][symbol*frame_parms->N_RB_DL*12];
......@@ -3056,6 +3059,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
// printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
......@@ -3313,15 +3317,16 @@ void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
prec2A_TM4_128(pmi_ext[rb],&dl_ch0_128_tmp,&dl_ch1_128_tmp);
// mmtmpD2 = _mm_madd_epi16(dl_ch0_128_tmp,dl_ch0_128_tmp);
avg_0_128D = _mm_add_epi32(avg_0_128D,_mm_madd_epi16(dl_ch0_128_tmp,dl_ch0_128_tmp));
avg_1_128D = _mm_add_epi32(avg_1_128D,_mm_madd_epi16(dl_ch1_128_tmp,dl_ch1_128_tmp));
avg_0_128D = _mm_add_epi32(avg_0_128D,_mm_madd_epi16(dl_ch0_128_tmp,dl_ch0_128_tmp));
dl_ch0_128+=3;
dl_ch1_128+=3;
}
}
avg_0[aarx] = (((int*)&avg_0_128D)[0])/(nb_rb*nre) +
(((int*)&avg_0_128D)[1])/(nb_rb*nre) +
(((int*)&avg_0_128D)[2])/(nb_rb*nre) +
......@@ -3339,8 +3344,10 @@ void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
//avg_0[0]= max(avg_0[0], avg_1[0]);
avg_0[0] = avg_0[0] + avg_0[1];
// printf("From Chan_level aver stream 0 final =%d\n", avg_0[0]);
avg_1[0] = avg_1[0] + avg_1[1];
avg_0[0] = max (avg_0[0], avg_1[0]);
// printf("From Chan_level aver stream 1 final =%d\n", avg_1[0]);
avg_0[0] = min (avg_0[0], avg_1[0]);
avg_1[0] = avg_0[0];
_mm_empty();
......@@ -4735,6 +4742,10 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1);
// sprintf(fname,"dlsch%d_r%d_aver_chan_1.m",eNB_id,round);
// sprintf(vname,"dl_aver_ch1_r%d_%d",eNB_id,round);
// write_output(fname,vname,&avg_1[0],1,1,1);
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
......
......@@ -672,7 +672,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
//printf("ll32p=%p , dlsch_llr=%p, symbol=%d, flag=%d \n", llr32, dlsch_llr, symbol, first_symbol_flag);
for (i=0; i<len; i++) {
*llr32 = *rxF;
// printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
......@@ -686,13 +686,14 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
}
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp,
mod_sym_t **sic_buffer,
int **rho_i,
int32_t **rxdataF_comp,
mod_sym_t **sic_buffer, //Q15
int32_t **rho_i,
short *dlsch_llr,
uint8_t num_pdcch_symbols,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
uint8_t subframe,
uint32_t rb_alloc,
LTE_UE_DLSCH_t *dlsch0)
{
......@@ -706,12 +707,13 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
//uint8_t pilots;
int len_acc=0;
uint16_t *sic_data;
uint16_t pbch_pss_sss_adjust;
nsymb = (frame_parms->Ncp==0) ? 14:12;
for (symbol=num_pdcch_symbols; symbol<nsymb; symbol++) {
uint16_t *rxF = (uint16_t*)&rxdataF_comp[0][((int16_t)symbol*frame_parms->N_RB_DL*12)];
int16_t *rho_1=(int16_t*)&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)];
uint16_t *rxF = (uint16_t*)(&rxdataF_comp[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
int16_t *rho_1=(int16_t*)(&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
sic_data = (uint16_t*)&sic_buffer[0][((int16_t)len_acc)];
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
......@@ -721,6 +723,8 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
else //pilots=0
amp_tmp=dlsch0->sqrt_rho_a;
pbch_pss_sss_adjust=adjust_G2(frame_parms,rb_alloc,2,subframe,symbol);
// printf("amp_tmp=%d\n", amp_tmp);
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
......@@ -732,43 +736,60 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
len = (nb_rb*12) - pbch_pss_sss_adjust;
}
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
len_acc+=len; //accumulated length; this is done because in sic_buffer we have only data symbols
multadd_complex_vector_real_scalar((int16_t *)sic_data,
amp_tmp,
(int16_t *)rho_amp_x0,
(int16_t *)rho_amp_x0, //this is in Q13
1,
len);
// printf ("Got x0*rho_a\n");
mult_cpx_vector((int16_t *)rho_amp_x0,
(int16_t *)rho_1,
mult_cpx_vector((int16_t *)rho_1, //Q15
(int16_t *)rho_amp_x0, //Q13
(int16_t*)rho_rho_amp_x0,
len,
15);
13);
/* write_output("rho_for_multipl.m","rho_for_multipl", rho_1,len,1,
symbol==num_pdcch_symbols ? 15 :
symbol==nsymb-1 ? 14 : 13);
// write_output("rho_rho.m","rho2", rho_rho_amp_x0,len,1,1);
// printf ("Computed rho*rho_a*x0\n");
write_output("rho_rho_in_llr.m","rho2", rho_rho_amp_x0,len,1,
symbol==num_pdcch_symbols ? 15 :
symbol==nsymb-1 ? 14 : 13);
// printf ("Computed rho*rho_a*x0\n");*/
//rho_rho_amp_x0_512 = (int16_t)((512*(int16_t *)rho_rho_amp_x0)>>15);
sub_cpx_vector16((int16_t *)rxF,
(int16_t *)rho_rho_amp_x0,
// (int16_t *)clean_x1,
(int16_t *)rxF,
(int16_t *)clean_x1,
//(int16_t *)rxF,
len*2);
// write_output("rxFdata_comp1_after.m","rxF_a", rxF,len,1,1);
// write_output("clean_x1.m","x1", clean_x1,len,1,1);
// printf ("Interference removed \n");
/* write_output("clean_x1.m","x1", clean_x1,len,1,
symbol==num_pdcch_symbols ? 15 :
symbol==nsymb-1 ? 14 : 13);
write_output("rxF_comp1.m","rxF_1_comp", rxF,len,1,
symbol==num_pdcch_symbols ? 15 :
symbol==nsymb-1 ? 14 : 13);*/
// printf("dlsch_qpsk_llr_SIC: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
//this is for QPSK only!!!
for (i=0; i<len*2; i++) {
*llr16 =rxF[i];
*llr16 =clean_x1[i];//(int16_t *)rxF[i]; //clean_x1[i];//(int16_t *)rxF[i];//clean_x1[i]; //(int16_t *)rxF[i];//; //rxF[i];
//printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
llr16++;
}
......@@ -849,10 +870,13 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
else
*llr32p += (len<<2);
// printf("len=%d\n", len);
len_mod4 = len&3;
// printf("len_mod4=%d\n", len_mod4);
len>>=2; // length in quad words (4 REs)
// printf("len>>=2=%d\n", len);
len+=(len_mod4==0 ? 0 : 1);
// printf("len+=%d\n", len);
for (i=0; i<len; i++) {
#if defined(__x86_64__) || defined(__i386)
......@@ -905,68 +929,73 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
mod_sym_t **sic_buffer, //Q15
int32_t **rho_i,
int16_t *dlsch_llr,
uint8_t num_pdcch_symbols,
int32_t **dl_ch_mag,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
int16_t **llr32p)
uint8_t subframe,
uint32_t rb_alloc,
LTE_UE_DLSCH_t *dlsch0
)
{
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
__m128i *ch_mag;
int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12];
int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12];
int16_t clean_x1[2*frame_parms->N_RB_DL*12];
uint16_t amp_tmp;
uint32_t *llr32=(uint32_t*)dlsch_llr;
int i, len, nsymb;
uint8_t symbol, symbol_mod;
//uint8_t pilots;
int len_acc=0;
uint16_t *sic_data;
uint16_t pbch_pss_sss_adjust;
unsigned char len_mod4=0;
__m128i llr128[2];
uint32_t *llr32;
#elif defined(__arm__)
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
int16x8_t *ch_mag;
int16x8_t xmm0;
int16_t *llr16;
#endif
int i,len;
unsigned char symbol_mod,len_mod4=0;
__m128i *ch_mag;
nsymb = (frame_parms->Ncp==0) ? 14:12;
#if defined(__x86_64__) || defined(__i386__)
if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr;
} else {
llr32 = (uint32_t*)*llr32p;
}
#elif defined(__arm__)
if (first_symbol_flag==1) {
llr16 = (int16_t*)dlsch_llr;
} else {
llr16 = (int16_t*)*llr32p;
}
#endif
for (symbol=num_pdcch_symbols; symbol<nsymb; symbol++) {
uint16_t *rxF = (uint16_t*)(&rxdataF_comp[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
int16_t *rho_1=(int16_t*)(&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
ch_mag = (__m128i*)(&dl_ch_mag[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
sic_data = (uint16_t*)(&sic_buffer[0][((int16_t)len_acc)]);
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
#if defined(__x86_64__) || defined(__i386__)
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
#elif defined(__arm__)
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
#endif
pbch_pss_sss_adjust=adjust_G2(frame_parms,rb_alloc,4,subframe,symbol);
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
amp_tmp=dlsch0->sqrt_rho_b;
if (frame_parms->mode1_flag==0)
len = nb_rb*8 - (2*pbch_pss_sss_adjust/3);
else
len = nb_rb*10 - (5*pbch_pss_sss_adjust/6);
} else {
amp_tmp=dlsch0->sqrt_rho_a;
len = nb_rb*12 - pbch_pss_sss_adjust;
}
// update output pointer according to number of REs in this symbol (<<2 because 4 bits per RE)
if (first_symbol_flag == 1)
*llr32p = dlsch_llr + (len<<2);
else
*llr32p += (len<<2);
len_acc+=len;
multadd_complex_vector_real_scalar((int16_t *)sic_data,
amp_tmp,
(int16_t *)rho_amp_x0, //this is in Q13
1,
len);
mult_cpx_vector((int16_t *)rho_1, //Q15
(int16_t *)rho_amp_x0, //Q13
(int16_t*)rho_rho_amp_x0,
len,
13);
sub_cpx_vector16((int16_t *)rxF,
(int16_t *)rho_rho_amp_x0,
(int16_t *)clean_x1,
// (int16_t *)rxF,
len*2);
len_mod4 = len&3;
len>>=2; // length in quad words (4 REs)
len+=(len_mod4==0 ? 0 : 1);
......@@ -974,12 +1003,13 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
for (i=0; i<len; i++) {
#if defined(__x86_64__) || defined(__i386)
xmm0 = _mm_abs_epi16(rxF[i]);
__m128i *x1 = (__m128i*)&clean_x1;
xmm0 = _mm_abs_epi16(x1[i]);
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);
llr128[0] = _mm_unpacklo_epi32(x1[i],xmm0);
llr128[1] = _mm_unpackhi_epi32(x1[i],xmm0);
llr32[0] = _mm_extract_epi32(llr128[0],0); //((uint32_t *)&llr128[0])[0];
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[1];
llr32[2] = _mm_extract_epi32(llr128[0],2); //((uint32_t *)&llr128[0])[2];
......@@ -1020,6 +1050,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
_m_empty();
#endif
}
}
//----------------------------------------------------------------------------------------------
// 64-QAM
......@@ -1388,6 +1419,7 @@ int dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
len = (nb_rb*12) - pbch_pss_sss_adjust;
}
// printf("dlsch_qpsk_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
// printf("qpsk_qpsk: len %d, llr16 %p\n",len,llr16);
qpsk_qpsk((short *)rxF,
(short *)rxF_i,
......
......@@ -803,6 +803,8 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_2_Q15)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_2_Q15)>>15);
// printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index0);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_2_Q15)>>15);
......@@ -1643,6 +1645,7 @@ int dlsch_modulation_SIC(mod_sym_t **sic_buffer,
amp=1; //we do full scale here for SIC
gain_lin_QPSK = (int16_t)((ONE_OVER_SQRT2_Q15));
// printf("gain=%d\n", gain_lin_QPSK);
jj = 0;
i = 0;
......@@ -1663,7 +1666,7 @@ int dlsch_modulation_SIC(mod_sym_t **sic_buffer,
jj = jj + 1;
// printf("%d,%d\n",((int16_t*)&sic_buffer[0][i])[0],((int16_t*)&sic_buffer[0][i])[1]);
// printf("recon %d,%d\n",((int16_t*)&sic_buffer[0][i])[0],((int16_t*)&sic_buffer[0][i])[1]);
i++;
......
......@@ -725,7 +725,8 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
short *dlsch_llr,
uint8_t num_pdcch_symbols,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
uint8_t subframe,
uint32_t rb_alloc,
LTE_UE_DLSCH_t *dlsch0);
void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
......@@ -749,15 +750,17 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
@param nb_rb number of RBs for this allocation
@param pbch_pss_sss_adjust PBCH/PSS/SSS RE adjustment (in REs)
*/
void dlsch_16qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
mod_sym_t **sic_buffer, //Q15
int32_t **rho_i,
int16_t *dlsch_llr,
uint8_t num_pdcch_symbols,
int32_t **dl_ch_mag,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
int16_t **llr128p);
uint8_t subframe,
uint32_t rb_alloc,
LTE_UE_DLSCH_t *dlsch0);
void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
......
......@@ -189,7 +189,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
#endif
start_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
lte_dl_channel_estimation(phy_vars_ue,
eNB_id,
0,
Ns,
aa,
l,
......@@ -197,7 +199,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
stop_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
for (i=0; i<phy_vars_ue->PHY_measurements.n_adj_cells; i++) {
lte_dl_channel_estimation(phy_vars_ue,eNB_id,i+1,
lte_dl_channel_estimation(phy_vars_ue,
eNB_id,
i+1,
Ns,
aa,
l,
......
......@@ -66,10 +66,10 @@ void multadd_complex_vector_real_scalar(int16_t *x,
if (zero_flag == 1)
for (n=0; n<N>>2; n++) {
//print_shorts("x_128[n]=", &x_128[n]);
//print_shorts("alpha_128", &alpha_128);
// print_shorts("x_128[n]=", &x_128[n]);
// print_shorts("alpha_128", &alpha_128);
y_128[n] = mulhi_int16(x_128[n],alpha_128);
//print_shorts("y_128[n]=", &y_128[n]); //Q2.13
// print_shorts("y_128[n]=", &y_128[n]);
}
else
......
......@@ -137,8 +137,8 @@ int mult_cpx_conj_vector(int16_t *x1,
}
int mult_cpx_vector(int16_t *x1,
int16_t *x2,
int mult_cpx_vector(int16_t *x1, //Q15
int16_t *x2,//Q13
int16_t *y,
uint32_t N,
int output_shift)
......@@ -174,26 +174,26 @@ int mult_cpx_vector(int16_t *x1,
//right shift by 13 while p_a * x0 and 15 while
// we compute 4 cpx multiply for each loop
for(i=0; i<(N>>2); i++) {
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&conjug2[0]);
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&