- Receiver use C++ NCO

- Transmitter use C++ NCO and upsampler


git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@111 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2014-12-22 17:41:43 +00:00
parent 552f20fcd3
commit 90055961e8
4 changed files with 50 additions and 93 deletions
+7 -15
View File
@@ -270,9 +270,6 @@ void Receiver::free()
m_ReceiverEnable = false;
NCO_Free(&m_nco_ddc);
NCO_Free(&m_nco_cpr);
// Symbol demapper
if (m_pSymMapper)
{
@@ -363,7 +360,7 @@ void Receiver::timerCallback()
}
}
void Receiver::processPassband(float *pRF, uint32_t len)
void Receiver::processPassband(RVec const &rf, uint32_t len)
{
const ScopedLock sl (m_lock);
@@ -378,7 +375,7 @@ void Receiver::processPassband(float *pRF, uint32_t len)
test4normal = 0;
for (uint32_t i=0; i < len; i++)
{
test4normal += pRF[i];
test4normal += rf[i];
}
if (isnan(test4normal))
{
@@ -395,12 +392,7 @@ void Receiver::processPassband(float *pRF, uint32_t len)
// Digital Down Converter
// @samplerate
NCO_MixRealComplexV(&m_nco_ddc, m_pPassbandBuffer, pRF, 2/*m_params.agcGain[0]*/, len);
for (uint32_t i=0; i < len; i++)
{
m_passbandBuffer[i] = ComplexScalar(m_pPassbandBuffer[i].real, m_pPassbandBuffer[i].imag);
}
m_nco_ddc.mixRealComplexV(m_passbandBuffer, rf, RealScalar(2)/*m_params.agcGain[0]*/, len);
// Arm Filtering and downsampling
len_down = m_firArmDown.process(m_basebandBuffer, m_passbandBuffer, len);
@@ -502,8 +494,8 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
Vd = STRGardnerProcess(&m_SymbolTimingRevovery, IQ_agc);
// Carrier Derotator
IQ_cpr = NCO_MixComplexS(&m_nco_cpr, IQ_agc, Cpx(1,1));
NCO_Process(&m_nco_cpr, m_dOmega_vco, m_params.CPR_phase);
IQ_cpr = toCpx(m_nco_cpr.mixComplexS(toComplexScalar(IQ_agc), ComplexScalar(1,1)));
m_nco_cpr.process(m_dOmega_vco, m_params.CPR_phase);
if (TimingCorrectorIsSkip(&m_timing_corrector))
{
@@ -693,13 +685,13 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
void Receiver::initDDC()
{
NCO_Init(&m_nco_ddc, m_params.ddc_freq/m_params.samplerate, 0);
m_nco_ddc.init(m_params.ddc_freq/m_params.samplerate, 0);
}
void Receiver::initCPR()
{
PfdInit(&m_pfdCpr);
NCO_Init(&m_nco_cpr, 0, 0);
m_nco_cpr.init(0, 0);
LeadLagInit(&m_loop_filter_cpr, 0.0);
m_dOmega_vco = 0.0;
}