From c8d27eb97cb787be8b1093046d233557df9a7640 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 19 Mar 2019 20:37:42 +0100 Subject: [PATCH] Move contructor to the beginning of the file --- .../tracking/libs/tracking_FLL_PLL_filter.cc | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc index 04624d3f4..665ab29e6 100644 --- a/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc +++ b/src/algorithms/tracking/libs/tracking_FLL_PLL_filter.cc @@ -32,7 +32,26 @@ */ #include "tracking_FLL_PLL_filter.h" -#include + + +Tracking_FLL_PLL_filter::Tracking_FLL_PLL_filter() +{ + d_order = 0; + d_pll_w = 0.0; + d_pll_w0p3 = 0.0; + d_pll_w0f2 = 0.0; + d_pll_x = 0.0; + d_pll_a2 = 0.0; + d_pll_w0f = 0.0; + d_pll_a3 = 0.0; + d_pll_w0p2 = 0.0; + d_pll_b3 = 0.0; + d_pll_w0p = 0.0; +} + + +Tracking_FLL_PLL_filter::~Tracking_FLL_PLL_filter() = default; + void Tracking_FLL_PLL_filter::set_params(float fll_bw_hz, float pll_bw_hz, int order) { @@ -89,7 +108,7 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float if (d_order == 3) { /* - * 3rd order PLL with 2nd order FLL assist + * 3rd order PLL with 2nd order FLL assist */ d_pll_w = d_pll_w + correlation_time_s * (d_pll_w0p3 * PLL_discriminator + d_pll_w0f2 * FLL_discriminator); d_pll_x = d_pll_x + correlation_time_s * (0.5 * d_pll_w + d_pll_a2 * d_pll_w0f * FLL_discriminator + d_pll_a3 * d_pll_w0p2 * PLL_discriminator); @@ -104,31 +123,11 @@ float Tracking_FLL_PLL_filter::get_carrier_error(float FLL_discriminator, float 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; - /*std::cout<<" d_pll_w = "<