diff --git a/Source/Receiver.cpp b/Source/Receiver.cpp index 497f326..30694c9 100644 --- a/Source/Receiver.cpp +++ b/Source/Receiver.cpp @@ -404,26 +404,20 @@ void Receiver::processPassband(float *pRF, uint32_t len) // Arm Filtering and downsampling len_down = m_firArmDown.process(m_basebandBuffer, m_passbandBuffer, len); - for (uint32_t i=0; i < len_down; i++) - { - m_pBasebandBuffer[i].real = m_basebandBuffer[i].real(); - m_pBasebandBuffer[i].imag = m_basebandBuffer[i].imag(); - } - processBaseband(m_pBasebandBuffer, len_down); + processBaseband(m_basebandBuffer, len_down); } void Receiver::processBaseband(float *pI, float *pQ, uint32_t len) { for (uint32_t i=0; i < len/2; i++) { - m_pBasebandBuffer[i].real = pI[2*i]; - m_pBasebandBuffer[i].imag = pQ[2*i]; + m_basebandBuffer[i] = ComplexScalar(pI[2*i], pQ[2*i]); } - processBaseband(m_pBasebandBuffer, len/2); + processBaseband(m_basebandBuffer, len/2); } // Baseband processing -void Receiver::processBaseband(cpx_t *pIF, uint32_t len) +void Receiver::processBaseband(CVec const &iq, uint32_t len) { const ScopedLock sl (m_lock); @@ -460,8 +454,8 @@ void Receiver::processBaseband(cpx_t *pIF, uint32_t len) // @2 x symbolrate for (n = 0; n < len; n++) { - SlidingVarProcess(&m_statistics.I_DDC, pIF[n].real); - SlidingVarProcess(&m_statistics.Q_DDC, pIF[n].imag); + SlidingVarProcess(&m_statistics.I_DDC, iq[n].real()); + SlidingVarProcess(&m_statistics.Q_DDC, iq[n].imag()); } #endif @@ -471,13 +465,13 @@ void Receiver::processBaseband(cpx_t *pIF, uint32_t len) if (RCF_TYPE == RCF_TYPE_POLYPHASE_DISCRETE) { // Matched filtering and interpolation - m_polyPhase.feed(toComplexScalar(pIF[n]), 1); + m_polyPhase.feed(iq[n], 1); } if (RCF_TYPE == RCF_TYPE_POLYPHASE_FARROW) { // Matched filtering and interpolation - m_farrow.feed(toComplexScalar(pIF[n]), 1); + m_farrow.feed(iq[n], 1); } do @@ -540,21 +534,21 @@ void Receiver::processBaseband(cpx_t *pIF, uint32_t len) // ----------------------------------------------------- // Equalizer Process samples // ----------------------------------------------------- - SlidingVarGet(&m_statistics.I_CPR); - ComplexScalar __IQ_cma = m_cma2.process(toComplexScalar(IQ_cpr)); - IQ_cma = toCpx(__IQ_cma); - - ComplexScalar __IQ_dfeOn = m_dfe_on2.process(toComplexScalar(IQ_cpr), toComplexScalar(IQ_hard_last)); - IQ_dfeOn = toCpx(__IQ_dfeOn); + ComplexScalar __IQ_cma; + ComplexScalar __IQ_dfeOn; IQ_eq = IQ_cpr; if (m_params.eq_mode == eq_mode_cma) { + __IQ_cma = m_cma2.process(toComplexScalar(IQ_cpr)); + IQ_cma = toCpx(__IQ_cma); IQ_eq = IQ_cma; } if (m_params.eq_mode == eq_mode_dfe) { + __IQ_dfeOn = m_dfe_on2.process(toComplexScalar(IQ_cpr), toComplexScalar(IQ_hard_last)); + IQ_dfeOn = toCpx(__IQ_dfeOn); IQ_eq = IQ_dfeOn; } diff --git a/Source/Receiver.h b/Source/Receiver.h index 8e90bcb..a39f2bc 100644 --- a/Source/Receiver.h +++ b/Source/Receiver.h @@ -342,9 +342,7 @@ private: params_t m_params; void timerCallback(); - void processBaseband(cpx_t *pIF, uint32_t len); - cpx_t processMatchedFilter(cpx_t x, int32_t m, radio_float_t mu); - int Farrow_open_coeff(ppip_farrow_cpx_t *pObj, const char *filename); + void processBaseband(CVec const &iq, uint32_t len); void minMaxInit(minmax_t *pObj, radio_float_t min_initial, radio_float_t max_initial) { pObj->min = min_initial;