1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-18 22:31:48 -05:00

BFM demod: RDS GUI part #2: quality metrics report

This commit is contained in:
f4exb 2015-12-14 03:01:44 +01:00
parent 4d156044e4
commit fd8e771543
7 changed files with 315 additions and 10 deletions

View File

@ -58,9 +58,15 @@ public:
virtual bool handleMessage(const Message& cmd); virtual bool handleMessage(const Message& cmd);
Real getMagSq() const { return m_movingAverage.average(); } Real getMagSq() const { return m_movingAverage.average(); }
bool getPilotLock() const { return m_pilotPLL.locked(); } bool getPilotLock() const { return m_pilotPLL.locked(); }
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 getDemodAcc() const { return m_rdsDemod.m_report.acc; }
Real getDemodQua() const { return m_rdsDemod.m_report.qua; }
Real getDemodFclk() const { return m_rdsDemod.m_report.fclk; }
private: private:
class MsgConfigureBFMDemod : public Message { class MsgConfigureBFMDemod : public Message {
MESSAGE_CLASS_DECLARATION MESSAGE_CLASS_DECLARATION

View File

@ -413,6 +413,13 @@ void BFMDemodGUI::channelSampleRateChanged()
void BFMDemodGUI::rdsUpdate() void BFMDemodGUI::rdsUpdate()
{ {
// Quality metrics
ui->demodQText->setText(QString::number(m_bfmDemod->getDemodQua(), 'f', 0));
ui->decoderQText->setText(QString("%1").arg(m_bfmDemod->getDecoderQua()));
Real accDb = CalcDb::dbPower(std::fabs(m_bfmDemod->getDemodAcc()));
ui->accumText->setText(QString::number(accDb, 'f', 1));
ui->fclkText->setText(QString::number(m_bfmDemod->getDemodFclk(), 'f', 2));
// PI group // PI group
if (m_rdsParser.m_pi_updated) if (m_rdsParser.m_pi_updated)
{ {
@ -461,8 +468,7 @@ void BFMDemodGUI::rdsUpdate()
{ {
if (*it > 76.0) if (*it > 76.0)
{ {
if (!isFirst) if (!isFirst) {
{
os << ", "; os << ", ";
} }

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>446</width> <width>514</width>
<height>729</height> <height>729</height>
</rect> </rect>
</property> </property>
@ -436,10 +436,16 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>150</y> <y>150</y>
<width>421</width> <width>500</width>
<height>91</height> <height>141</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>500</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>RDS data</string> <string>RDS data</string>
</property> </property>
@ -447,6 +453,278 @@
<property name="spacing"> <property name="spacing">
<number>3</number> <number>3</number>
</property> </property>
<item>
<layout class="QHBoxLayout" name="reportLayout">
<item>
<widget class="QLabel" name="demodQLabel">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Dem Q</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="demodQText">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="demodQUnits">
<property name="minimumSize">
<size>
<width>10</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>10</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>%</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="sep1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="decoderQLabel">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Dec Q</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="decoderQText">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="decoderQUnits">
<property name="minimumSize">
<size>
<width>10</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>10</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>%</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="sep2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="accumLabel">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Acc</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="accumText">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="accumUnits">
<property name="minimumSize">
<size>
<width>15</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>dB</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="sep3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fclkLabel">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Fclk</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fclkText">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>1187.50</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fclkUnits">
<property name="minimumSize">
<size>
<width>15</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>15</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Hz</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="reportSeparator">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<layout class="QGridLayout" name="countersLayout"> <layout class="QGridLayout" name="countersLayout">
<item row="0" column="0"> <item row="0" column="0">

View File

@ -184,18 +184,21 @@ bool RDSDecoder::frameSync(bool bit)
{ {
if (m_wrongBlocksCounter > 35) if (m_wrongBlocksCounter > 35)
{ {
/*
qDebug() << "RDSDecoder::frameSync: Lost Sync (Got " << m_wrongBlocksCounter qDebug() << "RDSDecoder::frameSync: Lost Sync (Got " << m_wrongBlocksCounter
<< " bad blocks on " << m_blocksCounter << " bad blocks on " << m_blocksCounter
<< " total)"; << " total)";*/
enter_no_sync(); enter_no_sync();
} }
else else
{ {
/*
qDebug() << "RDSDecoder::frameSync: Still Sync-ed (Got " << m_wrongBlocksCounter qDebug() << "RDSDecoder::frameSync: Still Sync-ed (Got " << m_wrongBlocksCounter
<< " bad blocks on " << m_blocksCounter << " bad blocks on " << m_blocksCounter
<< " total)"; << " total)";*/
} }
m_qua = 2.0 * (50 - m_wrongBlocksCounter);
m_blocksCounter = 0; m_blocksCounter = 0;
m_wrongBlocksCounter = 0; m_wrongBlocksCounter = 0;
} }

View File

@ -27,6 +27,8 @@ public:
bool frameSync(bool bit); bool frameSync(bool bit);
unsigned int *getGroup() { return m_group; } unsigned int *getGroup() { return m_group; }
float m_qua;
protected: protected:
unsigned int calc_syndrome(unsigned long message, unsigned char mlen); unsigned int calc_syndrome(unsigned long message, unsigned char mlen);
void enter_sync(unsigned int sync_block_number); void enter_sync(unsigned int sync_block_number);

View File

@ -143,14 +143,18 @@ bool RDSDemod::biphase(Real acc, bool& bit, Real d_cphi)
m_parms.reading_frame = 1 - m_parms.reading_frame; m_parms.reading_frame = 1 - m_parms.reading_frame;
} }
Real qua = (1.0 * abs(m_parms.tot_errs[0] - m_parms.tot_errs[1]) / (m_parms.tot_errs[0] + m_parms.tot_errs[1])) * 100; m_report.qua = (1.0 * abs(m_parms.tot_errs[0] - m_parms.tot_errs[1]) / (m_parms.tot_errs[0] + m_parms.tot_errs[1])) * 100;
m_report.acc = acc;
m_report.fclk = (d_cphi / (2 * M_PI)) * m_srate;
/*
qDebug("RDSDemod::biphase: frame: %d acc: %+6.3f errs: %3d %3d qual: %3.0f%% clk: %7.2f", qDebug("RDSDemod::biphase: frame: %d acc: %+6.3f errs: %3d %3d qual: %3.0f%% clk: %7.2f",
m_parms.reading_frame, m_parms.reading_frame,
acc, acc,
m_parms.tot_errs[0], m_parms.tot_errs[0],
m_parms.tot_errs[1], m_parms.tot_errs[1],
qua, m_report.qua,
(d_cphi / (2 * M_PI)) * m_srate); m_report.fclk);*/
m_parms.tot_errs[0] = 0; m_parms.tot_errs[0] = 0;
m_parms.tot_errs[1] = 0; m_parms.tot_errs[1] = 0;

View File

@ -34,6 +34,12 @@ public:
void setSampleRate(int srate); void setSampleRate(int srate);
bool process(Real rdsSample, bool &bit); bool process(Real rdsSample, bool &bit);
struct{
Real acc;
Real qua;
Real fclk;
} m_report;
protected: protected:
bool biphase(Real acc, bool &bit, Real d_cphi); bool biphase(Real acc, bool &bit, Real d_cphi);
Real filter_lp_2400_iq(Real in, int iqIndex); Real filter_lp_2400_iq(Real in, int iqIndex);