mirror of https://github.com/f4exb/sdrangel.git
DATV demod: small optimizations
This commit is contained in:
parent
63e2faf372
commit
d70f431ec2
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "datvdemodreport.h"
|
#include "datvdemodreport.h"
|
||||||
|
|
||||||
const unsigned int DATVDemodSink::m_rfFilterFftLength = 1024;
|
const unsigned int DATVDemodSink::m_rfFilterFftLength = 512;
|
||||||
|
|
||||||
DATVDemodSink::DATVDemodSink() :
|
DATVDemodSink::DATVDemodSink() :
|
||||||
m_blnNeedConfigUpdate(false),
|
m_blnNeedConfigUpdate(false),
|
||||||
|
@ -1199,10 +1199,8 @@ void DATVDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
|
||||||
{
|
{
|
||||||
float fltI;
|
float fltI;
|
||||||
float fltQ;
|
float fltQ;
|
||||||
leansdr::cf32 objIQ;
|
|
||||||
fftfilt::cmplx *objRF;
|
fftfilt::cmplx *objRF;
|
||||||
int intRFOut;
|
int intRFOut;
|
||||||
double magSq;
|
|
||||||
int lngWritable=0;
|
int lngWritable=0;
|
||||||
leansdr::s2_frame_receiver<leansdr::f32, leansdr::llr_ss> *objDemodulatorDVBS2 =
|
leansdr::s2_frame_receiver<leansdr::f32, leansdr::llr_ss> *objDemodulatorDVBS2 =
|
||||||
(leansdr::s2_frame_receiver<leansdr::f32, leansdr::llr_ss> *) m_objDemodulatorDVBS2;
|
(leansdr::s2_frame_receiver<leansdr::f32, leansdr::llr_ss> *) m_objDemodulatorDVBS2;
|
||||||
|
@ -1305,20 +1303,16 @@ void DATVDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
|
||||||
objC *= m_objNCO.nextIQ();
|
objC *= m_objNCO.nextIQ();
|
||||||
intRFOut = m_objRFFilter->runFilt(objC, &objRF); // filter RF before demod
|
intRFOut = m_objRFFilter->runFilt(objC, &objRF); // filter RF before demod
|
||||||
|
|
||||||
for (int intI = 0 ; intI < intRFOut; intI++)
|
for (int intI = 0 ; intI < intRFOut; intI++, objRF++)
|
||||||
{
|
{
|
||||||
objIQ.real(objRF->real());
|
m_objMagSqAverage(norm(*objRF));
|
||||||
objIQ.imag(objRF->imag());
|
|
||||||
magSq = objIQ.real() * objIQ.real() + objIQ.imag() * objIQ.imag();
|
|
||||||
m_objMagSqAverage(magSq);
|
|
||||||
|
|
||||||
objRF ++;
|
|
||||||
|
|
||||||
if (m_blnDVBInitialized
|
if (m_blnDVBInitialized
|
||||||
&& (p_rawiq_writer != nullptr)
|
&& (p_rawiq_writer != nullptr)
|
||||||
&& (m_objScheduler != nullptr))
|
&& (m_objScheduler != nullptr))
|
||||||
{
|
{
|
||||||
p_rawiq_writer->write(objIQ);
|
|
||||||
|
p_rawiq_writer->write(*objRF);
|
||||||
m_lngReadIQ++;
|
m_lngReadIQ++;
|
||||||
|
|
||||||
lngWritable = p_rawiq_writer->writable();
|
lngWritable = p_rawiq_writer->writable();
|
||||||
|
@ -1330,8 +1324,7 @@ void DATVDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
|
||||||
m_objScheduler->step();
|
m_objScheduler->step();
|
||||||
|
|
||||||
m_lngReadIQ = 0;
|
m_lngReadIQ = 0;
|
||||||
delete p_rawiq_writer;
|
p_rawiq_writer->reset();
|
||||||
p_rawiq_writer = new leansdr::pipewriter<leansdr::cf32>(*p_rawiq);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,6 +370,13 @@ struct pipewriter
|
||||||
*wr() = e;
|
*wr() = e;
|
||||||
written(1);
|
written(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset(unsigned long min_write = 1)
|
||||||
|
{
|
||||||
|
if (min_write > buf.min_write) {
|
||||||
|
buf.min_write = min_write;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convenience functions for working with optional pipes
|
// Convenience functions for working with optional pipes
|
||||||
|
|
Loading…
Reference in New Issue