mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
AM and NFM demods: improve signal meter with 50ms refresh rate
This commit is contained in:
parent
bc75ca7735
commit
79b4e6c945
@ -218,8 +218,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget
|
||||
m_channelMarker(this),
|
||||
m_basicSettingsShown(false),
|
||||
m_doApplySettings(true),
|
||||
m_squelchOpen(false),
|
||||
m_powerMeterTickCount(0)
|
||||
m_squelchOpen(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
@ -305,27 +304,18 @@ void AMDemodGUI::enterEvent(QEvent*)
|
||||
|
||||
void AMDemodGUI::tick()
|
||||
{
|
||||
if (m_powerMeterTickCount < 4) // 200 ms
|
||||
{
|
||||
m_powerMeterTickCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Real magsqAvg, magsqPeak;
|
||||
int nbMagsqSamples;
|
||||
m_amDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||
Real powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||
Real powDbPeak = CalcDb::dbPower(magsqPeak);
|
||||
Real magsqAvg, magsqPeak;
|
||||
int nbMagsqSamples;
|
||||
m_amDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||
Real powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||
Real powDbPeak = CalcDb::dbPower(magsqPeak);
|
||||
|
||||
ui->channelPowerMeter->levelChanged(
|
||||
(100.0f + powDbAvg) / 100.0f,
|
||||
(100.0f + powDbPeak) / 100.0f,
|
||||
nbMagsqSamples);
|
||||
ui->channelPowerMeter->levelChanged(
|
||||
(100.0f + powDbAvg) / 100.0f,
|
||||
(100.0f + powDbPeak) / 100.0f,
|
||||
nbMagsqSamples);
|
||||
|
||||
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||
|
||||
m_powerMeterTickCount = 0;
|
||||
}
|
||||
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||
|
||||
bool squelchOpen = m_amDemod->getSquelchOpen();
|
||||
|
||||
|
@ -61,7 +61,6 @@ private:
|
||||
DownChannelizer* m_channelizer;
|
||||
AMDemod* m_amDemod;
|
||||
bool m_squelchOpen;
|
||||
int m_powerMeterTickCount;
|
||||
|
||||
explicit AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~AMDemodGUI();
|
||||
|
@ -384,27 +384,18 @@ void NFMDemodGUI::blockApplySettings(bool block)
|
||||
|
||||
void NFMDemodGUI::tick()
|
||||
{
|
||||
if (m_powerMeterTickCount < 4) // 200 ms
|
||||
{
|
||||
m_powerMeterTickCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Real magsqAvg, magsqPeak;
|
||||
int nbMagsqSamples;
|
||||
m_nfmDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||
Real powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||
Real powDbPeak = CalcDb::dbPower(magsqPeak);
|
||||
Real magsqAvg, magsqPeak;
|
||||
int nbMagsqSamples;
|
||||
m_nfmDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||
Real powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||
Real powDbPeak = CalcDb::dbPower(magsqPeak);
|
||||
|
||||
ui->channelPowerMeter->levelChanged(
|
||||
(100.0f + powDbAvg) / 100.0f,
|
||||
(100.0f + powDbPeak) / 100.0f,
|
||||
nbMagsqSamples);
|
||||
ui->channelPowerMeter->levelChanged(
|
||||
(100.0f + powDbAvg) / 100.0f,
|
||||
(100.0f + powDbPeak) / 100.0f,
|
||||
nbMagsqSamples);
|
||||
|
||||
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||
|
||||
m_powerMeterTickCount = 0;
|
||||
}
|
||||
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||
|
||||
bool squelchOpen = m_nfmDemod->getSquelchOpen();
|
||||
|
||||
|
@ -69,7 +69,6 @@ private:
|
||||
bool m_ctcssOn;
|
||||
bool m_audioMute;
|
||||
bool m_squelchOpen;
|
||||
int m_powerMeterTickCount;
|
||||
|
||||
static const int m_rfBW[];
|
||||
static const int m_fmDev[];
|
||||
|
Loading…
Reference in New Issue
Block a user