diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index cc6c8ef66..8a8b51610 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -33,7 +33,9 @@ AMDemod::AMDemod() : m_settingsMutex(QMutex::Recursive), m_magsqSum(0.0f), m_magsqPeak(0.0f), - m_magsqCount(0) + m_magsqCount(0), + m_movingAverage(40, 0), + m_volumeAGC(40, 0) { setObjectName("AMDemod"); diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index c1d3445aa..a76085e62 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -57,7 +57,8 @@ ATVDemod::ATVDemod(BasebandSampleSink* objScopeSink) : m_DSBFilter(0), m_DSBFilterBuffer(0), m_DSBFilterBufferIndex(0), - m_objAvgColIndex(3) + m_objAvgColIndex(3), + m_objMagSqAverage(40, 0) { setObjectName("ATVDemod"); diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 3674673f4..b9903e311 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -276,7 +276,8 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, m_objChannelMarker(this), m_blnBasicSettingsShown(false), m_blnDoApplySettings(true), - m_intTickCount(0) + m_intTickCount(0), + m_objMagSqAverage(40, 0) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index e4b19e543..274fba355 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -40,7 +40,8 @@ DSDDemod::DSDDemod(BasebandSampleSink* sampleSink) : m_settingsMutex(QMutex::Recursive), m_scope(sampleSink), m_scopeEnabled(true), - m_dsdDecoder() + m_dsdDecoder(), + m_movingAverage(40, 0) { setObjectName("DSDDemod"); diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 868a092df..bb90e9907 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -45,7 +45,9 @@ NFMDemod::NFMDemod() : m_afSquelch(2, afSqTones), m_audioFifo(4, 48000), m_fmExcursion(2400), - m_settingsMutex(QMutex::Recursive) + m_settingsMutex(QMutex::Recursive), + m_AGC(40, 0), + m_movingAverage(40, 0) { setObjectName("NFMDemod"); diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index e42417a6e..cb364cb56 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -36,7 +36,8 @@ WFMDemod::WFMDemod(BasebandSampleSink* sampleSink) : m_magsq(0.0f), m_magsqSum(0.0f), m_magsqPeak(0.0f), - m_magsqCount(0) + m_magsqCount(0), + m_movingAverage(40, 0) { setObjectName("WFMDemod"); diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index d6507887f..297e0f75d 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -44,7 +44,9 @@ AMMod::AMMod() : m_afInput(AMModInputNone), m_levelCalcCount(0), m_peakLevel(0.0f), - m_levelSum(0.0f) + m_levelSum(0.0f), + m_movingAverage(40, 0), + m_volumeAGC(40, 0) { setObjectName("AMMod"); diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index ecb436337..beed56c99 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -63,7 +63,8 @@ ATVMod::ATVMod() : m_SSBFilterBuffer(0), m_DSBFilterBuffer(0), m_SSBFilterBufferIndex(0), - m_DSBFilterBufferIndex(0) + m_DSBFilterBufferIndex(0), + m_movingAverage(40, 0) { setObjectName("ATVMod"); scanCameras(); diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index c7802ab0b..4987e3f68 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -45,7 +45,9 @@ NFMMod::NFMMod() : m_afInput(NFMModInputNone), m_levelCalcCount(0), m_peakLevel(0.0f), - m_levelSum(0.0f) + m_levelSum(0.0f), + m_movingAverage(40, 0), + m_volumeAGC(40, 0) { setObjectName("NFMod"); diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index 07edf468a..88a222f84 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -52,7 +52,9 @@ SSBMod::SSBMod(BasebandSampleSink* sampleSink) : m_afInput(SSBModInputNone), m_levelCalcCount(0), m_peakLevel(0.0f), - m_levelSum(0.0f) + m_levelSum(0.0f), + m_movingAverage(40, 0), + m_volumeAGC(40, 0) { setObjectName("SSBMod"); diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index e002b7701..f1bf1aaaf 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -46,7 +46,9 @@ WFMMod::WFMMod() : m_afInput(WFMModInputNone), m_levelCalcCount(0), m_peakLevel(0.0f), - m_levelSum(0.0f) + m_levelSum(0.0f), + m_movingAverage(40, 0), + m_volumeAGC(40, 0) { setObjectName("WFMod"); diff --git a/sdrbase/dsp/agc.cpp b/sdrbase/dsp/agc.cpp index f62b36b8a..9c767ee5b 100644 --- a/sdrbase/dsp/agc.cpp +++ b/sdrbase/dsp/agc.cpp @@ -8,14 +8,6 @@ #include "dsp/agc.h" -AGC::AGC() : - m_u0(1.0), - m_R(1.0), - m_moving_average(), - m_historySize(0), - m_count(0) -{} - AGC::AGC(int historySize, Real R) : m_u0(1.0), m_R(R), @@ -45,10 +37,10 @@ Real AGC::getAverage() return m_moving_average.average(); } -MagSquaredAGC::MagSquaredAGC() : - AGC(), - m_magsq(0.0) -{} +//MagSquaredAGC::MagSquaredAGC() : +// AGC(), +// m_magsq(0.0) +//{} MagSquaredAGC::MagSquaredAGC(int historySize, Real R) : AGC(historySize, R), @@ -67,10 +59,10 @@ void MagSquaredAGC::feed(Complex& ci) } -MagAGC::MagAGC() : - AGC(), - m_magsq(0.0) -{} +//MagAGC::MagAGC() : +// AGC(), +// m_magsq(0.0) +//{} MagAGC::MagAGC(int historySize, Real R) : AGC(historySize, R), @@ -89,12 +81,12 @@ void MagAGC::feed(Complex& ci) } -AlphaAGC::AlphaAGC() : - AGC(), - m_alpha(0.5), - m_magsq(0.0), - m_squelchOpen(true) -{} +//AlphaAGC::AlphaAGC() : +// AGC(), +// m_alpha(0.5), +// m_magsq(0.0), +// m_squelchOpen(true) +//{} AlphaAGC::AlphaAGC(int historySize, Real R) : AGC(historySize, R), diff --git a/sdrbase/dsp/agc.h b/sdrbase/dsp/agc.h index e6e320800..405769f3d 100644 --- a/sdrbase/dsp/agc.h +++ b/sdrbase/dsp/agc.h @@ -13,8 +13,6 @@ class AGC { public: - - AGC(); AGC(int historySize, Real R); virtual ~AGC(); @@ -34,7 +32,6 @@ protected: class MagSquaredAGC : public AGC { public: - MagSquaredAGC(); MagSquaredAGC(int historySize, Real R); virtual ~MagSquaredAGC(); virtual void feed(Complex& ci); @@ -46,7 +43,6 @@ private: class MagAGC : public AGC { public: - MagAGC(); MagAGC(int historySize, Real R); virtual ~MagAGC(); virtual void feed(Complex& ci); @@ -58,7 +54,6 @@ private: class AlphaAGC : public AGC { public: - AlphaAGC(); AlphaAGC(int historySize, Real R); AlphaAGC(int historySize, Real R, Real alpha); virtual ~AlphaAGC(); @@ -74,14 +69,6 @@ private: class SimpleAGC { public: - SimpleAGC() : - m_squelchOpen(false), - m_fill(0), - m_cutoff(0), - m_clip(0), - m_moving_average() - {} - SimpleAGC(int historySize, Real initial, Real cutoff=0, Real clip=0) : m_squelchOpen(false), m_fill(initial), diff --git a/sdrbase/dsp/movingaverage.h b/sdrbase/dsp/movingaverage.h index df872b5fb..175443c5e 100644 --- a/sdrbase/dsp/movingaverage.h +++ b/sdrbase/dsp/movingaverage.h @@ -8,18 +8,9 @@ template class MovingAverage { public: - MovingAverage() : - m_history(), - m_sum(0), - m_index(0) - { - } - - MovingAverage(int historySize, Type initial) : - m_history(historySize, initial), - m_sum((float) historySize * initial), - m_index(0) + MovingAverage(int historySize, Type initial) { + resize(historySize, initial); } void resize(int historySize, Type initial)