1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-23 18:52:28 -04:00

Remved default constuctors in Moving average and AGC classes

This commit is contained in:
f4exb 2017-05-11 18:39:00 +02:00
parent 54eb56977d
commit 9fcc3cd426
14 changed files with 44 additions and 57 deletions

View File

@ -33,7 +33,9 @@ AMDemod::AMDemod() :
m_settingsMutex(QMutex::Recursive), m_settingsMutex(QMutex::Recursive),
m_magsqSum(0.0f), m_magsqSum(0.0f),
m_magsqPeak(0.0f), m_magsqPeak(0.0f),
m_magsqCount(0) m_magsqCount(0),
m_movingAverage(40, 0),
m_volumeAGC(40, 0)
{ {
setObjectName("AMDemod"); setObjectName("AMDemod");

View File

@ -57,7 +57,8 @@ ATVDemod::ATVDemod(BasebandSampleSink* objScopeSink) :
m_DSBFilter(0), m_DSBFilter(0),
m_DSBFilterBuffer(0), m_DSBFilterBuffer(0),
m_DSBFilterBufferIndex(0), m_DSBFilterBufferIndex(0),
m_objAvgColIndex(3) m_objAvgColIndex(3),
m_objMagSqAverage(40, 0)
{ {
setObjectName("ATVDemod"); setObjectName("ATVDemod");

View File

@ -276,7 +276,8 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI,
m_objChannelMarker(this), m_objChannelMarker(this),
m_blnBasicSettingsShown(false), m_blnBasicSettingsShown(false),
m_blnDoApplySettings(true), m_blnDoApplySettings(true),
m_intTickCount(0) m_intTickCount(0),
m_objMagSqAverage(40, 0)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);

View File

@ -40,7 +40,8 @@ DSDDemod::DSDDemod(BasebandSampleSink* sampleSink) :
m_settingsMutex(QMutex::Recursive), m_settingsMutex(QMutex::Recursive),
m_scope(sampleSink), m_scope(sampleSink),
m_scopeEnabled(true), m_scopeEnabled(true),
m_dsdDecoder() m_dsdDecoder(),
m_movingAverage(40, 0)
{ {
setObjectName("DSDDemod"); setObjectName("DSDDemod");

View File

@ -45,7 +45,9 @@ NFMDemod::NFMDemod() :
m_afSquelch(2, afSqTones), m_afSquelch(2, afSqTones),
m_audioFifo(4, 48000), m_audioFifo(4, 48000),
m_fmExcursion(2400), m_fmExcursion(2400),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive),
m_AGC(40, 0),
m_movingAverage(40, 0)
{ {
setObjectName("NFMDemod"); setObjectName("NFMDemod");

View File

@ -36,7 +36,8 @@ WFMDemod::WFMDemod(BasebandSampleSink* sampleSink) :
m_magsq(0.0f), m_magsq(0.0f),
m_magsqSum(0.0f), m_magsqSum(0.0f),
m_magsqPeak(0.0f), m_magsqPeak(0.0f),
m_magsqCount(0) m_magsqCount(0),
m_movingAverage(40, 0)
{ {
setObjectName("WFMDemod"); setObjectName("WFMDemod");

View File

@ -44,7 +44,9 @@ AMMod::AMMod() :
m_afInput(AMModInputNone), m_afInput(AMModInputNone),
m_levelCalcCount(0), m_levelCalcCount(0),
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f),
m_movingAverage(40, 0),
m_volumeAGC(40, 0)
{ {
setObjectName("AMMod"); setObjectName("AMMod");

View File

@ -63,7 +63,8 @@ ATVMod::ATVMod() :
m_SSBFilterBuffer(0), m_SSBFilterBuffer(0),
m_DSBFilterBuffer(0), m_DSBFilterBuffer(0),
m_SSBFilterBufferIndex(0), m_SSBFilterBufferIndex(0),
m_DSBFilterBufferIndex(0) m_DSBFilterBufferIndex(0),
m_movingAverage(40, 0)
{ {
setObjectName("ATVMod"); setObjectName("ATVMod");
scanCameras(); scanCameras();

View File

@ -45,7 +45,9 @@ NFMMod::NFMMod() :
m_afInput(NFMModInputNone), m_afInput(NFMModInputNone),
m_levelCalcCount(0), m_levelCalcCount(0),
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f),
m_movingAverage(40, 0),
m_volumeAGC(40, 0)
{ {
setObjectName("NFMod"); setObjectName("NFMod");

View File

@ -52,7 +52,9 @@ SSBMod::SSBMod(BasebandSampleSink* sampleSink) :
m_afInput(SSBModInputNone), m_afInput(SSBModInputNone),
m_levelCalcCount(0), m_levelCalcCount(0),
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f),
m_movingAverage(40, 0),
m_volumeAGC(40, 0)
{ {
setObjectName("SSBMod"); setObjectName("SSBMod");

View File

@ -46,7 +46,9 @@ WFMMod::WFMMod() :
m_afInput(WFMModInputNone), m_afInput(WFMModInputNone),
m_levelCalcCount(0), m_levelCalcCount(0),
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f),
m_movingAverage(40, 0),
m_volumeAGC(40, 0)
{ {
setObjectName("WFMod"); setObjectName("WFMod");

View File

@ -8,14 +8,6 @@
#include "dsp/agc.h" #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) : AGC::AGC(int historySize, Real R) :
m_u0(1.0), m_u0(1.0),
m_R(R), m_R(R),
@ -45,10 +37,10 @@ Real AGC::getAverage()
return m_moving_average.average(); return m_moving_average.average();
} }
MagSquaredAGC::MagSquaredAGC() : //MagSquaredAGC::MagSquaredAGC() :
AGC(), // AGC(),
m_magsq(0.0) // m_magsq(0.0)
{} //{}
MagSquaredAGC::MagSquaredAGC(int historySize, Real R) : MagSquaredAGC::MagSquaredAGC(int historySize, Real R) :
AGC(historySize, R), AGC(historySize, R),
@ -67,10 +59,10 @@ void MagSquaredAGC::feed(Complex& ci)
} }
MagAGC::MagAGC() : //MagAGC::MagAGC() :
AGC(), // AGC(),
m_magsq(0.0) // m_magsq(0.0)
{} //{}
MagAGC::MagAGC(int historySize, Real R) : MagAGC::MagAGC(int historySize, Real R) :
AGC(historySize, R), AGC(historySize, R),
@ -89,12 +81,12 @@ void MagAGC::feed(Complex& ci)
} }
AlphaAGC::AlphaAGC() : //AlphaAGC::AlphaAGC() :
AGC(), // AGC(),
m_alpha(0.5), // m_alpha(0.5),
m_magsq(0.0), // m_magsq(0.0),
m_squelchOpen(true) // m_squelchOpen(true)
{} //{}
AlphaAGC::AlphaAGC(int historySize, Real R) : AlphaAGC::AlphaAGC(int historySize, Real R) :
AGC(historySize, R), AGC(historySize, R),

View File

@ -13,8 +13,6 @@
class AGC class AGC
{ {
public: public:
AGC();
AGC(int historySize, Real R); AGC(int historySize, Real R);
virtual ~AGC(); virtual ~AGC();
@ -34,7 +32,6 @@ protected:
class MagSquaredAGC : public AGC class MagSquaredAGC : public AGC
{ {
public: public:
MagSquaredAGC();
MagSquaredAGC(int historySize, Real R); MagSquaredAGC(int historySize, Real R);
virtual ~MagSquaredAGC(); virtual ~MagSquaredAGC();
virtual void feed(Complex& ci); virtual void feed(Complex& ci);
@ -46,7 +43,6 @@ private:
class MagAGC : public AGC class MagAGC : public AGC
{ {
public: public:
MagAGC();
MagAGC(int historySize, Real R); MagAGC(int historySize, Real R);
virtual ~MagAGC(); virtual ~MagAGC();
virtual void feed(Complex& ci); virtual void feed(Complex& ci);
@ -58,7 +54,6 @@ private:
class AlphaAGC : public AGC class AlphaAGC : public AGC
{ {
public: public:
AlphaAGC();
AlphaAGC(int historySize, Real R); AlphaAGC(int historySize, Real R);
AlphaAGC(int historySize, Real R, Real alpha); AlphaAGC(int historySize, Real R, Real alpha);
virtual ~AlphaAGC(); virtual ~AlphaAGC();
@ -74,14 +69,6 @@ private:
class SimpleAGC class SimpleAGC
{ {
public: 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) : SimpleAGC(int historySize, Real initial, Real cutoff=0, Real clip=0) :
m_squelchOpen(false), m_squelchOpen(false),
m_fill(initial), m_fill(initial),

View File

@ -8,18 +8,9 @@
template<typename Type> class MovingAverage { template<typename Type> class MovingAverage {
public: public:
MovingAverage() : MovingAverage(int historySize, Type initial)
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)
{ {
resize(historySize, initial);
} }
void resize(int historySize, Type initial) void resize(int historySize, Type initial)