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:
parent
4d156044e4
commit
fd8e771543
@ -58,9 +58,15 @@ public:
|
||||
virtual bool handleMessage(const Message& cmd);
|
||||
|
||||
Real getMagSq() const { return m_movingAverage.average(); }
|
||||
|
||||
bool getPilotLock() const { return m_pilotPLL.locked(); }
|
||||
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:
|
||||
class MsgConfigureBFMDemod : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
@ -413,6 +413,13 @@ void BFMDemodGUI::channelSampleRateChanged()
|
||||
|
||||
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
|
||||
if (m_rdsParser.m_pi_updated)
|
||||
{
|
||||
@ -461,8 +468,7 @@ void BFMDemodGUI::rdsUpdate()
|
||||
{
|
||||
if (*it > 76.0)
|
||||
{
|
||||
if (!isFirst)
|
||||
{
|
||||
if (!isFirst) {
|
||||
os << ", ";
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>446</width>
|
||||
<width>514</width>
|
||||
<height>729</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -436,10 +436,16 @@
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<width>421</width>
|
||||
<height>91</height>
|
||||
<width>500</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>RDS data</string>
|
||||
</property>
|
||||
@ -447,6 +453,278 @@
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</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>
|
||||
<layout class="QGridLayout" name="countersLayout">
|
||||
<item row="0" column="0">
|
||||
|
@ -184,18 +184,21 @@ bool RDSDecoder::frameSync(bool bit)
|
||||
{
|
||||
if (m_wrongBlocksCounter > 35)
|
||||
{
|
||||
/*
|
||||
qDebug() << "RDSDecoder::frameSync: Lost Sync (Got " << m_wrongBlocksCounter
|
||||
<< " bad blocks on " << m_blocksCounter
|
||||
<< " total)";
|
||||
<< " total)";*/
|
||||
enter_no_sync();
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
qDebug() << "RDSDecoder::frameSync: Still Sync-ed (Got " << m_wrongBlocksCounter
|
||||
<< " bad blocks on " << m_blocksCounter
|
||||
<< " total)";
|
||||
<< " total)";*/
|
||||
}
|
||||
|
||||
m_qua = 2.0 * (50 - m_wrongBlocksCounter);
|
||||
m_blocksCounter = 0;
|
||||
m_wrongBlocksCounter = 0;
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ public:
|
||||
bool frameSync(bool bit);
|
||||
unsigned int *getGroup() { return m_group; }
|
||||
|
||||
float m_qua;
|
||||
|
||||
protected:
|
||||
unsigned int calc_syndrome(unsigned long message, unsigned char mlen);
|
||||
void enter_sync(unsigned int sync_block_number);
|
||||
|
@ -143,14 +143,18 @@ bool RDSDemod::biphase(Real acc, bool& bit, Real d_cphi)
|
||||
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",
|
||||
m_parms.reading_frame,
|
||||
acc,
|
||||
m_parms.tot_errs[0],
|
||||
m_parms.tot_errs[1],
|
||||
qua,
|
||||
(d_cphi / (2 * M_PI)) * m_srate);
|
||||
m_report.qua,
|
||||
m_report.fclk);*/
|
||||
|
||||
m_parms.tot_errs[0] = 0;
|
||||
m_parms.tot_errs[1] = 0;
|
||||
|
@ -34,6 +34,12 @@ public:
|
||||
void setSampleRate(int srate);
|
||||
bool process(Real rdsSample, bool &bit);
|
||||
|
||||
struct{
|
||||
Real acc;
|
||||
Real qua;
|
||||
Real fclk;
|
||||
} m_report;
|
||||
|
||||
protected:
|
||||
bool biphase(Real acc, bool &bit, Real d_cphi);
|
||||
Real filter_lp_2400_iq(Real in, int iqIndex);
|
||||
|
Loading…
Reference in New Issue
Block a user