mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-16 13:32:27 -04:00
NFM demod: fixed squelch
This commit is contained in:
parent
c7db2a3ca7
commit
1db2da3b60
@ -57,7 +57,6 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) :
|
||||
m_sampleCount(0),
|
||||
m_squelchCount(0),
|
||||
m_squelchGate(4800),
|
||||
m_squelchDecay(4800),
|
||||
m_squelchLevel(-990),
|
||||
m_squelchOpen(false),
|
||||
m_afSquelchOpen(false),
|
||||
@ -192,7 +191,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||
{
|
||||
m_squelchDelayLine.write(demod * m_discriCompensation);
|
||||
|
||||
if (m_squelchCount < m_squelchGate + m_squelchDecay) {
|
||||
if (m_squelchCount < 2*m_squelchGate) {
|
||||
m_squelchCount++;
|
||||
}
|
||||
}
|
||||
@ -219,15 +218,21 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||
{
|
||||
m_squelchDelayLine.write(demod * m_discriCompensation);
|
||||
|
||||
if (m_squelchCount < m_squelchGate + m_squelchDecay) {
|
||||
if (m_squelchCount < 2*m_squelchGate) {
|
||||
m_squelchCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_settings.m_audioMute)
|
||||
{
|
||||
sample = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_squelchOpen = (m_squelchCount > m_squelchGate);
|
||||
|
||||
if ((m_squelchOpen) && !m_settings.m_audioMute)
|
||||
if (m_squelchOpen)
|
||||
{
|
||||
if (m_settings.m_ctcssOn)
|
||||
{
|
||||
@ -288,6 +293,8 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||
|
||||
sample = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_audioBuffer[m_audioBufferFill].l = sample;
|
||||
m_audioBuffer[m_audioBufferFill].r = sample;
|
||||
@ -421,7 +428,6 @@ void NFMDemod::applyAudioSampleRate(int sampleRate)
|
||||
m_lowpass.create(301, sampleRate, 250.0);
|
||||
m_bandpass.create(301, sampleRate, 300.0, m_settings.m_afBandwidth);
|
||||
m_squelchGate = (sampleRate / 100) * m_settings.m_squelchGate; // gate is given in 10s of ms at 48000 Hz audio sample rate
|
||||
m_squelchDecay = m_squelchGate;
|
||||
m_squelchCount = 0; // reset squelch open counter
|
||||
m_ctcssDetector.setCoefficients(sampleRate/16, sampleRate/8.0f); // 0.5s / 2 Hz resolution
|
||||
|
||||
|
@ -195,7 +195,6 @@ private:
|
||||
int m_sampleCount;
|
||||
int m_squelchCount;
|
||||
int m_squelchGate;
|
||||
int m_squelchDecay;
|
||||
|
||||
Real m_squelchLevel;
|
||||
bool m_squelchOpen;
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
const PluginDescriptor NFMPlugin::m_pluginDescriptor = {
|
||||
QString("NFM Demodulator"),
|
||||
QString("3.14.4"),
|
||||
QString("3.14.5"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user