mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
AF squelch
This commit is contained in:
parent
7430dee09a
commit
e4d3f7eba7
@ -27,7 +27,7 @@
|
||||
#include "dsp/dspengine.h"
|
||||
#include "nfmdemodgui.h"
|
||||
|
||||
static const Real afSqTones[2] = {1200.0, 8000.0}; // {1200.0, 8000.0};
|
||||
static const double afSqTones[2] = {1200.0, 8000.0}; // {1200.0, 8000.0};
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(NFMDemod::MsgConfigureNFMDemod, Message)
|
||||
|
||||
|
@ -34,7 +34,7 @@ AFSquelch::AFSquelch() :
|
||||
{
|
||||
m_k = new double[m_nTones];
|
||||
m_coef = new double[m_nTones];
|
||||
m_toneSet = new Real[m_nTones];
|
||||
m_toneSet = new double[m_nTones];
|
||||
m_u0 = new double[m_nTones];
|
||||
m_u1 = new double[m_nTones];
|
||||
m_power = new double[m_nTones];
|
||||
@ -53,7 +53,7 @@ AFSquelch::AFSquelch() :
|
||||
}
|
||||
}
|
||||
|
||||
AFSquelch::AFSquelch(unsigned int nbTones, const Real *tones) :
|
||||
AFSquelch::AFSquelch(unsigned int nbTones, const double *tones) :
|
||||
m_N(0),
|
||||
m_nbAvg(128),
|
||||
m_sampleRate(0),
|
||||
@ -70,7 +70,7 @@ AFSquelch::AFSquelch(unsigned int nbTones, const Real *tones) :
|
||||
{
|
||||
m_k = new double[m_nTones];
|
||||
m_coef = new double[m_nTones];
|
||||
m_toneSet = new Real[m_nTones];
|
||||
m_toneSet = new double[m_nTones];
|
||||
m_u0 = new double[m_nTones];
|
||||
m_u1 = new double[m_nTones];
|
||||
m_power = new double[m_nTones];
|
||||
@ -134,7 +134,7 @@ void AFSquelch::setCoefficients(int N, unsigned int nbAvg, int _samplerate, int
|
||||
|
||||
|
||||
// Analyze an input signal
|
||||
bool AFSquelch::analyze(Real sample)
|
||||
bool AFSquelch::analyze(double sample)
|
||||
{
|
||||
|
||||
feedback(sample); // Goertzel feedback
|
||||
@ -162,7 +162,7 @@ bool AFSquelch::analyze(Real sample)
|
||||
}
|
||||
|
||||
|
||||
void AFSquelch::feedback(Real in)
|
||||
void AFSquelch::feedback(double in)
|
||||
{
|
||||
double t;
|
||||
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
AFSquelch();
|
||||
// allows user defined tone pair
|
||||
AFSquelch(unsigned int nbTones,
|
||||
const Real *tones);
|
||||
const double *tones);
|
||||
virtual ~AFSquelch();
|
||||
|
||||
// setup the basic parameters and coefficients
|
||||
@ -45,11 +45,11 @@ public:
|
||||
|
||||
// analyze a sample set and optionally filter
|
||||
// the tone frequencies.
|
||||
bool analyze(Real sample); // input signal sample
|
||||
bool analyze(double sample); // input signal sample
|
||||
bool evaluate(); // evaluate result
|
||||
|
||||
// get the tone set
|
||||
const Real *getToneSet() const
|
||||
const double *getToneSet() const
|
||||
{
|
||||
return m_toneSet;
|
||||
}
|
||||
@ -61,7 +61,7 @@ public:
|
||||
void reset(); // reset the analysis algorithm
|
||||
|
||||
protected:
|
||||
void feedback(Real sample);
|
||||
void feedback(double sample);
|
||||
void feedForward();
|
||||
|
||||
private:
|
||||
@ -80,7 +80,7 @@ private:
|
||||
double m_threshold;
|
||||
double *m_k;
|
||||
double *m_coef;
|
||||
Real *m_toneSet;
|
||||
double *m_toneSet;
|
||||
double *m_u0;
|
||||
double *m_u1;
|
||||
double *m_power;
|
||||
|
Loading…
Reference in New Issue
Block a user