- moved AGC training to 1 sps loop
git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@1007 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+25
-16
@@ -453,28 +453,15 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Blind AGC
|
// Blind AGC gain adjustment
|
||||||
// @2 x symbolrate
|
// @2 x symbolrate
|
||||||
// AGC Blind Training
|
|
||||||
Processor::Buffer<ComplexScalar> &next_buf_in = m_farrow.getInputBuffer();
|
Processor::Buffer<ComplexScalar> &next_buf_in = m_farrow.getInputBuffer();
|
||||||
if (m_params.agc_mode != agc_mode_disabled)
|
|
||||||
{
|
|
||||||
for (n = 0; n < len; n++)
|
|
||||||
{
|
|
||||||
// AGC Blind process samples
|
|
||||||
ComplexScalar iq_agc = toComplexScalar(CpxScaleRealS(toCpx(iq[n]), AGC_GetWeight(&agcBlind)));
|
|
||||||
AGC_Process(&agcBlind, CpxMagS(toCpx(iq_agc)), m_params.agcMu[m_params.agcMu_index], m_pSymMapper->R2_cma);
|
|
||||||
next_buf_in.write(&iq_agc, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (n = 0; n < len; n++)
|
for (n = 0; n < len; n++)
|
||||||
{
|
{
|
||||||
|
// AGC Blind gain adjustments
|
||||||
ComplexScalar iq_agc = toComplexScalar(CpxScaleRealS(toCpx(iq[n]), AGC_GetWeight(&agcBlind)));
|
ComplexScalar iq_agc = toComplexScalar(CpxScaleRealS(toCpx(iq[n]), AGC_GetWeight(&agcBlind)));
|
||||||
next_buf_in.write(&iq_agc, 1);
|
next_buf_in.write(&iq_agc, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Matched filtering and symbol timing recovery
|
// Matched filtering and symbol timing recovery
|
||||||
// @2 x symbolrate
|
// @2 x symbolrate
|
||||||
@@ -503,21 +490,36 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
|
|||||||
{
|
{
|
||||||
ComplexScalar iq_mf = buf_ip->readAt(0);
|
ComplexScalar iq_mf = buf_ip->readAt(0);
|
||||||
|
|
||||||
|
// -----------------------------------------------------
|
||||||
// Carrier Derotator
|
// Carrier Derotator
|
||||||
|
// @2 x symbolrate
|
||||||
|
// -----------------------------------------------------
|
||||||
IQ_cpr = toCpx(m_nco_cpr.mixComplexS(iq_mf, ComplexScalar(1,1)));
|
IQ_cpr = toCpx(m_nco_cpr.mixComplexS(iq_mf, ComplexScalar(1,1)));
|
||||||
m_nco_cpr.process(m_dOmega_vco, m_params.CPR_phase);
|
m_nco_cpr.process(m_dOmega_vco, m_params.CPR_phase);
|
||||||
|
|
||||||
IQ_eq_in = IQ_cpr;
|
IQ_eq_in = IQ_cpr;
|
||||||
|
|
||||||
// Operate at symbol clock
|
// -----------------------------------------------------
|
||||||
|
// Big and ugly processing loop
|
||||||
// @1 x symbolrate
|
// @1 x symbolrate
|
||||||
|
// -----------------------------------------------------
|
||||||
if (ClockIsTick(&m_symClock, 1))
|
if (ClockIsTick(&m_symClock, 1))
|
||||||
{
|
{
|
||||||
#ifndef DISABLE_UNUSED_STATISTICS
|
#ifndef DISABLE_UNUSED_STATISTICS
|
||||||
minMaxProcess(&m_statistics.ddcMinMax, IQ_eq_in);
|
minMaxProcess(&m_statistics.ddcMinMax, IQ_eq_in);
|
||||||
#endif
|
#endif
|
||||||
|
// -----------------------------------------------------
|
||||||
|
// AGC Blind process samples
|
||||||
|
// @1 x symbolrate
|
||||||
|
// -----------------------------------------------------
|
||||||
|
if (m_params.agc_mode != agc_mode_disabled)
|
||||||
|
{
|
||||||
|
AGC_Process(&agcBlind, CpxMagS(IQ_eq_in), m_params.agcMu[m_params.agcMu_index], m_pSymMapper->R2_cma);
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// Equalizer Process samples
|
// Equalizer Process samples
|
||||||
|
// @1 x symbolrate
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
ComplexScalar __IQ_cma;
|
ComplexScalar __IQ_cma;
|
||||||
ComplexScalar __IQ_dfeOn;
|
ComplexScalar __IQ_dfeOn;
|
||||||
@@ -539,7 +541,10 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
|
|||||||
|
|
||||||
IQ_soft = IQ_eq;
|
IQ_soft = IQ_eq;
|
||||||
|
|
||||||
|
// -----------------------------------------------------
|
||||||
// Map sympol
|
// Map sympol
|
||||||
|
// @1 x symbolrate
|
||||||
|
// -----------------------------------------------------
|
||||||
sym = SymMapDemap(m_pSymMapper, IQ_soft);
|
sym = SymMapDemap(m_pSymMapper, IQ_soft);
|
||||||
sym_err = SymMapGetError(m_pSymMapper, IQ_soft, sym);
|
sym_err = SymMapGetError(m_pSymMapper, IQ_soft, sym);
|
||||||
IQ_hard = sym_err.hard_sym;
|
IQ_hard = sym_err.hard_sym;
|
||||||
@@ -556,6 +561,7 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
|
|||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// Equalizer Training
|
// Equalizer Training
|
||||||
|
// @1 x symbolrate
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
sym_cma = SymMapGetSymbolInfo(m_pSymMapper, SymMapDemap(m_pSymMapper, IQ_cma));
|
sym_cma = SymMapGetSymbolInfo(m_pSymMapper, SymMapDemap(m_pSymMapper, IQ_cma));
|
||||||
if (m_params.cmaMode == cma_mode_training_enabled)
|
if (m_params.cmaMode == cma_mode_training_enabled)
|
||||||
@@ -607,7 +613,10 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
|
|||||||
// Update IQ_H
|
// Update IQ_H
|
||||||
IQ_hard_last = IQ_hard;
|
IQ_hard_last = IQ_hard;
|
||||||
|
|
||||||
|
// -----------------------------------------------------
|
||||||
// Lock-detector development
|
// Lock-detector development
|
||||||
|
// @1 x symbolrate
|
||||||
|
// -----------------------------------------------------
|
||||||
cpx_t winner_diff = Cpx(0,0);
|
cpx_t winner_diff = Cpx(0,0);
|
||||||
radio_float_t winner_d = 1000;
|
radio_float_t winner_d = 1000;
|
||||||
int winner_i = 0;
|
int winner_i = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user