1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-30 03:38:55 -05:00

Revert "BFM demod: implemented forward error correction in RDS decoder"

This reverts commit 444f829e29.
This commit is contained in:
f4exb 2015-12-20 19:30:58 +01:00
parent cae6c94770
commit 93571770bc
5 changed files with 5 additions and 90 deletions

View File

@ -64,7 +64,6 @@ public:
Real getPilotLevel() const { return m_pilotPLL.get_pilot_level(); } Real getPilotLevel() const { return m_pilotPLL.get_pilot_level(); }
Real getDecoderQua() const { return m_rdsDecoder.m_qua; } Real getDecoderQua() const { return m_rdsDecoder.m_qua; }
Real getDecoderCorr() const { return m_rdsDecoder.m_corr; }
bool getDecoderSynced() const { return m_rdsDecoder.synced(); } bool getDecoderSynced() const { return m_rdsDecoder.synced(); }
Real getDemodAcc() const { return m_rdsDemod.m_report.acc; } Real getDemodAcc() const { return m_rdsDemod.m_report.acc; }
Real getDemodQua() const { return m_rdsDemod.m_report.qua; } Real getDemodQua() const { return m_rdsDemod.m_report.qua; }

View File

@ -530,7 +530,6 @@ void BFMDemodGUI::rdsUpdate(bool force)
// Quality metrics // Quality metrics
ui->demodQText->setText(QString("%1 %").arg(m_bfmDemod->getDemodQua(), 0, 'f', 0)); ui->demodQText->setText(QString("%1 %").arg(m_bfmDemod->getDemodQua(), 0, 'f', 0));
ui->decoderQText->setText(QString("%1 %").arg(m_bfmDemod->getDecoderQua(), 0, 'f', 0)); ui->decoderQText->setText(QString("%1 %").arg(m_bfmDemod->getDecoderQua(), 0, 'f', 0));
ui->decoderCorrText->setText(QString("%1 %").arg(m_bfmDemod->getDecoderCorr(), 0, 'f', 0));
Real accDb = CalcDb::dbPower(std::fabs(m_bfmDemod->getDemodAcc())); Real accDb = CalcDb::dbPower(std::fabs(m_bfmDemod->getDemodAcc()));
ui->accumText->setText(QString("%1 dB").arg(accDb, 0, 'f', 1)); ui->accumText->setText(QString("%1 dB").arg(accDb, 0, 'f', 1));
ui->fclkText->setText(QString("%1 Hz").arg(m_bfmDemod->getDemodFclk(), 0, 'f', 2)); ui->fclkText->setText(QString("%1 Hz").arg(m_bfmDemod->getDemodFclk(), 0, 'f', 2));

View File

@ -553,25 +553,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="decoderCorrText">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Corrected blocks percentage</string>
</property>
<property name="text">
<string>0%</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item> <item>
<widget class="Line" name="sep2"> <widget class="Line" name="sep2">
<property name="orientation"> <property name="orientation">

View File

