1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-27 02:09:14 -05:00

WFM: channel power averaging for display

This commit is contained in:
f4exb 2015-10-05 01:15:22 +02:00
parent 876c257aaf
commit 6a9743bb3d
2 changed files with 6 additions and 2 deletions

View File

@ -213,7 +213,8 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
ui(new Ui::WFMDemodGUI), ui(new Ui::WFMDemodGUI),
m_pluginAPI(pluginAPI), m_pluginAPI(pluginAPI),
m_channelMarker(this), m_channelMarker(this),
m_basicSettingsShown(false) m_basicSettingsShown(false),
m_channelPowerDbAvg(20,0)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
@ -295,5 +296,6 @@ void WFMDemodGUI::enterEvent(QEvent*)
void WFMDemodGUI::tick() void WFMDemodGUI::tick()
{ {
Real powDb = CalcDb::dbPower(m_wfmDemod->getMagSq()); Real powDb = CalcDb::dbPower(m_wfmDemod->getMagSq());
ui->channelPower->setText(QString::number(powDb, 'f', 1)); m_channelPowerDbAvg.feed(powDb);
ui->channelPower->setText(QString::number(m_channelPowerDbAvg.average(), 'f', 1));
} }

View File

@ -4,6 +4,7 @@
#include "gui/rollupwidget.h" #include "gui/rollupwidget.h"
#include "plugin/plugingui.h" #include "plugin/plugingui.h"
#include "dsp/channelmarker.h" #include "dsp/channelmarker.h"
#include "dsp/movingaverage.h"
class PluginAPI; class PluginAPI;
@ -55,6 +56,7 @@ private:
ThreadedSampleSink* m_threadedChannelizer; ThreadedSampleSink* m_threadedChannelizer;
Channelizer* m_channelizer; Channelizer* m_channelizer;
WFMDemod* m_wfmDemod; WFMDemod* m_wfmDemod;
MovingAverage<Real> m_channelPowerDbAvg;
static const int m_rfBW[]; static const int m_rfBW[];