1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Replace std::atan2 by gr::fast_atan2f in the phase discriminator

This commit is contained in:
Carles Fernandez 2022-02-10 15:29:51 +01:00
parent c5daae08f1
commit 322deecee8
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,7 @@ else()
add_library(tracking_libs ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS})
endif()
target_link_libraries(tracking_libs
target_link_libraries(tracking_libs
PUBLIC
Armadillo::armadillo
Boost::headers
@ -89,6 +89,7 @@ target_link_libraries(tracking_libs
PRIVATE
gnss_sdr_flags
Glog::glog
Gnuradio::runtime
)
if(ENABLE_CUDA)

View File

@ -20,6 +20,7 @@
#include "tracking_discriminators.h"
#include "MATH_CONSTANTS.h"
#include <gnuradio/math.h>
// All the outputs are in RADIANS
@ -53,7 +54,7 @@ double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double
{
const float dot = prompt_s1.real() * prompt_s2.real() + prompt_s1.imag() * prompt_s2.imag();
const float cross = prompt_s1.real() * prompt_s2.imag() - prompt_s2.real() * prompt_s1.imag();
return std::atan2(cross, dot) / (t2 - t1);
return static_cast<double>(gr::fast_atan2f(cross, dot) / (t2 - t1));
}
@ -84,7 +85,7 @@ double fll_diff_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, doub
*/
double pll_four_quadrant_atan(gr_complex prompt_s1)
{
return static_cast<double>(std::atan2(prompt_s1.imag(), prompt_s1.real()));
return static_cast<double>(gr::fast_atan2f(prompt_s1.imag(), prompt_s1.real()));
}