Commit eae301e5 authored by Ahmed Hussein's avatar Ahmed Hussein
Browse files

Fix regarding PTRS frequeny domain allocation

parent 6adc40bb
......@@ -151,7 +151,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
*
*********************************************************************/
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc) {
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size) {
uint16_t k_RB_ref;
......@@ -160,6 +160,9 @@ uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t
else
k_RB_ref = n_rnti % (N_RB % K_ptrs);
if (k < start_sc)
k += ofdm_symbol_size;
if ((k - k_RE_ref - k_RB_ref*NR_NB_SC_PER_RB - start_sc) % (K_ptrs*NR_NB_SC_PER_RB) == 0)
return 1;
......@@ -196,10 +199,11 @@ uint8_t is_ptrs_symbol(uint8_t l,
uint16_t ptrs_symbols,
uint16_t start_sc,
uint8_t pusch_dmrs_type,
uint8_t resourceElementOffset)
uint8_t resourceElementOffset,
uint16_t ofdm_symbol_size)
{
int16_t k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset);
uint8_t is_ptrs_freq = is_ptrs_subcarrier(k, K_ptrs, n_rnti, N_RB, k_RE_ref, start_sc);
uint8_t is_ptrs_freq = is_ptrs_subcarrier(k, K_ptrs, n_rnti, N_RB, k_RE_ref, start_sc, ofdm_symbol_size);
if (is_ptrs_freq == 0)
return 0;
......
......@@ -55,7 +55,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t L_ptrs,
uint16_t ul_dmrs_symb_pos);
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc);
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size);
uint8_t is_ptrs_symbol(uint8_t l,
uint16_t k,
......@@ -66,7 +66,8 @@ uint8_t is_ptrs_symbol(uint8_t l,
uint16_t ptrs_symbols,
uint16_t start_sc,
uint8_t pusch_dmrs_type,
uint8_t resourceElementOffset);
uint8_t resourceElementOffset,
uint16_t ofdm_symbol_size);
......
......@@ -230,7 +230,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
nfapi_nr_pusch_pdu_t *pusch_pdu,
NR_DL_FRAME_PARMS *frame_parms)
{
unsigned short start_re, re, nb_re_pusch, k;
unsigned short start_re, re, nb_re_pusch;
unsigned char aarx;
uint8_t K_ptrs;
uint32_t rxF_ext_index = 0;
......@@ -286,13 +286,8 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
if ( ((pusch_pdu->pdu_bit_map)>>2)& 0x01 ) {
if(((start_re + re) % frame_parms->ofdm_symbol_size) < start_re)
k = start_re + re;
else
k = (start_re + re) % frame_parms->ofdm_symbol_size;
is_ptrs_symbol_flag = is_ptrs_symbol(symbol,
k,
(start_re + re) % frame_parms->ofdm_symbol_size,
n_rnti,
pusch_pdu->rb_size,
aarx,
......@@ -300,7 +295,8 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
pusch_vars->ptrs_symbols,
start_re,
pusch_pdu->dmrs_config_type,
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset);
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
frame_parms->ofdm_symbol_size);
if (is_ptrs_symbol_flag == 1)
num_ptrs_symbols++;
......@@ -1082,7 +1078,8 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
gNB->pusch_vars[UE_id]->ptrs_symbols,
0,
rel15_ul->dmrs_config_type,
rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset);
rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
frame_parms->ofdm_symbol_size);
}
if (ptrs_symbol_flag == 1){
......
......@@ -106,7 +106,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
int32_t **txdataF;
uint16_t start_sc, start_rb;
int8_t Wf[2], Wt[2], l_prime[2], delta;
uint16_t rnti, n_dmrs, code_rate, number_dmrs_symbols, nb_rb, k, k_temp;
uint16_t rnti, n_dmrs, code_rate, number_dmrs_symbols, nb_rb, k;
uint8_t dmrs_type, nb_dmrs_re_per_rb, number_of_symbols, mcs, Nl;
int ap, start_symbol, Nid_cell, i;
int sample_offsetF, N_RE_prime, N_PRB_oh;
......@@ -396,13 +396,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
if ((harq_process_ul_ue->pusch_pdu.pdu_bit_map >> 2) & 0x01){
if(k < start_sc)
k_temp = k + frame_parms->ofdm_symbol_size;
else
k_temp = k;
is_ptrs = is_ptrs_symbol(l,
k_temp,
k,
rnti,
nb_rb,
ap,
......@@ -410,7 +405,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
ulsch_ue->ptrs_symbols,
start_sc,
dmrs_type,
ptrs_Uplink_Config->resourceElementOffset);
ptrs_Uplink_Config->resourceElementOffset,
frame_parms->ofdm_symbol_size);
}
if (is_dmrs == 1) {
......
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