Commit 28438ab5 authored by rmagueta's avatar rmagueta

Add ptrs_bit_map input in add_noise() function

parent a629feec
...@@ -1120,7 +1120,7 @@ int main(int argc, char **argv) ...@@ -1120,7 +1120,7 @@ int main(int argc, char **argv)
} else { } else {
multipath_tv_channel(gNB2UE, s_re, s_im, r_re, r_im, slot_length, 0); multipath_tv_channel(gNB2UE, s_re, s_im, r_re, r_im, slot_length, 0);
} }
add_noise(UE->common_vars.rxdata, (const double **) r_re, (const double **) r_im, sigma2, slot_length, slot_offset, ts, delay, pdu_bit_map, frame_parms->nb_antennas_rx); add_noise(UE->common_vars.rxdata, (const double **) r_re, (const double **) r_im, sigma2, slot_length, slot_offset, ts, delay, pdu_bit_map, 0x1, frame_parms->nb_antennas_rx);
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
nr_ue_scheduled_response(&scheduled_response); nr_ue_scheduled_response(&scheduled_response);
......
...@@ -1227,7 +1227,7 @@ int main(int argc, char **argv) ...@@ -1227,7 +1227,7 @@ int main(int argc, char **argv)
} }
multipath_channel(UE2gNB, s_re, s_im, r_re, r_im, slot_length, 0, (n_trials == 1) ? 1 : 0); multipath_channel(UE2gNB, s_re, s_im, r_re, r_im, slot_length, 0, (n_trials == 1) ? 1 : 0);
add_noise(rxdata, (const double **) r_re, (const double **) r_im, sigma, slot_length, slot_offset, ts, delay, pdu_bit_map, frame_parms->nb_antennas_rx); add_noise(rxdata, (const double **) r_re, (const double **) r_im, sigma, slot_length, slot_offset, ts, delay, pdu_bit_map, PUSCH_PDU_BITMAP_PUSCH_PTRS, frame_parms->nb_antennas_rx);
} /*End input_fd */ } /*End input_fd */
......
...@@ -156,6 +156,7 @@ void add_noise(c16_t **rxdata, ...@@ -156,6 +156,7 @@ void add_noise(c16_t **rxdata,
const double ts, const double ts,
const int delay, const int delay,
const uint16_t pdu_bit_map, const uint16_t pdu_bit_map,
const uint16_t ptrs_bit_map,
const uint8_t nb_antennas_rx) const uint8_t nb_antennas_rx)
{ {
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
...@@ -164,7 +165,7 @@ void add_noise(c16_t **rxdata, ...@@ -164,7 +165,7 @@ void add_noise(c16_t **rxdata,
rxd->r = r_re[ap][i] + sqrt(sigma / 2) * gaussZiggurat(0.0, 1.0); // convert to fixed point rxd->r = r_re[ap][i] + sqrt(sigma / 2) * gaussZiggurat(0.0, 1.0); // convert to fixed point
rxd->i = r_im[ap][i] + sqrt(sigma / 2) * gaussZiggurat(0.0, 1.0); rxd->i = r_im[ap][i] + sqrt(sigma / 2) * gaussZiggurat(0.0, 1.0);
/* Add phase noise if enabled */ /* Add phase noise if enabled */
if (pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { if (pdu_bit_map & ptrs_bit_map) {
phase_noise(ts, &rxdata[ap][slot_offset + i + delay].r, &rxdata[ap][slot_offset + i + delay].i); phase_noise(ts, &rxdata[ap][slot_offset + i + delay].r, &rxdata[ap][slot_offset + i + delay].i);
} }
} }
......
...@@ -389,6 +389,7 @@ void add_noise(c16_t **rxdata, ...@@ -389,6 +389,7 @@ void add_noise(c16_t **rxdata,
const double ts, const double ts,
const int delay, const int delay,
const uint16_t pdu_bit_map, const uint16_t pdu_bit_map,
const uint16_t ptrs_bit_map,
const uint8_t nb_antennas_rx); const uint8_t nb_antennas_rx);
/**\fn void multipath_channel(channel_desc_t *desc, /**\fn void multipath_channel(channel_desc_t *desc,
......
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