SatDump 2.0.0-alpha-520736c72
Loading...
Searching...
No Matches
exponentiate.h
1#pragma once
2
3#include "dsp/block.h"
4#include "dsp/block_helpers.h"
5#include "dsp/block_simple.h"
6#include <cstdint>
7#include <volk/volk.h>
8#include <volk/volk_complex.h>
9
10namespace satdump
11{
12 namespace ndsp
13 {
14 class ExponentiateBlock : public BlockSimple<complex_t, complex_t>
15 {
16 private:
17 uint32_t p_expo = 2;
18 bool needs_reinit = false;
19
20 private:
21 uint32_t d_expo;
22
23 public:
24 ExponentiateBlock();
25 ~ExponentiateBlock();
26
27 void init() { d_expo = p_expo; }
28
29 uint32_t process(complex_t *input, uint32_t nsamples, complex_t *output);
30
31 nlohmann::ordered_json get_cfg_list()
32 {
33 nlohmann::ordered_json p;
34 add_param_simple(p, "expo", "uint");
35 return p;
36 }
37
38 nlohmann::json get_cfg(std::string key)
39 {
40 if (key == "expo")
41 return p_expo;
42 else
43 throw satdump_exception(key);
44 }
45
46 cfg_res_t set_cfg(std::string key, nlohmann::json v)
47 {
48 if (key == "expo")
49 {
50 p_expo = v;
51 needs_reinit = true;
52 }
53 else
54 throw satdump_exception(key);
55 return RES_OK;
56 }
57 };
58 } // namespace ndsp
59} // namespace satdump
cfg_res_t
set_cfg status.
Definition block.h:241
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition exponentiate.h:31
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition exponentiate.h:27
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition exponentiate.h:38
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 exponentiate.cpp:17
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 exponentiate.h:46