3#include "common/dsp/complex.h"
4#include "common/dsp/utils/random.h"
6#include "dsp/block_helpers.h"
13 class WaveformBlock :
public Block
16 std::string p_waveform =
"cosine";
17 float p_samprate = 48000;
21 int p_buffer_size = 8192;
23 bool needs_reinit =
false;
26 std::string d_waveform;
47 nlohmann::ordered_json p;
48 add_param_list(p,
"waveform",
"list", {
"cosine",
"sine"},
"Waveform");
49 add_param_simple(p,
"waveform",
"string",
"Waveform");
50 add_param_simple(p,
"samprate",
"float",
"Samplerate");
51 add_param_simple(p,
"freq",
"float",
"Frequency");
52 add_param_simple(p,
"amp",
"float",
"Amplitude");
53 add_param_simple(p,
"phase",
"float",
"Phase");
54 add_param_simple(p,
"bufs",
"int",
"Buffer Size");
60 if (key ==
"waveform")
62 else if (key ==
"samprate")
64 else if (key ==
"freq")
66 else if (key ==
"amp")
68 else if (key ==
"phase")
70 else if (key ==
"bufs")
73 throw satdump_exception(key);
78 if (key ==
"waveform")
83 else if (key ==
"samprate")
88 else if (key ==
"freq")
93 else if (key ==
"amp")
98 else if (key ==
"phase")
103 else if (key ==
"bufs")
108 throw satdump_exception(key);
cfg_res_t
set_cfg status.
Definition block.h:241
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:208