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