Browse Source

dsp/fftfilt : Initialize fftfilt noise reduction members

Initialize the noise reduction configuration members in all fftfilt
constructors so they have defined values before noise reduction processing
uses them. This prevents undefined behavior and ensures consistent default
configuration regardless of which constructor is used.

Found by cppcheck (uninitMemberVar).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 2 months ago
parent
commit
a9eead8a2f
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 12
      sdrbase/dsp/fftfilt.cpp

12
sdrbase/dsp/fftfilt.cpp

@ -99,6 +99,10 @@ void fftfilt::init_filter() @@ -99,6 +99,10 @@ void fftfilt::init_filter()
// f2 == 0 ==> high pass filter
//------------------------------------------------------------------------------
fftfilt::fftfilt(int len) :
m_dnrScheme(FFTNoiseReduction::SchemeAverage),
m_dnrAboveAvgFactor(0.0f),
m_dnrSigmaFactor(0.0f),
m_dnrNbPeaks(0),
m_noiseReduction(len)
{
flen = len;
@ -109,6 +113,10 @@ fftfilt::fftfilt(int len) : @@ -109,6 +113,10 @@ fftfilt::fftfilt(int len) :
}
fftfilt::fftfilt(float f1, float f2, int len) :
m_dnrScheme(FFTNoiseReduction::SchemeAverage),
m_dnrAboveAvgFactor(0.0f),
m_dnrSigmaFactor(0.0f),
m_dnrNbPeaks(0),
m_noiseReduction(len)
{
flen = len;
@ -120,6 +128,10 @@ fftfilt::fftfilt(float f1, float f2, int len) : @@ -120,6 +128,10 @@ fftfilt::fftfilt(float f1, float f2, int len) :
}
fftfilt::fftfilt(float f2, int len) :
m_dnrScheme(FFTNoiseReduction::SchemeAverage),
m_dnrAboveAvgFactor(0.0f),
m_dnrSigmaFactor(0.0f),
m_dnrNbPeaks(0),
m_noiseReduction(len)
{
flen = len;

Loading…
Cancel
Save