Commit e026e201 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Avoid division by 0 for low noise scenario

parent 4e434ecf
...@@ -1174,8 +1174,8 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB, ...@@ -1174,8 +1174,8 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
} }
} }
*noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length) *noise_power = max(calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length)
+ calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length); + calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length), 1);
*snr = dB_fixed((int32_t)((*signal_power<<factor_bits)/(*noise_power))) - factor_dB; *snr = dB_fixed((int32_t)((*signal_power<<factor_bits)/(*noise_power))) - factor_dB;
......
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