reduce UE stack size, make a piece of code clear, reduced variables visibility
This commit is contained in:
@@ -1584,7 +1584,6 @@ void NFAPI_NR_DMRS_TYPE2_average_prb(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
c16multaddVectRealComplex(filt8_avlip6, &ch, dl_ch, 8);
|
c16multaddVectRealComplex(filt8_avlip6, &ch, dl_ch, 8);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||||
UE_nr_rxtx_proc_t *proc,
|
UE_nr_rxtx_proc_t *proc,
|
||||||
bool is_SI,
|
bool is_SI,
|
||||||
@@ -1598,7 +1597,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
unsigned short nb_rb_pdsch,
|
unsigned short nb_rb_pdsch,
|
||||||
uint32_t pdsch_est_size,
|
uint32_t pdsch_est_size,
|
||||||
int32_t dl_ch_estimates[][pdsch_est_size],
|
int32_t dl_ch_estimates[][pdsch_est_size],
|
||||||
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
|
int rxdataFsize,
|
||||||
|
c16_t rxdataF[][rxdataFsize])
|
||||||
{
|
{
|
||||||
int gNB_id = proc->gNB_id;
|
int gNB_id = proc->gNB_id;
|
||||||
int Ns = proc->nr_slot_rx;
|
int Ns = proc->nr_slot_rx;
|
||||||
@@ -1732,10 +1732,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
* 3) Compensate signal with PTRS estimation for slot
|
* 3) Compensate signal with PTRS estimation for slot
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||||
|
int nbRx,
|
||||||
c16_t ptrs_phase_per_slot[][14],
|
c16_t ptrs_phase_per_slot[][14],
|
||||||
int32_t ptrs_re_per_slot[][14],
|
int32_t ptrs_re_per_slot[][14],
|
||||||
uint32_t rx_size,
|
uint32_t rx_size_symbol,
|
||||||
int32_t rxdataF_comp[][rx_size],
|
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
NR_DL_FRAME_PARMS *frame_parms,
|
||||||
NR_DL_UE_HARQ_t *dlsch0_harq,
|
NR_DL_UE_HARQ_t *dlsch0_harq,
|
||||||
NR_DL_UE_HARQ_t *dlsch1_harq,
|
NR_DL_UE_HARQ_t *dlsch1_harq,
|
||||||
@@ -1826,8 +1827,9 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
|||||||
nr_ptrs_cpe_estimation(*K_ptrs,*ptrsReOffset,*dmrsConfigType,*nb_rb,
|
nr_ptrs_cpe_estimation(*K_ptrs,*ptrsReOffset,*dmrsConfigType,*nb_rb,
|
||||||
rnti,
|
rnti,
|
||||||
nr_slot_rx,
|
nr_slot_rx,
|
||||||
symbol,frame_parms->ofdm_symbol_size,
|
symbol,
|
||||||
(int16_t*)&rxdataF_comp[aarx][(symbol * nb_re_pdsch)],
|
frame_parms->ofdm_symbol_size,
|
||||||
|
(int16_t *)(rxdataF_comp[0][aarx] + symbol * nb_re_pdsch),
|
||||||
ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
|
ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
|
||||||
(int16_t*)&phase_per_symbol[symbol],
|
(int16_t*)&phase_per_symbol[symbol],
|
||||||
&ptrs_re_symbol[symbol]);
|
&ptrs_re_symbol[symbol]);
|
||||||
@@ -1848,9 +1850,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
|||||||
}
|
}
|
||||||
#ifdef DEBUG_DL_PTRS
|
#ifdef DEBUG_DL_PTRS
|
||||||
LOG_M("ptrsEst.m","est",ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 );
|
LOG_M("ptrsEst.m","est",ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 );
|
||||||
LOG_M("rxdataF_bf_ptrs_comp.m","bf_ptrs_cmp",
|
LOG_M("rxdataF_bf_ptrs_comp.m", "bf_ptrs_cmp", rxdataF_comp[0][aarx] + (*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb), (*nb_rb) * NR_NB_SC_PER_RB * (*nbSymb), 1, 1);
|
||||||
&rxdataF_comp[aarx][(*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb) ],
|
|
||||||
(*nb_rb) * NR_NB_SC_PER_RB * (*nbSymb),1,1);
|
|
||||||
#endif
|
#endif
|
||||||
/*------------------------------------------------------------------------------------------------------- */
|
/*------------------------------------------------------------------------------------------------------- */
|
||||||
/* 3) Compensated DMRS based estimated signal with PTRS estimation */
|
/* 3) Compensated DMRS based estimated signal with PTRS estimation */
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
unsigned short nb_rb_pdsch,
|
unsigned short nb_rb_pdsch,
|
||||||
uint32_t pdsch_est_size,
|
uint32_t pdsch_est_size,
|
||||||
int32_t dl_ch_estimates[][pdsch_est_size],
|
int32_t dl_ch_estimates[][pdsch_est_size],
|
||||||
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
|
int rxdataFsize,
|
||||||
|
c16_t rxdataF[][rxdataFsize]);
|
||||||
|
|
||||||
void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||||
PHY_VARS_NR_UE *ue,
|
PHY_VARS_NR_UE *ue,
|
||||||
@@ -123,10 +124,11 @@ void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue,
|
|||||||
uint8_t gNB_id);
|
uint8_t gNB_id);
|
||||||
|
|
||||||
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||||
|
int nbRx,
|
||||||
c16_t ptrs_phase_per_slot[][14],
|
c16_t ptrs_phase_per_slot[][14],
|
||||||
int32_t ptrs_re_per_slot[][14],
|
int32_t ptrs_re_per_slot[][14],
|
||||||
uint32_t rx_size,
|
uint32_t rx_size_symbol,
|
||||||
int32_t rxdataF_comp[][rx_size],
|
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
NR_DL_FRAME_PARMS *frame_parms,
|
||||||
NR_DL_UE_HARQ_t *dlsch0_harq,
|
NR_DL_UE_HARQ_t *dlsch0_harq,
|
||||||
NR_DL_UE_HARQ_t *dlsch1_harq,
|
NR_DL_UE_HARQ_t *dlsch1_harq,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -794,11 +794,11 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
llr2 = dlsch_llr;
|
llr2 = dlsch_llr;
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
|
ch_mag = (__m128i *)dl_ch_mag;
|
||||||
ch_magb = (__m128i*)&dl_ch_magb[(symbol*nb_rb*12)];
|
ch_magb = (__m128i *)dl_ch_magb;
|
||||||
#elif defined(__arm__) || defined(__aarch64__)
|
#elif defined(__arm__) || defined(__aarch64__)
|
||||||
ch_mag = (int16x8_t*)&dl_ch_mag[(symbol*nb_rb*12)];
|
ch_mag = (int16x8_t *)dl_ch_mag;
|
||||||
ch_magb = (int16x8_t*)&dl_ch_magb[(symbol*nb_rb*12)];
|
ch_magb = (int16x8_t *)dl_ch_magb;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// printf("nr_dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
// printf("nr_dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||||
@@ -931,9 +931,9 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
|
|
||||||
llr2 = dlsch_llr;
|
llr2 = dlsch_llr;
|
||||||
|
|
||||||
ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
|
ch_mag = (__m128i *)dl_ch_mag;
|
||||||
ch_magb = (__m128i*)&dl_ch_magb[(symbol*nb_rb*12)];
|
ch_magb = (__m128i *)dl_ch_magb;
|
||||||
ch_magr = (__m128i*)&dl_ch_magr[(symbol*nb_rb*12)];
|
ch_magr = (__m128i *)dl_ch_magr;
|
||||||
|
|
||||||
len_mod4 =len&3;
|
len_mod4 =len&3;
|
||||||
len2=len>>2; // length in quad words (4 REs)
|
len2=len>>2; // length in quad words (4 REs)
|
||||||
@@ -1018,46 +1018,6 @@ __m128i H __attribute__ ((aligned(16)));
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int nr_dlsch_qpsk_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int **rxdataF_comp,
|
|
||||||
int **rxdataF_comp_i,
|
|
||||||
int **rho_i,
|
|
||||||
short *dlsch_llr,
|
|
||||||
unsigned char symbol,
|
|
||||||
uint32_t len,
|
|
||||||
unsigned char first_symbol_flag,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
short **llr16p)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t *rxF=(int16_t*)&rxdataF_comp[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *rho=(int16_t*)&rho_i[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *llr16;
|
|
||||||
|
|
||||||
if (first_symbol_flag == 1) {
|
|
||||||
llr16 = (int16_t*)dlsch_llr;
|
|
||||||
} else {
|
|
||||||
llr16 = (int16_t*)(*llr16p);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssertFatal(llr16!=NULL,"nr_dlsch_qpsk_qpsk_llr: llr is null, symbol %d\n",symbol);
|
|
||||||
|
|
||||||
// printf("nr_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);
|
|
||||||
nr_qpsk_qpsk((short *)rxF,
|
|
||||||
(short *)rxF_i,
|
|
||||||
(short *)llr16,
|
|
||||||
(short *)rho,
|
|
||||||
len);
|
|
||||||
|
|
||||||
llr16 += (len<<1);
|
|
||||||
*llr16p = (short *)llr16;
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//__m128i ONE_OVER_SQRT_8 __attribute__((aligned(16)));
|
//__m128i ONE_OVER_SQRT_8 __attribute__((aligned(16)));
|
||||||
|
|
||||||
void nr_qpsk_qpsk(short *stream0_in,
|
void nr_qpsk_qpsk(short *stream0_in,
|
||||||
@@ -1251,62 +1211,6 @@ void nr_qpsk_qpsk(short *stream0_in,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_dlsch_qpsk_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int32_t **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
int16_t **llr16p)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t *rxF=(int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rho=(int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *llr16;
|
|
||||||
int len;
|
|
||||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
|
||||||
|
|
||||||
if (first_symbol_flag == 1) {
|
|
||||||
llr16 = (int16_t*)dlsch_llr;
|
|
||||||
} else {
|
|
||||||
llr16 = (int16_t*)(*llr16p);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssertFatal(llr16!=NULL,"nr_dlsch_qpsk_qpsk_llr: llr is null, symbol %d\n",symbol);
|
|
||||||
|
|
||||||
|
|
||||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
|
||||||
// if symbol has pilots
|
|
||||||
if (frame_parms->nb_antenna_ports_gNB!=1)
|
|
||||||
// in 2 antenna ports we have 8 REs per symbol per RB
|
|
||||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
|
||||||
else
|
|
||||||
// for 1 antenna port we have 10 REs per symbol per RB
|
|
||||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
|
||||||
} else {
|
|
||||||
// symbol has no pilots
|
|
||||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
|
||||||
}
|
|
||||||
|
|
||||||
nr_qpsk_qam16((short *)rxF,
|
|
||||||
(short *)rxF_i,
|
|
||||||
(short *)ch_mag_i,
|
|
||||||
(short *)llr16,
|
|
||||||
(short *)rho,
|
|
||||||
len);
|
|
||||||
|
|
||||||
llr16 += (len<<1);
|
|
||||||
*llr16p = (short *)llr16;
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
__m128i ONE_OVER_SQRT_2 __attribute__((aligned(16)));
|
__m128i ONE_OVER_SQRT_2 __attribute__((aligned(16)));
|
||||||
@@ -1533,61 +1437,6 @@ void nr_qpsk_qam16(int16_t *stream0_in,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_dlsch_qpsk_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int32_t **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
int16_t **llr16p)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t *rxF=(int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rho=(int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *llr16;
|
|
||||||
int len;
|
|
||||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
|
||||||
|
|
||||||
|
|
||||||
if (first_symbol_flag == 1) {
|
|
||||||
llr16 = (int16_t*)dlsch_llr;
|
|
||||||
} else {
|
|
||||||
llr16 = (int16_t*)(*llr16p);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssertFatal(llr16!=NULL,"nr_dlsch_qpsk_qam64_llr: llr is null, symbol %d\n",symbol);
|
|
||||||
|
|
||||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
|
||||||
// if symbol has pilots
|
|
||||||
if (frame_parms->nb_antenna_ports_gNB!=1)
|
|
||||||
// in 2 antenna ports we have 8 REs per symbol per RB
|
|
||||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
|
||||||
else
|
|
||||||
// for 1 antenna port we have 10 REs per symbol per RB
|
|
||||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
|
||||||
} else {
|
|
||||||
// symbol has no pilots
|
|
||||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
|
||||||
}
|
|
||||||
|
|
||||||
nr_qpsk_qam64((short *)rxF,
|
|
||||||
(short *)rxF_i,
|
|
||||||
(short *)ch_mag_i,
|
|
||||||
(short *)llr16,
|
|
||||||
(short *)rho,
|
|
||||||
len);
|
|
||||||
|
|
||||||
llr16 += (len<<1);
|
|
||||||
*llr16p = (short *)llr16;
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
__m128i ONE_OVER_SQRT_2_42 __attribute__((aligned(16)));
|
__m128i ONE_OVER_SQRT_2_42 __attribute__((aligned(16)));
|
||||||
__m128i THREE_OVER_SQRT_2_42 __attribute__((aligned(16)));
|
__m128i THREE_OVER_SQRT_2_42 __attribute__((aligned(16)));
|
||||||
@@ -2299,64 +2148,6 @@ void nr_qam16_qpsk(short *stream0_in,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_dlsch_16qam_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int32_t **dl_ch_mag, //|h_0|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
int16_t **llr16p)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *llr16;
|
|
||||||
int len;
|
|
||||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
|
||||||
|
|
||||||
// first symbol has different structure due to more pilots
|
|
||||||
if (first_symbol_flag == 1) {
|
|
||||||
llr16 = (int16_t*)dlsch_llr;
|
|
||||||
} else {
|
|
||||||
llr16 = (int16_t*)(*llr16p);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssertFatal(llr16!=NULL,"nr_dlsch_16qam_qpsk_llr: llr is null, symbol %d\n",symbol);
|
|
||||||
|
|
||||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
|
||||||
// if symbol has pilots
|
|
||||||
if (frame_parms->nb_antenna_ports_gNB!=1)
|
|
||||||
// in 2 antenna ports we have 8 REs per symbol per RB
|
|
||||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
|
||||||
else
|
|
||||||
// for 1 antenna port we have 10 REs per symbol per RB
|
|
||||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
|
||||||
} else {
|
|
||||||
// symbol has no pilots
|
|
||||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
|
||||||
}
|
|
||||||
|
|
||||||
// printf("symbol %d: qam16_llr, len %d (llr16 %p)\n",symbol,len,llr16);
|
|
||||||
|
|
||||||
nr_qam16_qpsk((short *)rxF,
|
|
||||||
(short *)rxF_i,
|
|
||||||
(short *)ch_mag,
|
|
||||||
(short *)llr16,
|
|
||||||
(short *)rho,
|
|
||||||
len);
|
|
||||||
|
|
||||||
llr16 += (len<<2);
|
|
||||||
*llr16p = (short *)llr16;
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_qam16_qam16(short *stream0_in,
|
void nr_qam16_qam16(short *stream0_in,
|
||||||
short *stream1_in,
|
short *stream1_in,
|
||||||
short *ch_mag,
|
short *ch_mag,
|
||||||
@@ -2851,54 +2642,6 @@ void nr_qam16_qam16(short *stream0_in,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_dlsch_16qam_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int32_t **dl_ch_mag, //|h_0|^2*(2/sqrt{10})
|
|
||||||
int32_t **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint32_t len,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
int16_t **llr16p)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *rho = (int16_t*)&rho_i[0][(symbol*nb_rb*12)];
|
|
||||||
int16_t *llr16;
|
|
||||||
|
|
||||||
// first symbol has different structure due to more pilots
|
|
||||||
if (first_symbol_flag == 1) {
|
|
||||||
llr16 = (int16_t*)dlsch_llr;
|
|
||||||
} else {
|
|
||||||
llr16 = (int16_t*)(*llr16p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AssertFatal(llr16!=NULL,"nr_dlsch_16qam_16qam_llr: llr is null, symbol %d\n",symbol);
|
|
||||||
|
|
||||||
// printf("symbol %d: qam16_llr, len %d (llr16 %p)\n",symbol,len,llr16);
|
|
||||||
|
|
||||||
nr_qam16_qam16((short *)rxF,
|
|
||||||
(short *)rxF_i,
|
|
||||||
(short *)ch_mag,
|
|
||||||
(short *)ch_mag_i,
|
|
||||||
(short *)llr16,
|
|
||||||
(short *)rho,
|
|
||||||
len);
|
|
||||||
|
|
||||||
llr16 += (len<<2);
|
|
||||||
*llr16p = (short *)llr16;
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void nr_qam16_qam64(int16_t *stream0_in,
|
void nr_qam16_qam64(int16_t *stream0_in,
|
||||||
int16_t *stream1_in,
|
int16_t *stream1_in,
|
||||||
int16_t *ch_mag,
|
int16_t *ch_mag,
|
||||||
@@ -3470,69 +3213,6 @@ void nr_qam16_qam64(int16_t *stream0_in,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int nr_dlsch_16qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int32_t **dl_ch_mag, //|h_0|^2*(2/sqrt{10})
|
|
||||||
int32_t **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
int16_t **llr16p)
|
|
||||||
{
|
|
||||||
|
|
||||||
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)];
|
|
||||||
int16_t *llr16;
|
|
||||||
int len;
|
|
||||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
|
||||||
|
|
||||||
// first symbol has different structure due to more pilots
|
|
||||||
if (first_symbol_flag == 1) {
|
|
||||||
llr16 = (int16_t*)dlsch_llr;
|
|
||||||
} else {
|
|
||||||
llr16 = (int16_t*)(*llr16p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AssertFatal(llr16!=NULL,"nr_dlsch_16qam_64qam_llr:llr is null, symbol %d\n",symbol);
|
|
||||||
|
|
||||||
|
|
||||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
|
||||||
// if symbol has pilots
|
|
||||||
if (frame_parms->nb_antenna_ports_gNB!=1)
|
|
||||||
// in 2 antenna ports we have 8 REs per symbol per RB
|
|
||||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
|
||||||
else
|
|
||||||
// for 1 antenna port we have 10 REs per symbol per RB
|
|
||||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
|
||||||
} else {
|
|
||||||
// symbol has no pilots
|
|
||||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
|
||||||
}
|
|
||||||
|
|
||||||
// printf("symbol %d: qam16_llr, len %d (llr16 %p)\n",symbol,len,llr16);
|
|
||||||
|
|
||||||
nr_qam16_qam64((short *)rxF,
|
|
||||||
(short *)rxF_i,
|
|
||||||
(short *)ch_mag,
|
|
||||||
(short *)ch_mag_i,
|
|
||||||
(short *)llr16,
|
|
||||||
(short *)rho,
|
|
||||||
len);
|
|
||||||
|
|
||||||
llr16 += (len<<2);
|
|
||||||
*llr16p = (short *)llr16;
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
// 64-QAM
|
// 64-QAM
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -101,30 +101,6 @@ void nr_qpsk_qam16(int16_t *stream0_in,
|
|||||||
int16_t *rho01,
|
int16_t *rho01,
|
||||||
int32_t length);
|
int32_t length);
|
||||||
|
|
||||||
/** \brief This function perform LLR computation for dual-stream (QPSK/16QAM) transmission.
|
|
||||||
@param frame_parms Frame descriptor structure
|
|
||||||
@param rxdataF_comp Compensated channel output
|
|
||||||
@param rxdataF_comp_i Compensated channel output for interference
|
|
||||||
@param rho_i Correlation between channel of signal and inteference
|
|
||||||
@param dlsch_llr llr output
|
|
||||||
@param symbol OFDM symbol index in sub-frame
|
|
||||||
@param first_symbol_flag flag to indicate this is the first symbol of the dlsch
|
|
||||||
@param nb_rb number of RBs for this allocation
|
|
||||||
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
|
|
||||||
@param llr128p pointer to pointer to symbol in dlsch_llr*/
|
|
||||||
int32_t nr_dlsch_qpsk_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adj,
|
|
||||||
int16_t **llr128p);
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/64QAM reception.
|
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/64QAM reception.
|
||||||
@param stream0_in Input from channel compensated (MR combined) stream 0
|
@param stream0_in Input from channel compensated (MR combined) stream 0
|
||||||
@param stream1_in Input from channel compensated (MR combined) stream 1
|
@param stream1_in Input from channel compensated (MR combined) stream 1
|
||||||
@@ -139,30 +115,6 @@ void nr_qpsk_qam64(int16_t *stream0_in,
|
|||||||
int16_t *rho01,
|
int16_t *rho01,
|
||||||
int32_t length);
|
int32_t length);
|
||||||
|
|
||||||
/** \brief This function perform LLR computation for dual-stream (QPSK/64QAM) transmission.
|
|
||||||
@param frame_parms Frame descriptor structure
|
|
||||||
@param rxdataF_comp Compensated channel output
|
|
||||||
@param rxdataF_comp_i Compensated channel output for interference
|
|
||||||
@param rho_i Correlation between channel of signal and inteference
|
|
||||||
@param dlsch_llr llr output
|
|
||||||
@param symbol OFDM symbol index in sub-frame
|
|
||||||
@param first_symbol_flag flag to indicate this is the first symbol of the dlsch
|
|
||||||
@param nb_rb number of RBs for this allocation
|
|
||||||
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
|
|
||||||
@param llr128p pointer to pointer to symbol in dlsch_llr*/
|
|
||||||
int32_t nr_dlsch_qpsk_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int32_t **rxdataF_comp,
|
|
||||||
int32_t **rxdataF_comp_i,
|
|
||||||
int **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int32_t **rho_i,
|
|
||||||
int16_t *dlsch_llr,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
uint16_t nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adj,
|
|
||||||
int16_t **llr128p);
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 16QAM/QPSK reception.
|
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 16QAM/QPSK reception.
|
||||||
@param stream0_in Input from channel compensated (MR combined) stream 0
|
@param stream0_in Input from channel compensated (MR combined) stream 0
|
||||||
@param stream1_in Input from channel compensated (MR combined) stream 1
|
@param stream1_in Input from channel compensated (MR combined) stream 1
|
||||||
@@ -170,35 +122,7 @@ int32_t nr_dlsch_qpsk_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
@param stream0_out Output from LLR unit for stream0
|
@param stream0_out Output from LLR unit for stream0
|
||||||
@param rho01 Cross-correlation between channels (MR combined)
|
@param rho01 Cross-correlation between channels (MR combined)
|
||||||
@param length in complex channel outputs*/
|
@param length in complex channel outputs*/
|
||||||
void nr_qam16_qpsk(short *stream0_in,
|
void nr_qam16_qpsk(short *stream0_in, short *stream1_in, short *ch_mag, short *stream0_out, short *rho01, int length);
|
||||||
short *stream1_in,
|
|
||||||
short *ch_mag,
|
|
||||||
short *stream0_out,
|
|
||||||
short *rho01,
|
|
||||||
int length);
|
|
||||||
/** \brief This function perform LLR computation for dual-stream (16QAM/QPSK) transmission.
|
|
||||||
@param frame_parms Frame descriptor structure
|
|
||||||
@param rxdataF_comp Compensated channel output
|
|
||||||
@param rxdataF_comp_i Compensated channel output for interference
|
|
||||||
@param ch_mag Input from scaled channel magnitude square of h0'*g0
|
|
||||||
@param rho_i Correlation between channel of signal and inteference
|
|
||||||
@param dlsch_llr llr output
|
|
||||||
@param symbol OFDM symbol index in sub-frame
|
|
||||||
@param first_symbol_flag flag to indicate this is the first symbol of the dlsch
|
|
||||||
@param nb_rb number of RBs for this allocation
|
|
||||||
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
|
|
||||||
@param llr16p pointer to pointer to symbol in dlsch_llr*/
|
|
||||||
int nr_dlsch_16qam_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int **rxdataF_comp,
|
|
||||||
int **rxdataF_comp_i,
|
|
||||||
int **dl_ch_mag, //|h_0|^2*(2/sqrt{10})
|
|
||||||
int **rho_i,
|
|
||||||
short *dlsch_llr,
|
|
||||||
unsigned char symbol,
|
|
||||||
unsigned char first_symbol_flag,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
short **llr16p);
|
|
||||||
|
|
||||||
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 16QAM/16QAM reception.
|
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 16QAM/16QAM reception.
|
||||||
@param stream0_in Input from channel compensated (MR combined) stream 0
|
@param stream0_in Input from channel compensated (MR combined) stream 0
|
||||||
@@ -216,75 +140,6 @@ void nr_qam16_qam16(short *stream0_in,
|
|||||||
short *rho01,
|
short *rho01,
|
||||||
int length);
|
int length);
|
||||||
|
|
||||||
/** \brief This function perform LLR computation for dual-stream (16QAM/16QAM) transmission.
|
|
||||||
@param frame_parms Frame descriptor structure
|
|
||||||
@param rxdataF_comp Compensated channel output
|
|
||||||
@param rxdataF_comp_i Compensated channel output for interference
|
|
||||||
@param ch_mag Input from scaled channel magnitude square of h0'*g0
|
|
||||||
@param ch_mag_i Input from scaled channel magnitude square of h0'*g1
|
|
||||||
@param rho_i Correlation between channel of signal and inteference
|
|
||||||
@param dlsch_llr llr output
|
|
||||||
@param symbol OFDM symbol index in sub-frame
|
|
||||||
@param first_symbol_flag flag to indicate this is the first symbol of the dlsch
|
|
||||||
@param nb_rb number of RBs for this allocation
|
|
||||||
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
|
|
||||||
@param llr16p pointer to pointer to symbol in dlsch_llr*/
|
|
||||||
int nr_dlsch_16qam_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int **rxdataF_comp,
|
|
||||||
int **rxdataF_comp_i,
|
|
||||||
int **dl_ch_mag, //|h_0|^2*(2/sqrt{10})
|
|
||||||
int **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int **rho_i,
|
|
||||||
short *dlsch_llr,
|
|
||||||
unsigned char symbol,
|
|
||||||
uint32_t len,
|
|
||||||
unsigned char first_symbol_flag,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
short **llr16p);
|
|
||||||
|
|
||||||
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 16QAM/64QAM reception.
|
|
||||||
@param stream0_in Input from channel compensated (MR combined) stream 0
|
|
||||||
@param stream1_in Input from channel compensated (MR combined) stream 1
|
|
||||||
@param ch_mag Input from scaled channel magnitude square of h0'*g0
|
|
||||||
@param ch_mag_i Input from scaled channel magnitude square of h0'*g1
|
|
||||||
@param stream0_out Output from LLR unit for stream0
|
|
||||||
@param rho01 Cross-correlation between channels (MR combined)
|
|
||||||
@param length in complex channel outputs*/
|
|
||||||
void nr_qam16_qam64(short *stream0_in,
|
|
||||||
short *stream1_in,
|
|
||||||
short *ch_mag,
|
|
||||||
short *ch_mag_i,
|
|
||||||
short *stream0_out,
|
|
||||||
short *rho01,
|
|
||||||
int length);
|
|
||||||
|
|
||||||
/** \brief This function perform LLR computation for dual-stream (16QAM/64QAM) transmission.
|
|
||||||
@param frame_parms Frame descriptor structure
|
|
||||||
@param rxdataF_comp Compensated channel output
|
|
||||||
@param rxdataF_comp_i Compensated channel output for interference
|
|
||||||
@param ch_mag Input from scaled channel magnitude square of h0'*g0
|
|
||||||
@param ch_mag_i Input from scaled channel magnitude square of h0'*g1
|
|
||||||
@param rho_i Correlation between channel of signal and inteference
|
|
||||||
@param dlsch_llr llr output
|
|
||||||
@param symbol OFDM symbol index in sub-frame
|
|
||||||
@param first_symbol_flag flag to indicate this is the first symbol of the dlsch
|
|
||||||
@param nb_rb number of RBs for this allocation
|
|
||||||
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
|
|
||||||
@param llr16p pointer to pointer to symbol in dlsch_llr*/
|
|
||||||
int nr_dlsch_16qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
int **rxdataF_comp,
|
|
||||||
int **rxdataF_comp_i,
|
|
||||||
int **dl_ch_mag, //|h_0|^2*(2/sqrt{10})
|
|
||||||
int **dl_ch_mag_i, //|h_1|^2*(2/sqrt{10})
|
|
||||||
int **rho_i,
|
|
||||||
short *dlsch_llr,
|
|
||||||
unsigned char symbol,
|
|
||||||
unsigned char first_symbol_flag,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
uint16_t pbch_pss_sss_adjust,
|
|
||||||
short **llr16p);
|
|
||||||
|
|
||||||
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 64QAM/64QAM reception.
|
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream 64QAM/64QAM reception.
|
||||||
@param stream0_in Input from channel compensated (MR combined) stream 0
|
@param stream0_in Input from channel compensated (MR combined) stream 0
|
||||||
@param stream1_in Input from channel compensated (MR combined) stream 1
|
@param stream1_in Input from channel compensated (MR combined) stream 1
|
||||||
@@ -518,95 +373,6 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
uint8_t first_symbol_flag,
|
uint8_t first_symbol_flag,
|
||||||
uint16_t nb_rb);
|
uint16_t nb_rb);
|
||||||
|
|
||||||
|
|
||||||
/** \fn dlsch_extract_rbs(int32_t **rxdataF,
|
|
||||||
int32_t **dl_ch_estimates,
|
|
||||||
int32_t **rxdataF_ext,
|
|
||||||
int32_t **dl_ch_estimates_ext,
|
|
||||||
unsigned char symbol
|
|
||||||
uint8_t pilots,
|
|
||||||
uint8_t config_type,
|
|
||||||
unsigned short start_rb,
|
|
||||||
unsigned short nb_rb_pdsch,
|
|
||||||
uint8_t n_dmrs_cdm_groups,
|
|
||||||
uint8_t Nl,
|
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
uint16_t dlDmrsSymbPos)
|
|
||||||
\brief This function extracts the received resource blocks, both channel estimates and data symbols,
|
|
||||||
for the current allocation and for multiple layer antenna gNB transmission.
|
|
||||||
@param rxdataF Raw FFT output of received signal
|
|
||||||
@param dl_ch_estimates Channel estimates of current slot
|
|
||||||
@param rxdataF_ext FFT output for RBs in this allocation
|
|
||||||
@param dl_ch_estimates_ext Channel estimates for RBs in this allocation
|
|
||||||
@param Nl nb of antenna layers
|
|
||||||
@param symbol Symbol to extract
|
|
||||||
@param n_dmrs_cdm_groups
|
|
||||||
@param frame_parms Pointer to frame descriptor
|
|
||||||
*/
|
|
||||||
void nr_dlsch_extract_rbs(uint32_t rxdataF_sz,
|
|
||||||
c16_t rxdataF[][rxdataF_sz],
|
|
||||||
const uint32_t rx_size,
|
|
||||||
const uint32_t pdsch_est_size,
|
|
||||||
int32_t dl_ch_estimates[][pdsch_est_size],
|
|
||||||
int32_t rxdataF_ext[][rx_size],
|
|
||||||
int32_t dl_ch_estimates_ext[][rx_size],
|
|
||||||
unsigned char symbol,
|
|
||||||
uint8_t pilots,
|
|
||||||
uint8_t config_type,
|
|
||||||
unsigned short start_rb,
|
|
||||||
unsigned short nb_rb_pdsch,
|
|
||||||
uint8_t n_dmrs_cdm_groups,
|
|
||||||
uint8_t Nl,
|
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
uint16_t dlDmrsSymbPos,
|
|
||||||
int chest_time_type);
|
|
||||||
|
|
||||||
/** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation)
|
|
||||||
@param rxdataF_ext Frequency-domain received signal in RBs to be demodulated
|
|
||||||
@param dl_ch_estimates_ext Frequency-domain channel estimates in RBs to be demodulated
|
|
||||||
@param dl_ch_mag First Channel magnitudes (16QAM/64QAM)
|
|
||||||
@param dl_ch_magb Second weighted Channel magnitudes (64QAM)
|
|
||||||
@param rxdataF_comp Compensated received waveform
|
|
||||||
@param rho Cross-correlation between two spatial channels on each RX antenna
|
|
||||||
@param frame_parms Pointer to frame descriptor
|
|
||||||
@param symbol Symbol on which to operate
|
|
||||||
@param first_symbol_flag set to 1 on first DLSCH symbol
|
|
||||||
@param mod_order Modulation order of allocation
|
|
||||||
@param nb_rb Number of RBs in allocation
|
|
||||||
@param output_shift Rescaling for compensated output (should be energy-normalizing)
|
|
||||||
@param phy_measurements Pointer to UE PHY measurements
|
|
||||||
*/
|
|
||||||
void nr_dlsch_channel_compensation(uint32_t rx_size,
|
|
||||||
int32_t rxdataF_ext[][rx_size],
|
|
||||||
int32_t dl_ch_estimates_ext[][rx_size],
|
|
||||||
int32_t dl_ch_mag[][rx_size],
|
|
||||||
int32_t dl_ch_magb[][rx_size],
|
|
||||||
int32_t dl_ch_magr[][rx_size],
|
|
||||||
int32_t rxdataF_comp[][rx_size],
|
|
||||||
int ***rho,
|
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
uint8_t nb_aatx,
|
|
||||||
unsigned char symbol,
|
|
||||||
int length,
|
|
||||||
uint8_t first_symbol_flag,
|
|
||||||
unsigned char mod_order,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
unsigned char output_shift,
|
|
||||||
PHY_NR_MEASUREMENTS *measurements);
|
|
||||||
|
|
||||||
void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
|
|
||||||
int **dl_ch_estimates_ext,
|
|
||||||
int **dl_ch_mag,
|
|
||||||
int **dl_ch_magb,
|
|
||||||
int **rxdataF_comp,
|
|
||||||
int ***rho,
|
|
||||||
unsigned char n_tx,
|
|
||||||
unsigned char n_rx,
|
|
||||||
unsigned char mod_order,
|
|
||||||
unsigned char output_shift,
|
|
||||||
int length,
|
|
||||||
int start_point);
|
|
||||||
|
|
||||||
void nr_dlsch_deinterleaving(uint8_t symbol,
|
void nr_dlsch_deinterleaving(uint8_t symbol,
|
||||||
uint8_t start_symbol,
|
uint8_t start_symbol,
|
||||||
uint16_t L,
|
uint16_t L,
|
||||||
@@ -614,26 +380,6 @@ void nr_dlsch_deinterleaving(uint8_t symbol,
|
|||||||
uint16_t *llr_deint,
|
uint16_t *llr_deint,
|
||||||
uint16_t nb_rb_pdsch);
|
uint16_t nb_rb_pdsch);
|
||||||
|
|
||||||
void nr_dlsch_channel_level_median(uint32_t rx_size,
|
|
||||||
int32_t dl_ch_estimates[][rx_size],
|
|
||||||
int32_t *median,
|
|
||||||
int n_tx,
|
|
||||||
int n_rx,
|
|
||||||
int length,
|
|
||||||
int start_point);
|
|
||||||
|
|
||||||
void nr_dlsch_detection_mrc(uint32_t rx_size,
|
|
||||||
int32_t rxdataF_comp[][rx_size],
|
|
||||||
int ***rho,
|
|
||||||
int32_t dl_ch_mag[][rx_size],
|
|
||||||
int32_t dl_ch_magb[][rx_size],
|
|
||||||
int32_t dl_ch_magr[][rx_size],
|
|
||||||
short n_tx,
|
|
||||||
short n_rx,
|
|
||||||
unsigned char symbol,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
int length);
|
|
||||||
|
|
||||||
void nr_conjch0_mult_ch1(int *ch0,
|
void nr_conjch0_mult_ch1(int *ch0,
|
||||||
int *ch1,
|
int *ch1,
|
||||||
int32_t *ch0conj_ch1,
|
int32_t *ch0conj_ch1,
|
||||||
@@ -644,33 +390,6 @@ void nr_a_sum_b(__m128i *input_x,
|
|||||||
__m128i *input_y,
|
__m128i *input_y,
|
||||||
unsigned short nb_rb);
|
unsigned short nb_rb);
|
||||||
|
|
||||||
|
|
||||||
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
|
|
||||||
@param dl_ch_estimates_ext Channel estimates in allocated RBs
|
|
||||||
@param frame_parms Pointer to frame descriptor
|
|
||||||
@param avg Pointer to average signal strength
|
|
||||||
@param pilots_flag Flag to indicate pilots in symbol
|
|
||||||
@param nb_rb Number of allocated RBs
|
|
||||||
*/
|
|
||||||
void nr_dlsch_channel_level(uint32_t rx_size,
|
|
||||||
int32_t dl_ch_estimates[][rx_size],
|
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
uint8_t n_tx,
|
|
||||||
int32_t *avg,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint32_t len,
|
|
||||||
unsigned short nb_rb);
|
|
||||||
|
|
||||||
void nr_dlsch_scale_channel(uint32_t rx_size,
|
|
||||||
int32_t dl_ch_estimates[][rx_size],
|
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
uint8_t n_tx,
|
|
||||||
uint8_t n_rx,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t pilots,
|
|
||||||
uint32_t len,
|
|
||||||
unsigned short nb_rb);
|
|
||||||
|
|
||||||
/** \brief This is the top-level entry point for DLSCH decoding in UE. It should be replicated on several
|
/** \brief This is the top-level entry point for DLSCH decoding in UE. It should be replicated on several
|
||||||
threads (on multi-core machines) corresponding to different HARQ processes. The routine first
|
threads (on multi-core machines) corresponding to different HARQ processes. The routine first
|
||||||
computes the segmentation information, followed by rate dematching and sub-block deinterleaving the of the
|
computes the segmentation information, followed by rate dematching and sub-block deinterleaving the of the
|
||||||
@@ -877,16 +596,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
|||||||
uint32_t pdsch_est_size,
|
uint32_t pdsch_est_size,
|
||||||
int32_t dl_ch_estimates[][pdsch_est_size],
|
int32_t dl_ch_estimates[][pdsch_est_size],
|
||||||
int16_t *llr[2],
|
int16_t *llr[2],
|
||||||
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
|
|
||||||
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
|
|
||||||
uint32_t dl_valid_re[NR_SYMBOLS_PER_SLOT],
|
uint32_t dl_valid_re[NR_SYMBOLS_PER_SLOT],
|
||||||
uint32_t rx_size,
|
|
||||||
int32_t dl_ch_estimates_ext[][rx_size],
|
|
||||||
int32_t rxdataF_ext[][rx_size],
|
|
||||||
int32_t rxdataF_comp[][rx_size],
|
|
||||||
int32_t dl_ch_mag[][rx_size],
|
|
||||||
int32_t dl_ch_magb[][rx_size],
|
|
||||||
int32_t dl_ch_magr[][rx_size],
|
|
||||||
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
|
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
|
||||||
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT],
|
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT],
|
||||||
int32_t *log2_maxh);
|
int32_t *log2_maxh);
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
pdsch_nb_rb,
|
pdsch_nb_rb,
|
||||||
pdsch_est_size,
|
pdsch_est_size,
|
||||||
pdsch_dl_ch_estimates,
|
pdsch_dl_ch_estimates,
|
||||||
rxdataF);
|
ue->frame_parms.samples_per_slot_wCP, rxdataF);
|
||||||
#if 0
|
#if 0
|
||||||
///LOG_M: the channel estimation
|
///LOG_M: the channel estimation
|
||||||
int nr_frame_rx = proc->frame_rx;
|
int nr_frame_rx = proc->frame_rx;
|
||||||
@@ -635,35 +635,9 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
first_symbol_with_data++;
|
first_symbol_with_data++;
|
||||||
}
|
}
|
||||||
|
|
||||||
c16_t ptrs_phase_per_slot[ue->frame_parms.nb_antennas_rx][NR_SYMBOLS_PER_SLOT];
|
|
||||||
memset(ptrs_phase_per_slot, 0, ue->frame_parms.nb_antennas_rx*NR_SYMBOLS_PER_SLOT*sizeof(c16_t));
|
|
||||||
|
|
||||||
int32_t ptrs_re_per_slot[ue->frame_parms.nb_antennas_rx][NR_SYMBOLS_PER_SLOT];
|
|
||||||
memset(ptrs_re_per_slot, 0, ue->frame_parms.nb_antennas_rx*NR_SYMBOLS_PER_SLOT*sizeof(c16_t));
|
|
||||||
|
|
||||||
uint32_t dl_valid_re[NR_SYMBOLS_PER_SLOT] = {0};
|
uint32_t dl_valid_re[NR_SYMBOLS_PER_SLOT] = {0};
|
||||||
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT] = {0};
|
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT] = {0};
|
||||||
|
|
||||||
const uint32_t rx_size = ((NR_SYMBOLS_PER_SLOT * dlsch[0].dlsch_config.number_rbs * NR_NB_SC_PER_RB + 15) >> 4) << 4;
|
|
||||||
|
|
||||||
__attribute__ ((aligned(32))) int32_t dl_ch_estimates_ext[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
|
|
||||||
memset(dl_ch_estimates_ext, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
|
|
||||||
|
|
||||||
__attribute__ ((aligned(32))) int32_t rxdataF_ext[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
|
|
||||||
memset(rxdataF_ext, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
|
|
||||||
|
|
||||||
__attribute__ ((aligned(32))) int32_t rxdataF_comp[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
|
|
||||||
memset(rxdataF_comp, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
|
|
||||||
|
|
||||||
__attribute__ ((aligned(32))) int32_t dl_ch_mag[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
|
|
||||||
memset(dl_ch_mag, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
|
|
||||||
|
|
||||||
__attribute__ ((aligned(32))) int32_t dl_ch_magb[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
|
|
||||||
memset(dl_ch_magb, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
|
|
||||||
|
|
||||||
__attribute__ ((aligned(32))) int32_t dl_ch_magr[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
|
|
||||||
memset(dl_ch_magr, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
|
|
||||||
|
|
||||||
int32_t log2_maxh = 0;
|
int32_t log2_maxh = 0;
|
||||||
start_meas(&ue->rx_pdsch_stats);
|
start_meas(&ue->rx_pdsch_stats);
|
||||||
for (m = s0; m < (s1 + s0); m++) {
|
for (m = s0; m < (s1 + s0); m++) {
|
||||||
@@ -679,28 +653,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
start_meas(&ue->dlsch_llr_stats_parallelization[slot]);
|
start_meas(&ue->dlsch_llr_stats_parallelization[slot]);
|
||||||
// process DLSCH received symbols in the slot
|
// process DLSCH received symbols in the slot
|
||||||
// symbol by symbol processing (if data/DMRS are multiplexed is checked inside the function)
|
// symbol by symbol processing (if data/DMRS are multiplexed is checked inside the function)
|
||||||
if (nr_rx_pdsch(ue,
|
if (nr_rx_pdsch(ue, proc, dlsch, m, first_symbol_flag, harq_pid, pdsch_est_size, pdsch_dl_ch_estimates, llr, dl_valid_re, rxdataF, llr_offset, &log2_maxh) < 0)
|
||||||
proc,
|
|
||||||
dlsch,
|
|
||||||
m,
|
|
||||||
first_symbol_flag,
|
|
||||||
harq_pid,
|
|
||||||
pdsch_est_size,
|
|
||||||
pdsch_dl_ch_estimates,
|
|
||||||
llr,
|
|
||||||
ptrs_phase_per_slot,
|
|
||||||
ptrs_re_per_slot,
|
|
||||||
dl_valid_re,
|
|
||||||
rx_size,
|
|
||||||
dl_ch_estimates_ext,
|
|
||||||
rxdataF_ext,
|
|
||||||
rxdataF_comp,
|
|
||||||
dl_ch_mag,
|
|
||||||
dl_ch_magb,
|
|
||||||
dl_ch_magr,
|
|
||||||
rxdataF,
|
|
||||||
llr_offset,
|
|
||||||
&log2_maxh) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
stop_meas(&ue->dlsch_llr_stats_parallelization[slot]);
|
stop_meas(&ue->dlsch_llr_stats_parallelization[slot]);
|
||||||
@@ -711,17 +664,6 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
}
|
}
|
||||||
} // CRNTI active
|
} // CRNTI active
|
||||||
stop_meas(&ue->rx_pdsch_stats);
|
stop_meas(&ue->rx_pdsch_stats);
|
||||||
|
|
||||||
UEscopeCopy(ue, pdschRxdataF_comp, rxdataF_comp, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx*dlsch0->Nl, rx_size);
|
|
||||||
|
|
||||||
if (ue->phy_sim_pdsch_rxdataF_comp)
|
|
||||||
memcpy(ue->phy_sim_pdsch_rxdataF_comp, rxdataF_comp, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
|
|
||||||
if (ue->phy_sim_pdsch_rxdataF_ext)
|
|
||||||
memcpy(ue->phy_sim_pdsch_rxdataF_ext, rxdataF_ext, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
|
|
||||||
if (ue->phy_sim_pdsch_dl_ch_estimates_ext)
|
|
||||||
memcpy(ue->phy_sim_pdsch_dl_ch_estimates_ext, dl_ch_estimates_ext, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
|
|
||||||
if (ue->phy_sim_pdsch_dl_ch_estimates)
|
|
||||||
memcpy(ue->phy_sim_pdsch_dl_ch_estimates, dl_ch_estimates_ext, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user