mirror of https://github.com/PentHertz/srsLTE.git
Use srsran_convert_dB_to_power
Instead of computing power using the power function.
This commit is contained in:
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…
Reference in New Issue