- 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:
2022-06-16 19:25:45 +00:00
parent 13c3f23f5e
commit 7d7e3326f9
+28 -19
View File
@@ -453,27 +453,14 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
}
#endif
// Blind AGC
// Blind AGC gain adjustment
// @2 x symbolrate
// AGC Blind Training
Processor::Buffer<ComplexScalar> &next_buf_in = m_farrow.getInputBuffer();
if (m_params.agc_mode != agc_mode_disabled)
for (n = 0; n < len; n++)
{
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++)
{
ComplexScalar iq_agc = toComplexScalar(CpxScaleRealS(toCpx(iq[n]), AGC_GetWeight(&agcBlind)));
next_buf_in.write(&iq_agc, 1);
}
// AGC Blind gain adjustments
ComplexScalar iq_agc = toComplexScalar(CpxScaleRealS(toCpx(iq[n]), AGC_GetWeight(&agcBlind)));
next_buf_in.write(&iq_agc, 1);
}
// Matched filtering and symbol timing recovery
@@ -503,21 +490,36 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
{
ComplexScalar iq_mf = buf_ip->readAt(0);
// -----------------------------------------------------
// Carrier Derotator
// @2 x symbolrate
// -----------------------------------------------------
IQ_cpr = toCpx(m_nco_cpr.mixComplexS(iq_mf, ComplexScalar(1,1)));
m_nco_cpr.process(m_dOmega_vco, m_params.CPR_phase);
IQ_eq_in = IQ_cpr;
// Operate at symbol clock
// -----------------------------------------------------
// Big and ugly processing loop
// @1 x symbolrate
// -----------------------------------------------------
if (ClockIsTick(&m_symClock, 1))
{
#ifndef DISABLE_UNUSED_STATISTICS
minMaxProcess(&m_statistics.ddcMinMax, IQ_eq_in);
#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
// @1 x symbolrate
// -----------------------------------------------------
ComplexScalar __IQ_cma;
ComplexScalar __IQ_dfeOn;
@@ -539,7 +541,10 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
IQ_soft = IQ_eq;
// -----------------------------------------------------
// Map sympol
// @1 x symbolrate
// -----------------------------------------------------
sym = SymMapDemap(m_pSymMapper, IQ_soft);
sym_err = SymMapGetError(m_pSymMapper, IQ_soft, sym);
IQ_hard = sym_err.hard_sym;
@@ -556,6 +561,7 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
// -----------------------------------------------------
// Equalizer Training
// @1 x symbolrate
// -----------------------------------------------------
sym_cma = SymMapGetSymbolInfo(m_pSymMapper, SymMapDemap(m_pSymMapper, IQ_cma));
if (m_params.cmaMode == cma_mode_training_enabled)
@@ -607,7 +613,10 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
// Update IQ_H
IQ_hard_last = IQ_hard;
// -----------------------------------------------------
// Lock-detector development
// @1 x symbolrate
// -----------------------------------------------------
cpx_t winner_diff = Cpx(0,0);
radio_float_t winner_d = 1000;
int winner_i = 0;