Commit 5f194af9 authored by adk's avatar adk Committed by Thomas Schlichter

optimization and fixing PUSCH PTRS generation

parent 5e7d52d2
...@@ -240,14 +240,12 @@ uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t ...@@ -240,14 +240,12 @@ uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t
else else
k_RB_ref = n_rnti % (N_RB % K_ptrs); k_RB_ref = n_rnti % (N_RB % K_ptrs);
while (k > sc) { if (k < (k_RE_ref + k_RB_ref*NR_NB_SC_PER_RB + start_sc))
sc = (start_sc + k_RE_ref + (i*K_ptrs + k_RB_ref)*NR_NB_SC_PER_RB)%ofdm_symbol_size; return 0;
i++;
}
if (k == sc) 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; return 1;
else
return 0; return 0;
} }
...@@ -285,23 +283,17 @@ uint8_t is_ptrs_symbol(uint8_t l, ...@@ -285,23 +283,17 @@ uint8_t is_ptrs_symbol(uint8_t l,
uint16_t start_sc, uint16_t start_sc,
uint16_t ofdm_symbol_size, uint16_t ofdm_symbol_size,
pusch_dmrs_type_t pusch_dmrs_type, pusch_dmrs_type_t pusch_dmrs_type,
uint8_t resourceElementOffset) { uint8_t resourceElementOffset)
uint8_t is_ptrs_freq, is_ptrs_time; {
int16_t k_RE_ref; int16_t k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset);
is_ptrs_freq = 0; uint8_t is_ptrs_freq = is_ptrs_subcarrier(k, K_ptrs, n_rnti, N_RB, k_RE_ref, start_sc, ofdm_symbol_size);
is_ptrs_time = 0;
k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset);
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) if (is_ptrs_freq == 0)
return 0; return 0;
if (((ptrs_symbols>>l)&1) == 1) if (((ptrs_symbols>>l)&1) == 1)
is_ptrs_time = 1;
if (is_ptrs_time && is_ptrs_freq)
return 1; return 1;
else
return 0; return 0;
} }
......
...@@ -446,7 +446,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ...@@ -446,7 +446,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
} else if (is_ptrs == 1) { } else if (is_ptrs == 1) {
if (k == start_sc){ if (k == start_sc){
nr_modulation(pusch_dmrs[l][0], harq_process_ul_ue->nb_rb/2, DMRS_MOD_ORDER, mod_ptrs); nr_modulation(pusch_dmrs[l][0], harq_process_ul_ue->nb_rb, DMRS_MOD_ORDER, mod_ptrs);
} }
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (beta_ptrs*AMP*mod_ptrs[ptrs_idx<<1]) >> 15; ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (beta_ptrs*AMP*mod_ptrs[ptrs_idx<<1]) >> 15;
......
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