- use Processor::Buffer for collecting symbol error

- Constellation diagram uses Processor::Buffer 

git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@1076 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-06-24 11:29:51 +00:00
parent 0795d0c75b
commit 4f19435059
5 changed files with 26 additions and 48 deletions
+6 -9
View File
@@ -141,19 +141,16 @@ void IQPlaneComponent::trackerPointDisable(uint32_t id)
m_trackerPoints[id].isEnabled = 0;
}
void IQPlaneComponent::pointAdd(sym_err_t *pPoint, uint32_t numPoints)
void IQPlaneComponent::pointAdd(Processor::Buffer<sym_err_t> &points)
{
uint32_t i;
uint32_t numFill;
if (m_numPoints >= m_maxNumPoints)
return;
numFill = (uint32_t)dmin(m_maxNumPoints-m_numPoints, numPoints);
for (i=0; i < numFill; i++)
{
m_pPointArray[m_numPoints++] = pPoint[i];
}
size_t nSyms = (uint32)dmin((float)128, (float)points.len());
size_t numFill = (uint32_t)dmin(m_maxNumPoints-m_numPoints, nSyms);
points.read(&m_pPointArray[m_numPoints], numFill);
points.consume(points.len());
m_numPoints += numFill;
}
float IQPlaneComponent::getScreenCoordX(float x)
+1 -1
View File
@@ -46,7 +46,7 @@ public:
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
void pointAdd(sym_err_t *pPoint, uint32_t numPoints);
void pointAdd(Processor::Buffer<sym_err_t> &points);
void trackerPointEnable(uint32_t id, juce::Colour color, cpx_t pos, float size);
void trackerPointDisable(uint32_t id);
//[/UserMethods]
+2 -11
View File
@@ -91,20 +91,11 @@ private:
void audioDeviceStopped();
void receiverDataChanged(Receiver *pObj)
{
uint32_t i;
uint32 nSyms;
sym_err_t *pSoftSyms;
nSyms = (uint32)dmin((float)128, (float)pObj->getNumSoftSym());
pSoftSyms = pObj->getSoftSyms();
m_pIQPlaneComponent->pointAdd(pSoftSyms, nSyms);
for (i=0; i < 4; i++)
m_pIQPlaneComponent->pointAdd(pObj->getSoftSyms());
for (size_t i=0; i < 4; i++)
{
m_pIQPlaneComponent->trackerPointEnable(i, juce::Colours::red, ((ReceiverInterface*)pObj)->getTracker(i), 15);
}
}
void handleMessage(String msg)
{
+13 -22
View File
@@ -41,7 +41,6 @@ Receiver::Receiver(LogHandler *pLogHandler)
: m_log(pLogHandler)
, m_pPassbandBuffer(0)
, m_pBasebandBuffer(0)
, m_pSymbolBuffer(0)
, m_ReceiverEnable(false)
, m_pDataListener(0)
, m_timingGenerator()
@@ -93,32 +92,21 @@ void Receiver::setBufSize(uint32 size)
if (m_pBasebandBuffer)
delete m_pBasebandBuffer;
if (m_pSymbolBuffer)
delete m_pSymbolBuffer;
m_pPassbandBuffer = new cpx_t[size];
m_pBasebandBuffer = new cpx_t[size];
m_pSymbolBuffer = new sym_err_t[size];
m_buf_symerr.resize(size);
m_buf_sym.resize(size);
}
m_bufsize = size;
m_buffer_agc.resize(200*size);
m_buffer_agc.resize(2*size);
m_buffer_ip.resize(size);
init();
}
uint32 Receiver::getNumSoftSym()
Processor::Buffer<sym_err_t>& Receiver::getSoftSyms()
{
return m_numSymsInBuffer;
}
sym_err_t Receiver::getSoftSym(uint32 index)
{
return m_pSymbolBuffer[index];
}
sym_err_t* Receiver::getSoftSyms()
{
return m_pSymbolBuffer;
return m_buf_symerr;
}
cpx_t Receiver::getTracker(uint32 index)
@@ -438,7 +426,7 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
symbol_t sym;
map_t sym_cma;
static map_t sym_dfe_off;
m_numSymsInBuffer = 0;
m_buf_symerr.clear();
if (!m_ReceiverEnable)
return;
@@ -631,11 +619,14 @@ void Receiver::processBaseband(CVec const &iq, uint32_t len)
IQ_hard_last = IQ_hard;
// Call frame receiver with current symbol
m_frameReceiver.process((symbol_t)sym);
m_frameReceiver.process(sym);
// Feed symbol buffer
m_pSymbolBuffer[m_numSymsInBuffer++] = sym_err;
// m_buf_sym.write(&sym, 1);
// Feed symbol error buffer
m_buf_symerr.write(&sym_err, 1);
// Update per-symbol statistic
SymStatUpDate(&m_sym_stat, sym, &sym_err);
if (m_pDataListener)
+4 -5
View File
@@ -335,9 +335,7 @@ public:
void processBaseband(radio_float_t *pI, radio_float_t *pQ, uint32_t len);
void processPassband(RVec const &rf, uint32_t len);
void setBufSize(uint32 size);
uint32 getNumSoftSym();
sym_err_t getSoftSym(uint32 index);
sym_err_t* getSoftSyms();
Processor::Buffer<sym_err_t>& getSoftSyms();
void initDefaultParams();
void addStatusListener(ReceiverStatusListener *pListener);
void addDataListener(ReceiverDataListener *pListener);
@@ -351,8 +349,9 @@ private:
CVec m_passbandBuffer;
CVec m_basebandBuffer;
sym_err_t *m_pSymbolBuffer;
uint32_t m_numSymsInBuffer;
Processor::Buffer<sym_err_t> m_buf_symerr;
Processor::Buffer<symbol_t> m_buf_sym;
uint32_t m_bufsize;
bool m_ReceiverEnable;
pfd_t m_pfdCpr;