2020-06-10 18:52:07 +02:00
|
|
|
#pragma once
|
2020-06-22 16:45:57 +02: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>
|
|
|
|
#include <io/audio.h>
|
2020-06-10 18:52:07 +02:00
|
|
|
|
|
|
|
class SignalPath {
|
|
|
|
public:
|
|
|
|
SignalPath();
|
2020-06-22 16:45:57 +02: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 18:52:07 +02:00
|
|
|
void start();
|
|
|
|
void setSampleRate(float sampleRate);
|
|
|
|
void setDCBiasCorrection(bool enabled);
|
|
|
|
void setFFTRate(float rate);
|
|
|
|
|
2020-06-15 15:53:45 +02:00
|
|
|
void setVFOFrequency(long frequency);
|
|
|
|
void setVolume(float volume);
|
|
|
|
|
|
|
|
void setDemodulator(int demod);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
DEMOD_FM,
|
2020-07-19 15:59:44 +02:00
|
|
|
DEMOD_NFM,
|
2020-06-15 15:53:45 +02:00
|
|
|
DEMOD_AM,
|
2020-07-19 15:59:44 +02:00
|
|
|
DEMOD_USB,
|
|
|
|
DEMOD_LSB,
|
2020-06-15 15:53:45 +02:00
|
|
|
_DEMOD_COUNT
|
|
|
|
};
|
|
|
|
|
2020-06-10 18:52:07 +02:00
|
|
|
private:
|
2020-06-22 16:45:57 +02:00
|
|
|
dsp::DCBiasRemover dcBiasRemover;
|
|
|
|
dsp::Splitter split;
|
2020-06-15 15:53:45 +02:00
|
|
|
|
|
|
|
// FFT
|
2020-06-22 16:45:57 +02:00
|
|
|
dsp::BlockDecimator fftBlockDec;
|
|
|
|
dsp::HandlerSink fftHandlerSink;
|
2020-06-15 15:53:45 +02:00
|
|
|
|
|
|
|
// VFO
|
2020-06-22 16:45:57 +02:00
|
|
|
dsp::VFO mainVFO;
|
2020-06-15 15:53:45 +02:00
|
|
|
|
2020-06-22 16:45:57 +02:00
|
|
|
// Demodulators
|
|
|
|
dsp::FMDemodulator demod;
|
|
|
|
dsp::AMDemodulator amDemod;
|
2020-07-19 15:59:44 +02:00
|
|
|
dsp::SSBDemod ssbDemod;
|
2020-06-15 15:53:45 +02:00
|
|
|
|
2020-06-22 16:45:57 +02:00
|
|
|
// Audio output
|
2020-07-19 15:59:44 +02:00
|
|
|
dsp::FloatFIRResampler audioResamp;
|
2020-06-22 16:45:57 +02:00
|
|
|
io::AudioSink audio;
|
|
|
|
|
2020-06-10 18:52:07 +02:00
|
|
|
float sampleRate;
|
|
|
|
float fftRate;
|
|
|
|
int fftSize;
|
2020-06-15 15:53:45 +02:00
|
|
|
int _demod;
|
2020-06-10 18:52:07 +02:00
|
|
|
};
|