From 4b2dfd488e755c1260fd14112c5cb50e14acd32c Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 11 Feb 2018 01:42:35 +0100 Subject: [PATCH] IQ imbalance fix: the I branch has to remain the reference --- sdrbase/dsp/dspdevicesourceengine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdrbase/dsp/dspdevicesourceengine.cpp b/sdrbase/dsp/dspdevicesourceengine.cpp index ad3d60908..176025e5d 100644 --- a/sdrbase/dsp/dspdevicesourceengine.cpp +++ b/sdrbase/dsp/dspdevicesourceengine.cpp @@ -234,8 +234,8 @@ void DSPDeviceSourceEngine::iqCorrections(SampleVector::iterator begin, SampleVe m_avgPhi(m_avgIQ.asDouble()/m_avgII.asDouble()); } - float yi = xi - m_avgPhi.asDouble()*xq; - float yq = xq; + float& yi = xi; // the in phase remains the reference + float yq = xq - m_avgPhi.asDouble()*xi; // amplitude I/Q imbalance m_avgII2(yi*yi); // @@ -246,7 +246,7 @@ void DSPDeviceSourceEngine::iqCorrections(SampleVector::iterator begin, SampleVe } // final correction - float zi = yi; + float& zi = yi; // the in phase remains the reference float zq = m_avgAmp.asDouble() * yq; // convert and store