3#include "common/dsp/complex.h"
10 class PLLCarrierTrackingBlock :
public BlockSimple<complex_t, complex_t>
13 float p_loop_bw = 0.01;
15 float p_freq_min = -1;
18 float d_max_freq, d_min_freq;
19 float d_damping, d_loop_bw;
20 float d_alpha, d_beta;
21 float d_phase, d_freq;
24 uint32_t
process(complex_t *input, uint32_t nsamples, complex_t *output);
27 PLLCarrierTrackingBlock();
28 ~PLLCarrierTrackingBlock();
32 d_damping = sqrtf(2.0f) / 2.0f;
34 float denom = (1.0 + 2.0 * d_damping * d_loop_bw + d_loop_bw * d_loop_bw);
35 d_alpha = (4 * d_damping * d_loop_bw) / denom;
36 d_beta = (4 * d_loop_bw * d_loop_bw) / denom;
41 nlohmann::ordered_json p;
42 add_param_simple(p,
"loop_bw",
"float");
43 add_param_simple(p,
"freq_max",
"float");
44 add_param_simple(p,
"freq_min",
"float");
52 else if (key ==
"freq_max")
54 else if (key ==
"freq_min")
57 throw satdump_exception(key);
67 else if (key ==
"freq_max")
72 else if (key ==
"freq_min")
78 throw satdump_exception(key);
cfg_res_t
set_cfg status.
Definition block.h:241
uint32_t process(complex_t *input, uint32_t nsamples, complex_t *output)
Simplified "work" function, called automatically by work(). This takes away all boilerplate work usua...
Definition pll_carrier_tracking.cpp:16
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition pll_carrier_tracking.h:48
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition pll_carrier_tracking.h:30
cfg_res_t set_cfg(std::string key, nlohmann::json v)
Set parameters of the block from JSON, including potentially IO configurations for blocks that may ha...
Definition pll_carrier_tracking.h:60
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition pll_carrier_tracking.h:39