Files
sdrpp/core/src/signal_path/dsp.h
2020-12-13 14:52:54 +01:00

44 lines
1.2 KiB
C++

#pragma once
#include <dsp/routing.h>
#include <dsp/vfo.h>
#include <map>
#include <dsp/sink.h>
class SignalPath {
public:
SignalPath();
void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream<dsp::complex_t>* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*,int,void*));
void start();
void stop();
void setSampleRate(double sampleRate);
double getSampleRate();
dsp::VFO* addVFO(std::string name, double outSampleRate, double bandwidth, double offset);
void removeVFO(std::string name);
void setInput(dsp::stream<dsp::complex_t>* input);
void bindIQStream(dsp::stream<dsp::complex_t>* stream);
void unbindIQStream(dsp::stream<dsp::complex_t>* stream);
void setFFTSize(int size);
void startFFT();
void stopFFT();
private:
struct VFO_t {
dsp::stream<dsp::complex_t>* inputStream;
dsp::VFO* vfo;
};
dsp::Splitter<dsp::complex_t> split;
// FFT
dsp::stream<dsp::complex_t> fftStream;
dsp::Reshaper<dsp::complex_t> reshape;
dsp::HandlerSink<dsp::complex_t> fftHandlerSink;
// VFO
std::map<std::string, VFO_t> vfos;
double sampleRate;
double fftRate;
int fftSize;
int inputBlockSize;
};