SDRPlusPlus/core/src/signal_path/dsp.h

47 wiersze
1.2 KiB
C
Czysty Zwykły widok Historia

2020-06-10 16:52:07 +00:00
#pragma once
2020-06-22 14:45:57 +00:00
#include <dsp/filter.h>
#include <dsp/resampling.h>
#include <dsp/source.h>
#include <dsp/math.h>
#include <dsp/demodulator.h>
#include <dsp/routing.h>
#include <dsp/sink.h>
#include <dsp/correction.h>
#include <dsp/vfo.h>
2020-08-11 16:33:42 +00:00
#include <map>
#include <module.h>
2020-06-10 16:52:07 +00:00
class SignalPath {
public:
SignalPath();
2020-06-22 14:45:57 +00:00
void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*));
2020-06-10 16:52:07 +00:00
void start();
void setSampleRate(float sampleRate);
void setDCBiasCorrection(bool enabled);
void setFFTRate(float rate);
2020-08-11 16:33:42 +00:00
dsp::VFO* addVFO(std::string name, float outSampleRate, float bandwidth, float offset);
void removeVFO(std::string name);
2020-09-30 23:21:15 +00:00
void setInput(dsp::stream<dsp::complex_t>* input);
2020-06-10 16:52:07 +00:00
2020-08-11 16:33:42 +00:00
private:
struct VFO_t {
dsp::stream<dsp::complex_t>* inputStream;
dsp::VFO* vfo;
2020-06-15 13:53:45 +00:00
};
2020-06-22 14:45:57 +00:00
dsp::DCBiasRemover dcBiasRemover;
dsp::Splitter split;
2020-06-15 13:53:45 +00:00
// FFT
2020-06-22 14:45:57 +00:00
dsp::BlockDecimator fftBlockDec;
dsp::HandlerSink fftHandlerSink;
2020-06-15 13:53:45 +00:00
// VFO
2020-08-16 01:39:05 +00:00
dsp::DynamicSplitter<dsp::complex_t> dynSplit;
2020-08-11 16:33:42 +00:00
std::map<std::string, VFO_t> vfos;
2020-06-22 14:45:57 +00:00
2020-06-10 16:52:07 +00:00
float sampleRate;
float fftRate;
int fftSize;
2020-08-11 16:33:42 +00:00
int inputBlockSize;
2020-06-10 16:52:07 +00:00
};