3#include "common/dsp/complex.h"
4#include "common/dsp/resamp/polyphase_bank.h"
12 class MMClockRecoveryBlock :
public Block
16 float p_omegaGain = pow(8.7e-3, 2) / 4.0;
18 float p_muGain = 8.7e-3;
19 float p_omegaLimit = 0.005;
23 bool needs_reinit =
false;
34 float omega_relative_limit;
41 complex_t p_2T, p_1T, p_0T;
42 complex_t c_2T, c_1T, c_0T;
44 dsp::PolyphaseBank pfb;
46 float phase_error = 0;
54 MMClockRecoveryBlock();
55 ~MMClockRecoveryBlock();
61 nlohmann::ordered_json p;
62 add_param_simple(p,
"omega",
"float");
63 add_param_simple(p,
"omegaGain",
"float");
64 add_param_simple(p,
"mu",
"float");
65 add_param_simple(p,
"muGain",
"float");
66 add_param_simple(p,
"omegaLimit",
"float");
67 add_param_simple(p,
"nfilt",
"int");
68 add_param_simple(p,
"ntaps",
"int");
76 else if (key ==
"omegaGain")
80 else if (key ==
"muGain")
82 else if (key ==
"omegaLimit")
84 else if (key ==
"nfilt")
86 else if (key ==
"ntaps")
89 throw satdump_exception(key);
99 else if (key ==
"omegaGain")
104 else if (key ==
"mu")
109 else if (key ==
"muGain")
114 else if (key ==
"omegaLimit")
119 else if (key ==
"nfilt")
124 else if (key ==
"ntaps")
130 throw satdump_exception(key);
cfg_res_t
set_cfg status.
Definition block.h:227
virtual bool work()=0
The actual looping work function meant to handle all the DSP (well, in most blocks)
Block(std::string id, std::vector< BlockIO > in={}, std::vector< BlockIO > out={})
Generic constructor, to be overloaded.
Definition block.h:206
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 clock_recovery_mm.h:92
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition clock_recovery_mm.h:59
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition clock_recovery_mm.h:72
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition clock_recovery_mm.cpp:29