3#include "common/dsp/block.h"
4#include "common/dsp/complex.h"
5#include "common/dsp/filter/firdes.h"
13 class HilbertBlock :
public Block
16 bool needs_reinit =
false;
18 int p_buffer_size = 8192 * 8;
22 float *buffer =
nullptr;
23 float *taps =
nullptr;
39 if (buffer !=
nullptr)
43 buffer = dsp::create_volk_buffer<float>(p_buffer_size);
44 buffer_size = p_buffer_size;
47 auto p_taps = dsp::firdes::hilbert(p_ntaps, dsp::fft::window::WIN_HAMMING, 6.76);
50 p_ntaps = p_taps.size();
51 taps = (
float *)volk_malloc(p_ntaps *
sizeof(
float), volk_get_alignment());
52 for (
int j = 0; j < p_ntaps; j++)
53 taps[j] = p_taps[(p_ntaps - 1) - j];
58 nlohmann::ordered_json p;
59 add_param_simple(p,
"ntaps",
"int");
67 else if (key ==
"buffer_size")
70 throw satdump_exception(key);
80 else if (key ==
"buffer_size")
83 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
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition hilbert.h:56
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 hilbert.h:73
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition hilbert.h:34
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition hilbert.h:63