1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 11:51:47 -05: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_magsqSum(0.0f),
m_magsqPeak(0.0f),
m_magsqCount(0)
m_magsqCount(0),
m_movingAverage(40, 0),
m_volumeAGC(40, 0)
{
setObjectName("AMDemod");

View File

@ -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");

View File

@ -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);

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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();

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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),

View File

@ -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),

View File

@ -8,18 +8,9 @@
template<typename Type> 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)