3#include "common/dsp/complex.h"
10 class CostasBlock :
public Block
14 float loop_bw = 0.004;
15 float freq_limit = 1.0;
19 float phase = 0, freq = 0;
22 float freq_limit_min, freq_limit_max;
34 freq_limit_min = -freq_limit;
35 freq_limit_max = freq_limit;
40 float damping = sqrtf(2.0f) / 2.0f;
41 float denom = (1.0 + 2.0 * damping * loop_bw + loop_bw * loop_bw);
42 alpha = (4 * damping * loop_bw) / denom;
43 beta = (4 * loop_bw * loop_bw) / denom;
50 else if (key ==
"order")
52 else if (key ==
"freq_limit")
55 throw satdump_exception(key);
65 else if (key ==
"order")
67 else if (key ==
"freq_limit")
73 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
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition costas.h:32
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 costas.h:58
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition costas.h:46