1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-04-09 12:16:46 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2019-09-17 07:56:34 +02:00
commit a06491950b
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -122,12 +122,16 @@ float cn0_mm_estimator(const gr_complex* Prompt_buffer, int length, float coh_in
m_2 /= n;
m_4 /= n;
aux = std::sqrt(2.0 * m_2 * m_2 - m_4);
SNR_aux = aux / (m_2 - aux);
SNR_dB_Hz = 10.0 * std::log10(SNR_aux) - 10.0 * std::log10(coh_integration_time_s);
if (std::isnan(SNR_dB_Hz))
if (std::isnan(aux))
{
SNR_dB_Hz = Psig / (m_2 - Psig);
SNR_aux = Psig / (m_2 - Psig);
}
else
{
SNR_aux = aux / (m_2 - aux);
}
SNR_dB_Hz = 10.0 * std::log10(SNR_aux) - 10.0 * std::log10(coh_integration_time_s);
return SNR_dB_Hz;
}