Use srsran_convert_dB_to_power

Instead of computing power using the power function.
This commit is contained in:
dvdgrgrtt 2022-01-17 10:08:33 +01:00 committed by dvdgrgrtt
parent 3ffefe5ba7
commit c9beba6f36
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}