Use srsran_convert_dB_to_power

Instead of computing power using the power function.
master
dvdgrgrtt 3 years ago committed by dvdgrgrtt
parent 3ffefe5ba7
commit c9beba6f36

@ -213,7 +213,7 @@ int main(int argc, char** argv)
// add some noise to the signal
if (snr != -1.0) {
float var = powf(10.0f, -snr / 10.0f);
float var = srsran_convert_dB_to_power(-snr);
srsran_ch_awgn_c(buff_ptrs[0], buff_ptrs[0], var, nread);
}

@ -166,7 +166,7 @@ int main(int argc, char** argv)
// ADD CHANNEL NOISE
if (snr < 50) {
float var = powf(10.0f, -snr / 10.0f);
float var = srsran_convert_dB_to_power(-snr);
srsran_ch_awgn_c(output_buffer, output_buffer, var, output_buffer_len);
}

Loading…
Cancel
Save