Commit 176d8730 authored by Ahmed Hussein's avatar Ahmed Hussein Committed by Thomas Schlichter

Shifting the QAM threshold by AMP, instead of shifting the data by AMP_SHIFT

This fixes the errors in bits introduced after LDPC decoding in case of mod_order = 6 and AMO_SHIFT = 9
parent 63a2e611
......@@ -4,7 +4,6 @@
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
void nr_ulsch_extract_rbs_single(int **rxdataF,
int **rxdataF_ext,
uint32_t rxdataF_ext_offset,
......@@ -35,9 +34,8 @@ void nr_ulsch_extract_rbs_single(int **rxdataF,
if ( (is_dmrs_symbol && ((re&1) != frame_parms->nushift)) || (is_dmrs_symbol == 0) ) { // [hna] (re&1) != frame_parms->nushift) assuming only dmrs type 1 and mapping type A
rxF_ext[rxF_ext_index] = (rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)] << 15) >> AMP_SHIFT;
rxF_ext[rxF_ext_index + 1] = (rxF[(((start_re + re)*2) + 1) % (frame_parms->ofdm_symbol_size*2)] << 15) >> AMP_SHIFT;
rxF_ext[rxF_ext_index] = (rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]);
rxF_ext[rxF_ext_index + 1] = (rxF[(((start_re + re)*2) + 1) % (frame_parms->ofdm_symbol_size*2)]);
rxF_ext_index = rxF_ext_index + 2;
}
}
......
......@@ -116,7 +116,7 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
nb_re >>= 2; // length in quad words (4 REs)
nb_re += (len_mod4 == 0 ? 0 : 1);
temp_channel = _mm_set1_epi16((int16_t)((QAM16_n1 * one_over_sqrt_2)>>15));
temp_channel = _mm_set1_epi16((QAM16_n1 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
for (i=0; i<nb_re; i++) {
......@@ -222,9 +222,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
nb_re = nb_re>>2; // length in quad words (4 REs)
nb_re += ((len_mod4 == 0) ? 0 : 1);
temp_channel[0] = _mm_set1_epi16((int16_t)((QAM64_n1 * one_over_sqrt_2)>>15));
temp_channel[1] = _mm_set1_epi16((int16_t)((QAM64_n2 * one_over_sqrt_2)>>15));
temp_channel[0] = _mm_set1_epi16((QAM64_n1 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
temp_channel[1] = _mm_set1_epi16((QAM64_n2 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
for (i=0; i<nb_re; i++) {
......
......@@ -245,7 +245,7 @@
#ifdef BIT8_TX
#define AMP_SHIFT 7
#else
#define AMP_SHIFT 10 // [hna] was 9, but 9 doesn't work in case of mod_order = 6 (problem due to IFFT/FFT)
#define AMP_SHIFT 9
#endif
#define AMP ((1)<<AMP_SHIFT)
......
......@@ -217,8 +217,6 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int UE_id,
nr_ulsch_unscrambling(gNB->pusch_vars[UE_id]->llr, gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->G, 0, Nid_cell, rel15_ul->rnti);
////////////////////////////////////////////////////////////
//----------------------------------------------------------
//--------------------- ULSCH decoding ---------------------
......
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