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 @@ ...@@ -4,7 +4,6 @@
#include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" #include "PHY/NR_TRANSPORT/nr_sch_dmrs.h"
void nr_ulsch_extract_rbs_single(int **rxdataF, void nr_ulsch_extract_rbs_single(int **rxdataF,
int **rxdataF_ext, int **rxdataF_ext,
uint32_t rxdataF_ext_offset, uint32_t rxdataF_ext_offset,
...@@ -35,9 +34,8 @@ void nr_ulsch_extract_rbs_single(int **rxdataF, ...@@ -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 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] = (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)] << 15) >> AMP_SHIFT; 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; rxF_ext_index = rxF_ext_index + 2;
} }
} }
......
...@@ -116,8 +116,8 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, ...@@ -116,8 +116,8 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
nb_re >>= 2; // length in quad words (4 REs) nb_re >>= 2; // length in quad words (4 REs)
nb_re += (len_mod4 == 0 ? 0 : 1); 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++) { for (i=0; i<nb_re; i++) {
#if defined(__x86_64__) || defined(__i386) #if defined(__x86_64__) || defined(__i386)
...@@ -222,9 +222,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -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 = nb_re>>2; // length in quad words (4 REs)
nb_re += ((len_mod4 == 0) ? 0 : 1); nb_re += ((len_mod4 == 0) ? 0 : 1);
temp_channel[0] = _mm_set1_epi16((QAM64_n1 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
temp_channel[0] = _mm_set1_epi16((int16_t)((QAM64_n1 * one_over_sqrt_2)>>15)); temp_channel[1] = _mm_set1_epi16((QAM64_n2 * one_over_sqrt_2)>>(2*15-AMP_SHIFT));
temp_channel[1] = _mm_set1_epi16((int16_t)((QAM64_n2 * one_over_sqrt_2)>>15));
for (i=0; i<nb_re; i++) { for (i=0; i<nb_re; i++) {
...@@ -362,4 +361,4 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp, ...@@ -362,4 +361,4 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
LOG_E(PHY,"nr_ulsch_compute_llr: invalid Qm value, symbol = %d, Qm = %d\n",symbol, mod_order); LOG_E(PHY,"nr_ulsch_compute_llr: invalid Qm value, symbol = %d, Qm = %d\n",symbol, mod_order);
break; break;
} }
} }
\ No newline at end of file
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
#ifdef BIT8_TX #ifdef BIT8_TX
#define AMP_SHIFT 7 #define AMP_SHIFT 7
#else #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 #endif
#define AMP ((1)<<AMP_SHIFT) #define AMP ((1)<<AMP_SHIFT)
......
...@@ -216,8 +216,6 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int UE_id, ...@@ -216,8 +216,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); 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);
////////////////////////////////////////////////////////////
//---------------------------------------------------------- //----------------------------------------------------------
......
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