@ -16,7 +16,6 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <QDebug> #include <QDebug>
#include "boost/format.hpp"
#include "rdsdecoder.h" #include "rdsdecoder.h"
const unsigned int RDSDecoder::offset_pos[5] = {0,1,2,3,2}; const unsigned int RDSDecoder::offset_pos[5] = {0,1,2,3,2};
@ -32,32 +31,14 @@ RDSDecoder::RDSDecoder()
m_bitCounter = 0; m_bitCounter = 0;
m_lastseenOffset = 0; m_lastseenOffset = 0;
m_wrongBlocksCounter = 0; m_wrongBlocksCounter = 0;
m_correctedBlocksCounter = 0;
m_blocksCounter = 0; m_blocksCounter = 0;
m_blockBitCounter = 0; m_blockBitCounter = 0;
m_blockNumber = 0; m_blockNumber = 0;
m_groupAssemblyStarted = false; m_groupAssemblyStarted = false;
m_sync = SYNC; m_sync = SYNC;
m_groupGoodBlocksCounter = 0; m_groupGoodBlocksCounter = 0;
m_wrongBlocksCounter = 0;
m_goodBlock = false; m_goodBlock = false;
m_error_lut[0x200] = 0b1000000000000000;
m_error_lut[0x300] = 0b1100000000000000;
m_error_lut[0x180] = 0b0110000000000000;
m_error_lut[0x0c0] = 0b0011000000000000;
m_error_lut[0x060] = 0b0001100000000000;
m_error_lut[0x030] = 0b1000110000000000;
m_error_lut[0x018] = 0b1000011000000000;
m_error_lut[0x00c] = 0b1000001100000000;
m_error_lut[0x006] = 0b1000000110000000;
m_error_lut[0x003] = 0b1000000011000000;
m_error_lut[0x2dd] = 0b1000000001100000;
m_error_lut[0x3b2] = 0b1000000000110000;
m_error_lut[0x1d9] = 0b1000000000011000;
m_error_lut[0x230] = 0b1000000000001100;
m_error_lut[0x118] = 0b1000000000000110;
m_error_lut[0x08c] = 0b1000000000000011;
m_error_lut[0x046] = 0b1000000000000001;
} }
RDSDecoder::~RDSDecoder() RDSDecoder::~RDSDecoder()
@ -149,15 +130,8 @@ bool RDSDecoder::frameSync(bool bit)
} }
else else
{ {
if (err_corr(block_received_crc, block_calculated_crc, dataword)) m_wrongBlocksCounter++;
{ m_goodBlock = false;
m_correctedBlocksCounter++;
}
else
{
m_wrongBlocksCounter++;
m_goodBlock = false;
}
} }
} }
} }
@ -171,15 +145,8 @@ bool RDSDecoder::frameSync(bool bit)
} }
else else
{ {
if (err_corr(block_received_crc, block_calculated_crc, dataword)) m_wrongBlocksCounter++;
{ m_goodBlock = false;
m_correctedBlocksCounter++;
}
else
{
m_wrongBlocksCounter++;
m_goodBlock = false;
}
} }
} }
@ -232,10 +199,8 @@ bool RDSDecoder::frameSync(bool bit)
} }
m_qua = 2.0 * (50 - m_wrongBlocksCounter); m_qua = 2.0 * (50 - m_wrongBlocksCounter);
m_corr = 2.0 * m_correctedBlocksCounter;
m_blocksCounter = 0; m_blocksCounter = 0;
m_wrongBlocksCounter = 0; m_wrongBlocksCounter = 0;
m_correctedBlocksCounter = 0;
} }
} }
break; break;
@ -293,25 +258,3 @@ unsigned int RDSDecoder::calc_syndrome(unsigned long message, unsigned char mlen
return (reg & ((1<<plen)-1)); // select the bottom plen bits of reg return (reg & ((1<<plen)-1)); // select the bottom plen bits of reg
} }
bool RDSDecoder::err_corr(unsigned int received_crc, unsigned int calculated_crc, unsigned int& symbol)
{
unsigned int syn = received_crc ^ calculated_crc;
ui_lut_t::iterator lutIt = m_error_lut.find(syn);
if (lutIt != m_error_lut.end())
{
symbol ^= lutIt->second;
/*
unsigned int syncorr = calc_syndrome(symbol, 16);
std::string recstring = str(boost::format("%03X") % received_crc);
std::string calstring = str(boost::format("%03X") % calculated_crc);
std::string synstring = str(boost::format("%03X") % syn);
std::string corstring = str(boost::format("%03X") % syncorr);
qDebug() << "RDSDecoder::err_corr: " << recstring.c_str() << ":" << calstring.c_str() << ":" << synstring.c_str() << ":" << corstring.c_str();*/
return true;
}
else
{
return false;
}
}

View File

@ -18,8 +18,6 @@
#ifndef PLUGINS_CHANNEL_BFM_RDSDECODER_H_ #ifndef PLUGINS_CHANNEL_BFM_RDSDECODER_H_
#define PLUGINS_CHANNEL_BFM_RDSDECODER_H_ #define PLUGINS_CHANNEL_BFM_RDSDECODER_H_
#include <map>
class RDSDecoder class RDSDecoder
{ {
public: public:
@ -31,16 +29,13 @@ public:
bool synced() const { return m_sync == SYNC; } bool synced() const { return m_sync == SYNC; }
float m_qua; float m_qua;
float m_corr;
protected: protected:
unsigned int calc_syndrome(unsigned long message, unsigned char mlen); unsigned int calc_syndrome(unsigned long message, unsigned char mlen);
bool err_corr(unsigned int received_crc, unsigned int calculated_crc, unsigned int& symbol);
void enter_sync(unsigned int sync_block_number); void enter_sync(unsigned int sync_block_number);
void enter_no_sync(); void enter_no_sync();
private: private:
typedef std::map<unsigned int, unsigned int> ui_lut_t;
unsigned long m_reg; unsigned long m_reg;
enum { NO_SYNC, SYNC } m_sync; enum { NO_SYNC, SYNC } m_sync;
bool m_presync; bool m_presync;
@ -49,14 +44,12 @@ private:
unsigned char m_lastseenOffset; unsigned char m_lastseenOffset;
unsigned int m_blockBitCounter; unsigned int m_blockBitCounter;
unsigned int m_wrongBlocksCounter; unsigned int m_wrongBlocksCounter;
unsigned int m_correctedBlocksCounter;
unsigned int m_blocksCounter; unsigned int m_blocksCounter;
unsigned int m_groupGoodBlocksCounter; unsigned int m_groupGoodBlocksCounter;
unsigned char m_blockNumber; unsigned char m_blockNumber;
bool m_groupAssemblyStarted; bool m_groupAssemblyStarted;
bool m_goodBlock; bool m_goodBlock;
unsigned int m_group[4]; unsigned int m_group[4];
ui_lut_t m_error_lut;
/* see page 59, Annex C, table C.1 in the standard /* see page 59, Annex C, table C.1 in the standard
* offset word C' has been put at the end */ * offset word C' has been put at the end */