mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-26 07:02:59 +00:00
Replace std::atan2 by gr::fast_atan2f in the phase discriminator
This commit is contained in:
parent
c5daae08f1
commit
322deecee8
@ -78,7 +78,7 @@ else()
|
|||||||
add_library(tracking_libs ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS})
|
add_library(tracking_libs ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(tracking_libs
|
target_link_libraries(tracking_libs
|
||||||
PUBLIC
|
PUBLIC
|
||||||
Armadillo::armadillo
|
Armadillo::armadillo
|
||||||
Boost::headers
|
Boost::headers
|
||||||
@ -89,6 +89,7 @@ target_link_libraries(tracking_libs
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
gnss_sdr_flags
|
gnss_sdr_flags
|
||||||
Glog::glog
|
Glog::glog
|
||||||
|
Gnuradio::runtime
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_CUDA)
|
if(ENABLE_CUDA)
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "tracking_discriminators.h"
|
#include "tracking_discriminators.h"
|
||||||
#include "MATH_CONSTANTS.h"
|
#include "MATH_CONSTANTS.h"
|
||||||
|
#include <gnuradio/math.h>
|
||||||
|
|
||||||
// All the outputs are in RADIANS
|
// 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 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();
|
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)
|
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()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user