#pragma once #include #include #include #include #include #include #include #include #include #include class SignalPath { public: SignalPath(); void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*)); void start(); void setSampleRate(float sampleRate); void setDCBiasCorrection(bool enabled); void setFFTRate(float rate); void setVFOFrequency(long frequency); void setVolume(float volume); void setDemodulator(int demod); enum { DEMOD_FM, DEMOD_NFM, DEMOD_AM, DEMOD_USB, DEMOD_LSB, _DEMOD_COUNT }; private: dsp::DCBiasRemover dcBiasRemover; dsp::Splitter split; // FFT dsp::BlockDecimator fftBlockDec; dsp::HandlerSink fftHandlerSink; // VFO dsp::VFO mainVFO; // Demodulators dsp::FMDemodulator demod; dsp::AMDemodulator amDemod; dsp::SSBDemod ssbDemod; // Audio output dsp::FloatFIRResampler audioResamp; io::AudioSink audio; float sampleRate; float fftRate; int fftSize; int _demod; };