added invert iq option

This commit is contained in:
AlexandreRouma
2022-09-27 15:43:33 +02:00
parent f49fbd2a73
commit c95c7b18af
4 changed files with 20 additions and 0 deletions

View File

@ -31,10 +31,12 @@ void IQFrontEnd::init(dsp::stream<dsp::complex_t>* in, double sampleRate, bool b
decim.init(NULL, _decimRatio);
dcBlock.init(NULL, genDCBlockRate(effectiveSr));
conjugate.init(NULL);
preproc.init(&inBuf.out);
preproc.addBlock(&decim, _decimRatio > 1);
preproc.addBlock(&dcBlock, dcBlocking);
preproc.addBlock(&conjugate, false); // TODO: Replace by parameter
split.init(preproc.out);
@ -123,6 +125,10 @@ void IQFrontEnd::setDCBlocking(bool enabled) {
preproc.setBlockEnabled(&dcBlock, enabled, [=](dsp::stream<dsp::complex_t>* out){ split.setInput(out); });
}
void IQFrontEnd::setInvertIQ(bool enabled) {
preproc.setBlockEnabled(&conjugate, enabled, [=](dsp::stream<dsp::complex_t>* out){ split.setInput(out); });
}
void IQFrontEnd::bindIQStream(dsp::stream<dsp::complex_t>* stream) {
split.bindStream(stream);
}

View File

@ -7,6 +7,7 @@
#include "../dsp/routing/splitter.h"
#include "../dsp/channel/rx_vfo.h"
#include "../dsp/sink/handler_sink.h"
#include "../dsp/math/conjugate.h"
#include <fftw3.h>
class IQFrontEnd {
@ -27,6 +28,7 @@ public:
void setBuffering(bool enabled);
void setDecimation(int ratio);
void setInvertIQ(bool enabled);
void setDCBlocking(bool enabled);
void bindIQStream(dsp::stream<dsp::complex_t>* stream);
@ -65,6 +67,7 @@ protected:
// Pre-processing chain
dsp::multirate::PowerDecimator<dsp::complex_t> decim;
dsp::math::Conjugate conjugate;
dsp::correction::DCBlocker<dsp::complex_t> dcBlock;
dsp::chain<dsp::complex_t> preproc;