use common scale channel functions for DLSCH and ULSCH
This commit is contained in:
+1
-1
@@ -151,7 +151,7 @@ populates UL_INFO.uci_ind, actual uci data is in gNB->pucch
|
|||||||
{: .func4}
|
{: .func4}
|
||||||
* nr_ulsch_extract_rbs_single()
|
* nr_ulsch_extract_rbs_single()
|
||||||
{: .func4}
|
{: .func4}
|
||||||
* nr_ulsch_scale_channel()
|
* nr_scale_channel()
|
||||||
{: .func4}
|
{: .func4}
|
||||||
* nr_ulsch_channel_level()
|
* nr_ulsch_channel_level()
|
||||||
{: .func4}
|
{: .func4}
|
||||||
|
|||||||
@@ -159,42 +159,6 @@ static void nr_ulsch_extract_rbs(c16_t* const rxdataF,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nr_ulsch_scale_channel(int size_est,
|
|
||||||
int ul_ch_estimates_ext[][size_est],
|
|
||||||
NR_DL_FRAME_PARMS *frame_parms,
|
|
||||||
uint8_t symbol,
|
|
||||||
uint8_t is_dmrs_symbol,
|
|
||||||
uint32_t len,
|
|
||||||
uint8_t nrOfLayers,
|
|
||||||
unsigned short nb_rb,
|
|
||||||
int shift_ch_ext)
|
|
||||||
{
|
|
||||||
// Determine scaling amplitude based the symbol
|
|
||||||
int b = 3;
|
|
||||||
short ch_amp = 1024 * 8;
|
|
||||||
if (shift_ch_ext > 3) {
|
|
||||||
b = 0;
|
|
||||||
ch_amp >>= (shift_ch_ext - 3);
|
|
||||||
if (ch_amp == 0) {
|
|
||||||
ch_amp = 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
b -= shift_ch_ext;
|
|
||||||
}
|
|
||||||
simde__m128i ch_amp128 = simde_mm_set1_epi16(ch_amp); // Q3.13
|
|
||||||
LOG_D(PHY, "Scaling PUSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n", symbol, ch_amp, is_dmrs_symbol, nb_rb, frame_parms->Ncp, symbol);
|
|
||||||
|
|
||||||
for (int aatx = 0; aatx < nrOfLayers; aatx++) {
|
|
||||||
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
|
||||||
simde__m128i *ul_ch128 = (simde__m128i *)&ul_ch_estimates_ext[aatx * frame_parms->nb_antennas_rx + aarx][symbol * len];
|
|
||||||
for (int i = 0; i < len >> 2; i++) {
|
|
||||||
ul_ch128[i] = simde_mm_mulhi_epi16(ul_ch128[i], ch_amp128);
|
|
||||||
ul_ch128[i] = simde_mm_slli_epi16(ul_ch128[i], b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_nb_re_pusch (NR_DL_FRAME_PARMS *frame_parms, nfapi_nr_pusch_pdu_t *rel15_ul,int symbol)
|
static int get_nb_re_pusch (NR_DL_FRAME_PARMS *frame_parms, nfapi_nr_pusch_pdu_t *rel15_ul,int symbol)
|
||||||
{
|
{
|
||||||
uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
|
uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
|
||||||
@@ -1375,15 +1339,13 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
|||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
//--------------------- Channel Scaling --------------------
|
//--------------------- Channel Scaling --------------------
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
nr_ulsch_scale_channel(size_est,
|
nr_scale_channel(size_est,
|
||||||
ul_ch_estimates_ext,
|
ul_ch_estimates_ext,
|
||||||
frame_parms,
|
meas_symbol,
|
||||||
meas_symbol,
|
nb_re_pusch,
|
||||||
(rel15_ul->ul_dmrs_symb_pos >> meas_symbol) & 0x01,
|
rel15_ul->nrOfLayers,
|
||||||
nb_re_pusch,
|
frame_parms->nb_antennas_rx,
|
||||||
rel15_ul->nrOfLayers,
|
shift_ch_ext);
|
||||||
rel15_ul->rb_size,
|
|
||||||
shift_ch_ext);
|
|
||||||
|
|
||||||
int avg[frame_parms->nb_antennas_rx*rel15_ul->nrOfLayers];
|
int avg[frame_parms->nb_antennas_rx*rel15_ul->nrOfLayers];
|
||||||
nr_channel_level(meas_symbol,
|
nr_channel_level(meas_symbol,
|
||||||
|
|||||||
@@ -193,15 +193,6 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
|||||||
unsigned char output_shift,
|
unsigned char output_shift,
|
||||||
PHY_NR_MEASUREMENTS *measurements);
|
PHY_NR_MEASUREMENTS *measurements);
|
||||||
|
|
||||||
void nr_dlsch_scale_channel(uint32_t rx_size_symbol,
|
|
||||||
int32_t dl_ch_estimates_ext[][rx_size_symbol],
|
|
||||||
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);
|
|
||||||
static void nr_dlsch_detection_mrc(uint32_t rx_size_symbol,
|
static void nr_dlsch_detection_mrc(uint32_t rx_size_symbol,
|
||||||
short nl,
|
short nl,
|
||||||
short n_rx,
|
short n_rx,
|
||||||
@@ -507,7 +498,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
|||||||
//--------------------- Channel Scaling --------------------
|
//--------------------- Channel Scaling --------------------
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
start_meas_nr_ue_phy(ue, DLSCH_CHANNEL_SCALE_STATS);
|
start_meas_nr_ue_phy(ue, DLSCH_CHANNEL_SCALE_STATS);
|
||||||
nr_dlsch_scale_channel(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, n_rx, symbol, pilots, nb_re_pdsch, nb_rb_pdsch);
|
nr_scale_channel(rx_size_symbol, dl_ch_estimates_ext, 0, nb_re_pdsch, nl, n_rx, 0);
|
||||||
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_SCALE_STATS);
|
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_SCALE_STATS);
|
||||||
if (meas_enabled) {
|
if (meas_enabled) {
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
@@ -921,56 +912,6 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_dlsch_scale_channel(uint32_t rx_size_symbol,
|
|
||||||
int32_t dl_ch_estimates_ext[][rx_size_symbol],
|
|
||||||
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)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
short rb, ch_amp;
|
|
||||||
unsigned char aatx,aarx;
|
|
||||||
simde__m128i *dl_ch128, ch_amp128;
|
|
||||||
|
|
||||||
uint32_t nb_rb_0 = len/12 + ((len%12)?1:0);
|
|
||||||
|
|
||||||
// Determine scaling amplitude based the symbol
|
|
||||||
|
|
||||||
ch_amp = 1024*8; //((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, pilots %d nb_rb %d NCP %d symbol %d\n",symbol,ch_amp,pilots,nb_rb,frame_parms->Ncp,symbol);
|
|
||||||
// printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
|
|
||||||
|
|
||||||
ch_amp128 = simde_mm_set1_epi16(ch_amp); // Q3.13
|
|
||||||
|
|
||||||
for (aatx=0; aatx<n_tx; aatx++) {
|
|
||||||
for (aarx=0; aarx<n_rx; aarx++) {
|
|
||||||
|
|
||||||
dl_ch128=(simde__m128i *)dl_ch_estimates_ext[(aatx*n_rx)+aarx];
|
|
||||||
|
|
||||||
for (rb=0;rb<nb_rb_0;rb++) {
|
|
||||||
|
|
||||||
dl_ch128[0] = simde_mm_mulhi_epi16(dl_ch128[0], ch_amp128);
|
|
||||||
dl_ch128[0] = simde_mm_slli_epi16(dl_ch128[0], 3);
|
|
||||||
|
|
||||||
dl_ch128[1] = simde_mm_mulhi_epi16(dl_ch128[1], ch_amp128);
|
|
||||||
dl_ch128[1] = simde_mm_slli_epi16(dl_ch128[1], 3);
|
|
||||||
|
|
||||||
dl_ch128[2] = simde_mm_mulhi_epi16(dl_ch128[2], ch_amp128);
|
|
||||||
dl_ch128[2] = simde_mm_slli_epi16(dl_ch128[2], 3);
|
|
||||||
dl_ch128+=3;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void nr_dlsch_channel_level_median(uint32_t rx_size_symbol,
|
static void nr_dlsch_channel_level_median(uint32_t rx_size_symbol,
|
||||||
int32_t dl_ch_estimates_ext[][rx_size_symbol],
|
int32_t dl_ch_estimates_ext[][rx_size_symbol],
|
||||||
int32_t median[MAX_ANT][MAX_ANT],
|
int32_t median[MAX_ANT][MAX_ANT],
|
||||||
|
|||||||
@@ -364,6 +364,7 @@ void nr_channel_level(const int symbol,
|
|||||||
const int Nl,
|
const int Nl,
|
||||||
int32_t avg[nb_rx * Nl],
|
int32_t avg[nb_rx * Nl],
|
||||||
const uint32_t len);
|
const uint32_t len);
|
||||||
|
void nr_scale_channel(int size, int ch_estimates_ext[][size], int symb, uint32_t len, int nrOfLayers, int nb_rx, int shift_ch_ext);
|
||||||
bool generate_srs_nr(NR_DL_FRAME_PARMS *frame_parms,
|
bool generate_srs_nr(NR_DL_FRAME_PARMS *frame_parms,
|
||||||
c16_t **txdataF,
|
c16_t **txdataF,
|
||||||
uint16_t symbol_offset,
|
uint16_t symbol_offset,
|
||||||
|
|||||||
@@ -425,6 +425,33 @@ void nr_channel_level(const int symbol,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nr_scale_channel(int size, int ch_estimates_ext[][size], int symb, uint32_t len, int nrOfLayers, int nb_rx, int shift_ch_ext)
|
||||||
|
{
|
||||||
|
// Determine scaling amplitude based the symbol
|
||||||
|
int b = 3;
|
||||||
|
short ch_amp = 1024 * 8;
|
||||||
|
if (shift_ch_ext > 3) {
|
||||||
|
b = 0;
|
||||||
|
ch_amp >>= (shift_ch_ext - 3);
|
||||||
|
if (ch_amp == 0) {
|
||||||
|
ch_amp = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
b -= shift_ch_ext;
|
||||||
|
}
|
||||||
|
simde__m128i ch_amp128 = simde_mm_set1_epi16(ch_amp); // Q3.13
|
||||||
|
LOG_D(PHY, "Scaling channel est in OFDM symbol %d by %d\n", symb, ch_amp);
|
||||||
|
|
||||||
|
for (int l = 0; l < nrOfLayers; l++) {
|
||||||
|
for (int aarx = 0; aarx < nb_rx; aarx++) {
|
||||||
|
simde__m128i *ul_ch128 = (simde__m128i *)&ch_estimates_ext[l * nb_rx + aarx][symb * len];
|
||||||
|
for (int i = 0; i < len >> 2; i++) {
|
||||||
|
ul_ch128[i] = simde_mm_mulhi_epi16(ul_ch128[i], ch_amp128);
|
||||||
|
ul_ch128[i] = simde_mm_slli_epi16(ul_ch128[i], b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, const c16_t *rxdata_in, c16_t *rxdata_out, int size)
|
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, const c16_t *rxdata_in, c16_t *rxdata_out, int size)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user