SatDump 2.0.0-alpha-520736c72
Loading...
Searching...
No Matches
samplerate_meter.h
1#pragma once
2
3#include "dsp/block.h"
4#include "dsp/block_simple.h"
5
6namespace satdump
7{
8 namespace ndsp
9 {
10 template <typename T>
11 class SamplerateMeterBlock : public BlockSimple<T, T>
12 {
13 private:
14 double last_timestamp = 0;
15 double samplecount = 0;
16
17 public:
18 double measured_samplerate;
19
20 public:
21 SamplerateMeterBlock();
22 ~SamplerateMeterBlock();
23
24 uint32_t process(T *input, uint32_t nsamples, T *output);
25
26 void init() {}
27
28 nlohmann::ordered_json get_cfg_list()
29 {
30 nlohmann::ordered_json p;
31 return p;
32 }
33
34 nlohmann::json get_cfg(std::string key) { throw satdump_exception(key); }
35
36 Block::cfg_res_t set_cfg(std::string key, nlohmann::json v)
37 {
38 throw satdump_exception(key);
39 return Block::RES_OK;
40 }
41 };
42 } // namespace ndsp
43} // namespace satdump
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 samplerate_meter.h:36
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition samplerate_meter.h:34
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition samplerate_meter.h:28
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition samplerate_meter.h:26
uint32_t process(T *input, uint32_t nsamples, T *output)
Simplified "work" function, called automatically by work(). This takes away all boilerplate work usua...
Definition samplerate_meter.cpp:22