3#include "common/dsp/complex.h"
4#include "common/dsp/utils/random.h"
13 class ChannelModelSimpleBlock :
public BlockSimple<complex_t, complex_t>
16 bool needs_reinit =
true;
18 double samplerate = 1e6;
19 double noise_level = -150;
20 double signal_level = -120;
21 double freq_shift = 0;
23 float curr_phase = 0, curr_freq = 0;
29 ChannelModelSimpleBlock();
30 ~ChannelModelSimpleBlock();
32 uint32_t
process(complex_t *input, uint32_t nsamples, complex_t *output);
38 nlohmann::ordered_json p;
39 add_param_simple(p,
"samplerate",
"float",
"Samplerate");
40 add_param_simple(p,
"noise_level",
"float",
"Noise Level (dBm)");
41 add_param_simple(p,
"signal_level",
"float",
"Signal Level (dBm)");
42 add_param_simple(p,
"freq_shift",
"float",
"Frequency Shift");
43 add_param_simple(p,
"d_alpha",
"float",
"Alpha");
49 if (key ==
"samplerate")
51 else if (key ==
"noise_level")
53 else if (key ==
"signal_level")
55 else if (key ==
"freq_shift")
57 else if (key ==
"alpha")
60 throw satdump_exception(key);
65 if (key ==
"samplerate")
70 else if (key ==
"noise_level")
74 else if (key ==
"signal_level")
78 else if (key ==
"freq_shift")
82 else if (key ==
"alpha")
87 throw satdump_exception(key);
cfg_res_t
set_cfg status.
Definition block.h:241
Block::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 channel_model_simple.h:63
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 channel_model_simple.cpp:17
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition channel_model_simple.h:34
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition channel_model_simple.h:47
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition channel_model_simple.h:36