22 #define M_PI 3.14159265358979323846 28 m_samplesProcessed(0),
29 m_samplesAvgProcessed(0),
48 for (
unsigned int j = 0; j <
m_nTones; ++j)
74 unsigned int sampleRate,
75 unsigned int samplesAttack,
76 unsigned int samplesDecay,
102 for (
unsigned int j = 0; j <
m_nTones; ++j)
149 for (
unsigned int j = 0; j <
m_nTones; ++j)
160 for (
unsigned int j = 0; j <
m_nTones; ++j)
174 for (
unsigned int j = 0; j <
m_nTones; ++j)
190 double maxPower = 0.0;
192 int minIndex = 0, maxIndex = 0;
194 for (
unsigned int j = 0; j <
m_nTones; ++j)
210 for (
unsigned int j = 0; j <
m_nTones; ++j)
220 if ((minPower/maxPower <
m_threshold) && (minIndex > maxIndex))
273 qDebug(
"AFSquelch::setThreshold: threshold: %f", threshold);
unsigned int m_samplesAvgProcessed
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
void feedback(double sample)
bool analyze(double sample)
unsigned int m_maxPowerIndex
unsigned int m_squelchCount
std::vector< MovingAverage< double > > m_movingAverages
unsigned int m_samplesProcessed
unsigned int m_samplesAttack
unsigned int m_samplesDecay
unsigned int m_nbAvg
number of power samples taken for moving average
unsigned int m_attackCount
unsigned int m_decayCount
void setThreshold(double _threshold)
unsigned int m_sampleRate
void setCoefficients(unsigned int N, unsigned int nbAvg, unsigned int sampleRate, unsigned int samplesAttack, unsigned int samplesDecay, const double *tones)
center frequency of tones tested