mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-12-03 07:08:08 +00:00
Switch to GNU Radio 3.7.x API
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@368 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
@@ -33,10 +33,8 @@ include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${GNURADIO_CORE_INCLUDE_DIRS}
|
||||
${GNURADIO_GRUEL_INCLUDE_DIRS}
|
||||
${VOLK_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(tracking_lib ${TRACKING_LIB_SOURCES})
|
||||
target_link_libraries(tracking_lib ${VOLK_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
|
||||
target_link_libraries(tracking_lib ${VOLK_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
@@ -33,7 +33,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
//#include <math.h>
|
||||
#include <cmath>
|
||||
#include "cordic.h"
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <gnuradio/gr_block.h>
|
||||
//#include <gnuradio/block.h>
|
||||
#include "correlator.h"
|
||||
|
||||
#define LV_HAVE_SSE3
|
||||
@@ -55,7 +55,7 @@ unsigned long Correlator::next_power_2(unsigned long v)
|
||||
|
||||
|
||||
|
||||
void Correlator::Carrier_wipeoff_and_EPL_generic(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out)
|
||||
void Correlator::Carrier_wipeoff_and_EPL_generic(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out)
|
||||
{
|
||||
gr_complex bb_signal_sample(0,0);
|
||||
|
||||
@@ -77,7 +77,7 @@ void Correlator::Carrier_wipeoff_and_EPL_generic(int signal_length_samples,const
|
||||
|
||||
|
||||
|
||||
void Correlator::Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_unaligned)
|
||||
void Correlator::Carrier_wipeoff_and_EPL_volk(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_unaligned)
|
||||
{
|
||||
gr_complex* bb_signal;
|
||||
//gr_complex* input_aligned;
|
||||
@@ -85,21 +85,23 @@ void Correlator::Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr
|
||||
//todo: do something if posix_memalign fails
|
||||
if (posix_memalign((void**)&bb_signal, 16, signal_length_samples * sizeof(gr_complex)) == 0) {};
|
||||
|
||||
if (input_vector_unaligned==true)
|
||||
{
|
||||
//todo: do something if posix_memalign fails
|
||||
//if (posix_memalign((void**)&input_aligned, 16, signal_length_samples * sizeof(gr_complex)) == 0){};
|
||||
//memcpy(input_aligned,input,signal_length_samples * sizeof(gr_complex));
|
||||
if (input_vector_unaligned == true)
|
||||
{
|
||||
//todo: do something if posix_memalign fails
|
||||
//if (posix_memalign((void**)&input_aligned, 16, signal_length_samples * sizeof(gr_complex)) == 0){};
|
||||
//memcpy(input_aligned,input,signal_length_samples * sizeof(gr_complex));
|
||||
|
||||
volk_32fc_x2_multiply_32fc_u(bb_signal, input, carrier, signal_length_samples);
|
||||
}else{
|
||||
/*
|
||||
* todo: There is a problem with the aligned version of volk_32fc_x2_multiply_32fc_a.
|
||||
* It crashes even if the is_aligned() work function returns true. Im keeping the unaligned version in both cases..
|
||||
*/
|
||||
//use directly the input vector
|
||||
volk_32fc_x2_multiply_32fc_u(bb_signal, input, carrier, signal_length_samples);
|
||||
}
|
||||
volk_32fc_x2_multiply_32fc_u(bb_signal, input, carrier, signal_length_samples);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* todo: There is a problem with the aligned version of volk_32fc_x2_multiply_32fc_a.
|
||||
* It crashes even if the is_aligned() work function returns true. Im keeping the unaligned version in both cases..
|
||||
*/
|
||||
//use directly the input vector
|
||||
volk_32fc_x2_multiply_32fc_u(bb_signal, input, carrier, signal_length_samples);
|
||||
}
|
||||
|
||||
volk_32fc_x2_dot_prod_32fc_a(E_out, bb_signal, E_code, signal_length_samples * sizeof(gr_complex));
|
||||
volk_32fc_x2_dot_prod_32fc_a(P_out, bb_signal, P_code, signal_length_samples * sizeof(gr_complex));
|
||||
@@ -112,12 +114,12 @@ void Correlator::Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr
|
||||
//}
|
||||
}
|
||||
|
||||
void Correlator::Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_unaligned)
|
||||
void Correlator::Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples, const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_unaligned)
|
||||
{
|
||||
volk_cw_epl_corr_u(input, carrier, E_code, P_code, L_code, E_out, P_out, L_out, signal_length_samples);
|
||||
}
|
||||
|
||||
void Correlator::Carrier_wipeoff_and_VEPL_volk(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* VE_code,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* VL_code,gr_complex* VE_out,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out,gr_complex* VL_out,bool input_vector_aligned)
|
||||
void Correlator::Carrier_wipeoff_and_VEPL_volk(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* VE_code, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* VL_code, gr_complex* VE_out, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, gr_complex* VL_out, bool input_vector_aligned)
|
||||
{
|
||||
gr_complex* bb_signal;
|
||||
gr_complex* input_aligned;
|
||||
@@ -125,17 +127,19 @@ void Correlator::Carrier_wipeoff_and_VEPL_volk(int signal_length_samples,const g
|
||||
//todo: do something if posix_memalign fails
|
||||
if (posix_memalign((void**)&bb_signal, 16, signal_length_samples * sizeof(gr_complex)) == 0) {};
|
||||
|
||||
if (input_vector_aligned==false)
|
||||
{
|
||||
//todo: do something if posix_memalign fails
|
||||
if (posix_memalign((void**)&input_aligned, 16, signal_length_samples * sizeof(gr_complex)) == 0){};
|
||||
memcpy(input_aligned,input,signal_length_samples * sizeof(gr_complex));
|
||||
if (input_vector_aligned == false)
|
||||
{
|
||||
//todo: do something if posix_memalign fails
|
||||
if (posix_memalign((void**)&input_aligned, 16, signal_length_samples * sizeof(gr_complex)) == 0){};
|
||||
memcpy(input_aligned,input,signal_length_samples * sizeof(gr_complex));
|
||||
|
||||
volk_32fc_x2_multiply_32fc_a(bb_signal, input_aligned, carrier, signal_length_samples);
|
||||
}else{
|
||||
//use directly the input vector
|
||||
volk_32fc_x2_multiply_32fc_a(bb_signal, input, carrier, signal_length_samples);
|
||||
}
|
||||
volk_32fc_x2_multiply_32fc_a(bb_signal, input_aligned, carrier, signal_length_samples);
|
||||
}
|
||||
else
|
||||
{
|
||||
//use directly the input vector
|
||||
volk_32fc_x2_multiply_32fc_a(bb_signal, input, carrier, signal_length_samples);
|
||||
}
|
||||
|
||||
volk_32fc_x2_dot_prod_32fc_a(VE_out, bb_signal, VE_code, signal_length_samples * sizeof(gr_complex));
|
||||
volk_32fc_x2_dot_prod_32fc_a(E_out, bb_signal, E_code, signal_length_samples * sizeof(gr_complex));
|
||||
@@ -144,16 +148,19 @@ void Correlator::Carrier_wipeoff_and_VEPL_volk(int signal_length_samples,const g
|
||||
volk_32fc_x2_dot_prod_32fc_a(VL_out, bb_signal, VL_code, signal_length_samples * sizeof(gr_complex));
|
||||
|
||||
free(bb_signal);
|
||||
if (input_vector_aligned==false)
|
||||
{
|
||||
free(input_aligned);
|
||||
}
|
||||
if (input_vector_aligned == false)
|
||||
{
|
||||
free(input_aligned);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void Correlator::cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a()
|
||||
{
|
||||
//
|
||||
struct volk_func_desc desc=volk_32fc_x2_dot_prod_32fc_a_get_func_desc();
|
||||
//struct volk_func_desc desc=volk_32fc_x2_dot_prod_32fc_a_get_func_desc();
|
||||
volk_func_desc_t desc = volk_32fc_x2_dot_prod_32fc_get_func_desc();
|
||||
|
||||
std::vector<std::string> arch_list;
|
||||
|
||||
for(int i = 0; i < desc.n_archs; ++i)
|
||||
@@ -187,7 +194,7 @@ void Correlator::cpu_arch_test_volk_32fc_x2_dot_prod_32fc_a()
|
||||
void Correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a()
|
||||
{
|
||||
//
|
||||
struct volk_func_desc desc = volk_32fc_x2_multiply_32fc_a_get_func_desc();
|
||||
volk_func_desc_t desc = volk_32fc_x2_multiply_32fc_a_get_func_desc();
|
||||
std::vector<std::string> arch_list;
|
||||
|
||||
for(int i = 0; i < desc.n_archs; ++i)
|
||||
@@ -218,7 +225,7 @@ void Correlator::cpu_arch_test_volk_32fc_x2_multiply_32fc_a()
|
||||
|
||||
std::cout << "Selected architecture for volk_32fc_x2_multiply_32fc_a_best_arch is " << this->volk_32fc_x2_multiply_32fc_a_best_arch << std::endl;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
Correlator::Correlator ()
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define GNSS_SDR_CORRELATOR_H_
|
||||
|
||||
#include <volk/volk.h>
|
||||
#include <gnuradio/gr_block.h>
|
||||
#include <gnuradio/gr_complex.h>
|
||||
|
||||
|
||||
/*!
|
||||
@@ -52,10 +52,10 @@
|
||||
class Correlator
|
||||
{
|
||||
public:
|
||||
void Carrier_wipeoff_and_EPL_generic(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out);
|
||||
void Carrier_wipeoff_and_EPL_volk(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out,bool input_vector_aligned);
|
||||
void Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out,bool input_vector_aligned);
|
||||
void Carrier_wipeoff_and_VEPL_volk(int signal_length_samples,const gr_complex* input, gr_complex* carrier,gr_complex* VE_code,gr_complex* E_code, gr_complex* P_code, gr_complex* L_code,gr_complex* VL_code,gr_complex* VE_out,gr_complex* E_out, gr_complex* P_out, gr_complex* L_out,gr_complex* VL_out,bool input_vector_unaligned);
|
||||
void Carrier_wipeoff_and_EPL_generic(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out);
|
||||
void Carrier_wipeoff_and_EPL_volk(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_aligned);
|
||||
void Carrier_wipeoff_and_EPL_volk_custom(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, bool input_vector_aligned);
|
||||
void Carrier_wipeoff_and_VEPL_volk(int signal_length_samples, const gr_complex* input, gr_complex* carrier, gr_complex* VE_code, gr_complex* E_code, gr_complex* P_code, gr_complex* L_code, gr_complex* VL_code, gr_complex* VE_out, gr_complex* E_out, gr_complex* P_out, gr_complex* L_out, gr_complex* VL_out, bool input_vector_unaligned);
|
||||
Correlator();
|
||||
~Correlator();
|
||||
private:
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include <gnuradio/gr_complex.h>
|
||||
#include <math.h>
|
||||
//#include <math.h>
|
||||
|
||||
/*
|
||||
* Signal-to-Noise (SNR) (\f$\rho\f$) estimator using the Signal-to-Noise Variance (SNV) estimator:
|
||||
|
||||
@@ -32,11 +32,9 @@
|
||||
|
||||
tcp_packet_data::tcp_packet_data()
|
||||
{
|
||||
|
||||
proc_pack_code_error = 0;
|
||||
proc_pack_code_error = 0;
|
||||
proc_pack_carr_error = 0;
|
||||
proc_pack_carrier_doppler_hz = 0;
|
||||
}
|
||||
|
||||
tcp_packet_data::~tcp_packet_data() {
|
||||
}
|
||||
tcp_packet_data::~tcp_packet_data() {}
|
||||
|
||||
@@ -53,7 +53,7 @@ void Tracking_2nd_PLL_filter::set_PLL_BW(float pll_bw_hz)
|
||||
{
|
||||
//Calculate filter coefficient values
|
||||
d_pllnoisebandwidth = pll_bw_hz;
|
||||
calculate_lopp_coef(&d_tau1_carr, &d_tau2_carr, d_pllnoisebandwidth, d_plldampingratio, 0.25);// Calculate filter coefficient values
|
||||
calculate_lopp_coef(&d_tau1_carr, &d_tau2_carr, d_pllnoisebandwidth, d_plldampingratio, 0.25); // Calculate filter coefficient values
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ void Tracking_2nd_PLL_filter::initialize()
|
||||
float Tracking_2nd_PLL_filter::get_carrier_nco(float PLL_discriminator)
|
||||
{
|
||||
float carr_nco;
|
||||
carr_nco = d_old_carr_nco+(d_tau2_carr/d_tau1_carr)*(PLL_discriminator - d_old_carr_error) + PLL_discriminator * (d_pdi_carr/d_tau1_carr);
|
||||
carr_nco = d_old_carr_nco + (d_tau2_carr/d_tau1_carr)*(PLL_discriminator - d_old_carr_error) + PLL_discriminator * (d_pdi_carr/d_tau1_carr);
|
||||
d_old_carr_nco = carr_nco;
|
||||
d_old_carr_error = PLL_discriminator;
|
||||
return carr_nco;
|
||||
@@ -84,7 +84,7 @@ Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter (float pdi_carr)
|
||||
{
|
||||
//--- PLL variables --------------------------------------------------------
|
||||
d_pdi_carr = pdi_carr;// Summation interval for carrier
|
||||
d_plldampingratio=0.65;
|
||||
d_plldampingratio = 0.65;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ Tracking_2nd_PLL_filter::Tracking_2nd_PLL_filter ()
|
||||
{
|
||||
//--- PLL variables --------------------------------------------------------
|
||||
d_pdi_carr = 0.001;// Summation interval for carrier
|
||||
d_plldampingratio=0.65;
|
||||
d_plldampingratio = 0.65;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -59,11 +59,12 @@ private:
|
||||
float d_old_carr_nco;
|
||||
|
||||
void calculate_lopp_coef(float* tau1,float* tau2, float lbw, float zeta, float k);
|
||||
|
||||
public:
|
||||
void set_PLL_BW(float pll_bw_hz); //! Set PLL loop bandwidth [Hz]
|
||||
void initialize();
|
||||
float get_carrier_nco(float PLL_discriminator);
|
||||
Tracking_2nd_PLL_filter(float pdi_carr);
|
||||
Tracking_2nd_PLL_filter(float pdi_carr);
|
||||
Tracking_2nd_PLL_filter();
|
||||
~Tracking_2nd_PLL_filter();
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "tracking_FLL_PLL_filter.h"
|
||||
#include <iostream>
|
||||
|
||||
void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz,float pll_bw_hz, int order)
|
||||
void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int order)
|
||||
{
|
||||
/*
|
||||
* Filter design (Kaplan 2nd ed., Pag. 181 Fig. 181)
|
||||
@@ -48,12 +48,12 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz,float pll_bw_hz, int or
|
||||
d_pll_b3 = 2.400;
|
||||
d_pll_a3 = 1.100;
|
||||
d_pll_a2 = 1.414;
|
||||
d_pll_w0p = pll_bw_hz/0.7845;
|
||||
d_pll_w0p2 = d_pll_w0p*d_pll_w0p;
|
||||
d_pll_w0p3 = d_pll_w0p2*d_pll_w0p;
|
||||
d_pll_w0p = pll_bw_hz / 0.7845;
|
||||
d_pll_w0p2 = d_pll_w0p * d_pll_w0p;
|
||||
d_pll_w0p3 = d_pll_w0p2 * d_pll_w0p;
|
||||
|
||||
d_pll_w0f = fll_bw_hz/0.53;
|
||||
d_pll_w0f2 = d_pll_w0f*d_pll_w0f;
|
||||
d_pll_w0f = fll_bw_hz / 0.53;
|
||||
d_pll_w0f2 = d_pll_w0f * d_pll_w0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -61,9 +61,9 @@ void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz,float pll_bw_hz, int or
|
||||
* 2nd order PLL with 1st order FLL assist
|
||||
*/
|
||||
d_pll_a2 = 1.414;
|
||||
d_pll_w0p = pll_bw_hz/0.53;
|
||||
d_pll_w0p2 = d_pll_w0p*d_pll_w0p;
|
||||
d_pll_w0f = fll_bw_hz/0.25;
|
||||
d_pll_w0p = pll_bw_hz / 0.53;
|
||||
d_pll_w0p2 = d_pll_w0p * d_pll_w0p;
|
||||
d_pll_w0f = fll_bw_hz / 0.25;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,9 +107,9 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float
|
||||
* 2nd order PLL with 1st order FLL assist
|
||||
*/
|
||||
float pll_w_new;
|
||||
pll_w_new = d_pll_w + PLL_discriminator * d_pll_w0p2 * correlation_time_s + FLL_discriminator * d_pll_w0f * correlation_time_s ;
|
||||
pll_w_new = d_pll_w + PLL_discriminator * d_pll_w0p2 * correlation_time_s + FLL_discriminator * d_pll_w0f * correlation_time_s;
|
||||
carrier_error_hz = 0.5 * (pll_w_new + d_pll_w) + d_pll_a2 * d_pll_w0p * PLL_discriminator;
|
||||
d_pll_w =pll_w_new;
|
||||
d_pll_w = pll_w_new;
|
||||
/*std::cout<<" d_pll_w = "<<carrier_error_hz<<
|
||||
", pll_w_new = "<<pll_w_new
|
||||
<<", PLL_discriminator=" <<PLL_discriminator
|
||||
|
||||
@@ -38,23 +38,23 @@ class Tracking_FLL_PLL_filter
|
||||
{
|
||||
private:
|
||||
// FLL + PLL filter parameters
|
||||
int d_order;
|
||||
float d_pll_w;
|
||||
float d_pll_w0p3;
|
||||
float d_pll_w0f2;
|
||||
float d_pll_x;
|
||||
float d_pll_a2;
|
||||
float d_pll_w0f;
|
||||
float d_pll_a3;
|
||||
float d_pll_w0p2;
|
||||
float d_pll_b3;
|
||||
float d_pll_w0p;
|
||||
int d_order;
|
||||
float d_pll_w;
|
||||
float d_pll_w0p3;
|
||||
float d_pll_w0f2;
|
||||
float d_pll_x;
|
||||
float d_pll_a2;
|
||||
float d_pll_w0f;
|
||||
float d_pll_a3;
|
||||
float d_pll_w0p2;
|
||||
float d_pll_b3;
|
||||
float d_pll_w0p;
|
||||
public:
|
||||
void set_params(float fll_bw_hz,float pll_bw_hz, int order);
|
||||
void initialize(float d_acq_carrier_doppler_hz);
|
||||
float get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s);
|
||||
Tracking_FLL_PLL_filter();
|
||||
~Tracking_FLL_PLL_filter();
|
||||
void set_params(float fll_bw_hz, float pll_bw_hz, int order);
|
||||
void initialize(float d_acq_carrier_doppler_hz);
|
||||
float get_carrier_error(float FLL_discriminator, float PLL_discriminator, float correlation_time_s);
|
||||
Tracking_FLL_PLL_filter();
|
||||
~Tracking_FLL_PLL_filter();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#include "tracking_discriminators.h"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
// All the outputs are in RADIANS
|
||||
/*
|
||||
@@ -46,10 +46,10 @@
|
||||
* \f$I_{PS2},Q_{PS2}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_2\f$. The output is in [radians/second].
|
||||
*/
|
||||
|
||||
float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2,float t1, float t2)
|
||||
float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, float t1, float t2)
|
||||
{
|
||||
float cross,dot;
|
||||
dot = prompt_s1.real()*prompt_s2.real() + prompt_s1.imag()*prompt_s2.imag();
|
||||
float cross, dot;
|
||||
dot = prompt_s1.real()*prompt_s2.real() + prompt_s1.imag()*prompt_s2.imag();
|
||||
cross = prompt_s1.real()*prompt_s2.imag() - prompt_s2.real()*prompt_s1.imag();
|
||||
return atan2(cross, dot) / (t2-t1);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ float dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1)
|
||||
float dll_nc_vemlp_normalized(gr_complex very_early_s1, gr_complex early_s1, gr_complex late_s1, gr_complex very_late_s1)
|
||||
{
|
||||
float P_early, P_late;
|
||||
P_early = std::sqrt(std::norm(very_early_s1)+std::norm(early_s1));
|
||||
P_late = std::sqrt(std::norm(very_late_s1)+std::norm(late_s1));
|
||||
P_early = std::sqrt(std::norm(very_early_s1) + std::norm(early_s1));
|
||||
P_late = std::sqrt(std::norm(very_late_s1) + std::norm(late_s1));
|
||||
return (P_early - P_late) / ((P_early + P_late));
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
* \f$I_{PS1},Q_{PS1}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_1\f$, and
|
||||
* \f$I_{PS2},Q_{PS2}\f$ are the inphase and quadrature prompt correlator outputs respectively at sample time \f$t_2\f$. The output is in [radians/second].
|
||||
*/
|
||||
float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2,float t1, float t2);
|
||||
float fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, float t1, float t2);
|
||||
|
||||
|
||||
/*! \brief PLL four quadrant arctan discriminator
|
||||
|
||||
Reference in New Issue
Block a user