2020-06-10 18:52:07 +02:00
|
|
|
#pragma once
|
|
|
|
#include <cdsp/filter.h>
|
|
|
|
#include <cdsp/resampling.h>
|
|
|
|
#include <cdsp/generator.h>
|
|
|
|
#include <cdsp/math.h>
|
2020-06-15 15:53:45 +02:00
|
|
|
#include <cdsp/demodulation.h>
|
|
|
|
#include <cdsp/audio.h>
|
|
|
|
#include <vfo.h>
|
2020-06-10 18:52:07 +02:00
|
|
|
|
|
|
|
class SignalPath {
|
|
|
|
public:
|
|
|
|
SignalPath();
|
2020-06-15 15:53:45 +02:00
|
|
|
void init(uint64_t sampleRate, int fftRate, int fftSize, cdsp::stream<cdsp::complex_t>* input, cdsp::complex_t* fftBuffer, void fftHandler(cdsp::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,
|
|
|
|
DEMOD_AM,
|
|
|
|
_DEMOD_COUNT
|
|
|
|
};
|
|
|
|
|
2020-06-10 18:52:07 +02:00
|
|
|
private:
|
|
|
|
cdsp::DCBiasRemover dcBiasRemover;
|
2020-06-15 15:53:45 +02:00
|
|
|
cdsp::Splitter split;
|
|
|
|
|
|
|
|
// FFT
|
2020-06-10 18:52:07 +02:00
|
|
|
cdsp::BlockDecimator fftBlockDec;
|
2020-06-15 15:53:45 +02:00
|
|
|
cdsp::HandlerSink fftHandlerSink;
|
|
|
|
|
|
|
|
// VFO
|
|
|
|
VFO mainVFO;
|
|
|
|
|
|
|
|
cdsp::FMDemodulator demod;
|
|
|
|
cdsp::AMDemodulator amDemod;
|
|
|
|
|
|
|
|
//cdsp::FloatDecimatingFIRFilter audioDecFilt;
|
|
|
|
cdsp::FractionalResampler audioResamp;
|
|
|
|
cdsp::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
|
|
|
};
|