- use Farrow block
git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@1018 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+12
-14
@@ -46,6 +46,8 @@ Receiver::Receiver(LogHandler *pLogHandler)
|
|||||||
, m_pSymbolBuffer(0)
|
, m_pSymbolBuffer(0)
|
||||||
, m_ReceiverEnable(false)
|
, m_ReceiverEnable(false)
|
||||||
, m_pDataListener(0)
|
, m_pDataListener(0)
|
||||||
|
, m_timingGenerator()
|
||||||
|
, m_farrow(m_timingGenerator)
|
||||||
, m_frameReceiver(this)
|
, m_frameReceiver(this)
|
||||||
, m_pSymMapper(0)
|
, m_pSymMapper(0)
|
||||||
{
|
{
|
||||||
@@ -100,6 +102,7 @@ void Receiver::setBufSize(uint32 size)
|
|||||||
}
|
}
|
||||||
m_bufsize = size;
|
m_bufsize = size;
|
||||||
init();
|
init();
|
||||||
|
m_bb_buffer.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Receiver::getNumSoftSym()
|
uint32 Receiver::getNumSoftSym()
|
||||||
@@ -205,6 +208,9 @@ void Receiver::init()
|
|||||||
// Gardner Symbol Timing Recovery
|
// Gardner Symbol Timing Recovery
|
||||||
initSTR();
|
initSTR();
|
||||||
|
|
||||||
|
// Interpolation
|
||||||
|
m_farrow.buffer_out_add(&m_bb_buffer);
|
||||||
|
|
||||||
// Symbol demapper
|
// Symbol demapper
|
||||||
initSymbolMapper();
|
initSymbolMapper();
|
||||||
|
|
||||||
@@ -455,40 +461,32 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
|
|||||||
|
|
||||||
// Blind AGC gain adjustment
|
// Blind AGC gain adjustment
|
||||||
// @2 x symbolrate
|
// @2 x symbolrate
|
||||||
Processor::Buffer<ComplexScalar> &next_buf_in = m_farrow.getInputBuffer();
|
auto *next_buf_in = dynamic_cast<Processor::Buffer<ComplexScalar>*>(m_farrow.buffer_in());
|
||||||
for (n = 0; n < len; n++)
|
for (n = 0; n < len; n++)
|
||||||
{
|
{
|
||||||
// AGC Blind gain adjustments
|
// 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
|
||||||
Processor::Buffer<ComplexScalar> *buf_ip = nullptr;
|
|
||||||
if (RCF_TYPE == RCF_TYPE_POLYPHASE_FARROW)
|
if (RCF_TYPE == RCF_TYPE_POLYPHASE_FARROW)
|
||||||
{
|
{
|
||||||
// Farrow interpolation
|
// Farrow interpolation
|
||||||
m_farrow.process(m_timingGenerator);
|
m_farrow.process();
|
||||||
buf_ip = &m_farrow.getOutputBuffer();
|
|
||||||
}
|
}
|
||||||
if (RCF_TYPE == RCF_TYPE_POLYPHASE_DISCRETE)
|
if (RCF_TYPE == RCF_TYPE_POLYPHASE_DISCRETE)
|
||||||
{
|
{
|
||||||
// Polyphase interpolation
|
// Polyphase interpolation
|
||||||
// m_polyPhase.process(m_timingGenerator);
|
// m_polyPhase.process();
|
||||||
// buf_ip = &m_polyPhase.getOutputBuffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buf_ip == nullptr)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Further BB processing
|
// Further BB processing
|
||||||
// @2 x symbolrate
|
// @2 x symbolrate
|
||||||
while(buf_ip->len())
|
while(m_bb_buffer.len())
|
||||||
{
|
{
|
||||||
ComplexScalar iq_mf = buf_ip->readAt(0);
|
ComplexScalar iq_mf = m_bb_buffer.readAt(0);
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// Carrier Derotator
|
// Carrier Derotator
|
||||||
|
|||||||
+4
-3
@@ -360,6 +360,9 @@ private:
|
|||||||
// Filter
|
// Filter
|
||||||
Interpolation::DownSampler m_firArmDown;
|
Interpolation::DownSampler m_firArmDown;
|
||||||
|
|
||||||
|
// Gardner Symbol Timing Recovery
|
||||||
|
TimingGeneratorGardner m_timingGenerator;
|
||||||
|
|
||||||
// Interpolators
|
// Interpolators
|
||||||
Interpolation::PolyPhase m_polyPhase;
|
Interpolation::PolyPhase m_polyPhase;
|
||||||
Interpolation::Farrow m_farrow;
|
Interpolation::Farrow m_farrow;
|
||||||
@@ -372,9 +375,6 @@ private:
|
|||||||
lead_lag_filter_t m_loop_filter_str;
|
lead_lag_filter_t m_loop_filter_str;
|
||||||
lead_lag_filter_t m_loop_filter_cpr;
|
lead_lag_filter_t m_loop_filter_cpr;
|
||||||
|
|
||||||
// Gardner Symbol Timing Recovery
|
|
||||||
TimingGeneratorGardner m_timingGenerator;
|
|
||||||
|
|
||||||
// AGC
|
// AGC
|
||||||
// Blind
|
// Blind
|
||||||
agc_t agcBlind;
|
agc_t agcBlind;
|
||||||
@@ -398,6 +398,7 @@ private:
|
|||||||
|
|
||||||
FrameReceiver m_frameReceiver;
|
FrameReceiver m_frameReceiver;
|
||||||
params_t m_params;
|
params_t m_params;
|
||||||
|
Processor::Buffer<ComplexScalar> m_bb_buffer;
|
||||||
|
|
||||||
void timerCallback();
|
void timerCallback();
|
||||||
void processBaseband(CVec const &iq, uint32_t len);
|
void processBaseband(CVec const &iq, uint32_t len);
|
||||||
|
|||||||
Reference in New Issue
Block a user