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_channelMarker(this),
|
||||||
m_basicSettingsShown(false),
|
m_basicSettingsShown(false),
|
||||||
m_doApplySettings(true),
|
m_doApplySettings(true),
|
||||||
m_squelchOpen(false),
|
m_squelchOpen(false)
|
||||||
m_powerMeterTickCount(0)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
@ -305,27 +304,18 @@ void AMDemodGUI::enterEvent(QEvent*)
|
|||||||
|
|
||||||
void AMDemodGUI::tick()
|
void AMDemodGUI::tick()
|
||||||
{
|
{
|
||||||
if (m_powerMeterTickCount < 4) // 200 ms
|
Real magsqAvg, magsqPeak;
|
||||||
{
|
int nbMagsqSamples;
|
||||||
m_powerMeterTickCount++;
|
m_amDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||||
}
|
Real powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||||
else
|
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(
|
ui->channelPowerMeter->levelChanged(
|
||||||
(100.0f + powDbAvg) / 100.0f,
|
(100.0f + powDbAvg) / 100.0f,
|
||||||
(100.0f + powDbPeak) / 100.0f,
|
(100.0f + powDbPeak) / 100.0f,
|
||||||
nbMagsqSamples);
|
nbMagsqSamples);
|
||||||
|
|
||||||
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||||
|
|
||||||
m_powerMeterTickCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool squelchOpen = m_amDemod->getSquelchOpen();
|
bool squelchOpen = m_amDemod->getSquelchOpen();
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ private:
|
|||||||
DownChannelizer* m_channelizer;
|
DownChannelizer* m_channelizer;
|
||||||
AMDemod* m_amDemod;
|
AMDemod* m_amDemod;
|
||||||
bool m_squelchOpen;
|
bool m_squelchOpen;
|
||||||
int m_powerMeterTickCount;
|
|
||||||
|
|
||||||
explicit AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
|
explicit AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
|
||||||
virtual ~AMDemodGUI();
|
virtual ~AMDemodGUI();
|
||||||
|
@ -384,27 +384,18 @@ void NFMDemodGUI::blockApplySettings(bool block)
|
|||||||
|
|
||||||
void NFMDemodGUI::tick()
|
void NFMDemodGUI::tick()
|
||||||
{
|
{
|
||||||
if (m_powerMeterTickCount < 4) // 200 ms
|
Real magsqAvg, magsqPeak;
|
||||||
{
|
int nbMagsqSamples;
|
||||||
m_powerMeterTickCount++;
|
m_nfmDemod->getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||||
}
|
Real powDbAvg = CalcDb::dbPower(magsqAvg);
|
||||||
else
|
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(
|
ui->channelPowerMeter->levelChanged(
|
||||||
(100.0f + powDbAvg) / 100.0f,
|
(100.0f + powDbAvg) / 100.0f,
|
||||||
(100.0f + powDbPeak) / 100.0f,
|
(100.0f + powDbPeak) / 100.0f,
|
||||||
nbMagsqSamples);
|
nbMagsqSamples);
|
||||||
|
|
||||||
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
ui->channelPower->setText(QString::number(powDbAvg, 'f', 1));
|
||||||
|
|
||||||
m_powerMeterTickCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool squelchOpen = m_nfmDemod->getSquelchOpen();
|
bool squelchOpen = m_nfmDemod->getSquelchOpen();
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ private:
|
|||||||
bool m_ctcssOn;
|
bool m_ctcssOn;
|
||||||
bool m_audioMute;
|
bool m_audioMute;
|
||||||
bool m_squelchOpen;
|
bool m_squelchOpen;
|
||||||
int m_powerMeterTickCount;
|
|
||||||
|
|
||||||
static const int m_rfBW[];
|
static const int m_rfBW[];
|
||||||
static const int m_fmDev[];
|
static const int m_fmDev[];
|
||||||
|
Loading…
Reference in New Issue
Block a user