1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

All other audio modulators: use CW keyer's pulse smoother

This commit is contained in:
f4exb 2017-10-21 05:27:05 +02:00
parent 7570a2f9d8
commit 4815b4bc3e
6 changed files with 6 additions and 15 deletions

View File

@ -68,7 +68,6 @@ AMMod::AMMod(DeviceSinkAPI *deviceAPI) :
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
m_cwKeyer.setWPM(13);
m_cwKeyer.setMode(CWKeyer::CWNone);
m_cwSmoother.setNbFadeSamples(192); // 4 ms @ 48 kHz
m_channelizer = new UpChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
@ -200,12 +199,12 @@ void AMMod::pullAF(Real& sample)
if (m_cwKeyer.getSample())
{
m_cwSmoother.getFadeSample(true, fadeFactor);
m_cwKeyer.getCWSmoother().getFadeSample(true, fadeFactor);
sample = m_toneNco.next() * fadeFactor;
}
else
{
if (m_cwSmoother.getFadeSample(false, fadeFactor))
if (m_cwKeyer.getCWSmoother().getFadeSample(false, fadeFactor))
{
sample = m_toneNco.next() * fadeFactor;
}
@ -427,7 +426,6 @@ void AMMod::applySettings(const AMModSettings& settings, bool force)
if ((settings.m_audioSampleRate != m_settings.m_audioSampleRate) || force)
{
m_cwKeyer.setSampleRate(settings.m_audioSampleRate);
m_cwSmoother.setNbFadeSamples(settings.m_audioSampleRate / 250); // 4 ms
}
m_settings = settings;

View File

@ -289,7 +289,6 @@ private:
Real m_peakLevel;
Real m_levelSum;
CWKeyer m_cwKeyer;
CWSmoother m_cwSmoother;
static const int m_levelNbSamples;

View File

@ -73,7 +73,6 @@ NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) :
m_cwKeyer.setSampleRate(m_settings.m_audioSampleRate);
m_cwKeyer.setWPM(13);
m_cwKeyer.setMode(CWKeyer::CWNone);
m_cwSmoother.setNbFadeSamples(192); // 2 ms @ 48 kHz
m_channelizer = new UpChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this);
@ -214,12 +213,12 @@ void NFMMod::pullAF(Real& sample)
if (m_cwKeyer.getSample())
{
m_cwSmoother.getFadeSample(true, fadeFactor);
m_cwKeyer.getCWSmoother().getFadeSample(true, fadeFactor);
sample = m_toneNco.next() * fadeFactor;
}
else
{
if (m_cwSmoother.getFadeSample(false, fadeFactor))
if (m_cwKeyer.getCWSmoother().getFadeSample(false, fadeFactor))
{
sample = m_toneNco.next() * fadeFactor;
}
@ -448,7 +447,6 @@ void NFMMod::applySettings(const NFMModSettings& settings, bool force)
if ((settings.m_audioSampleRate != m_settings.m_audioSampleRate) || force)
{
m_cwKeyer.setSampleRate(settings.m_audioSampleRate);
m_cwSmoother.setNbFadeSamples(settings.m_audioSampleRate / 250); // 4 ms
}
if ((settings.m_ctcssIndex != m_settings.m_ctcssIndex) ||

View File

@ -295,7 +295,6 @@ private:
Real m_peakLevel;
Real m_levelSum;
CWKeyer m_cwKeyer;
CWSmoother m_cwSmoother;
static const int m_levelNbSamples;
//void apply();

View File

@ -81,7 +81,6 @@ WFMMod::WFMMod(DeviceSinkAPI *deviceAPI) :
// CW keyer
m_cwKeyer.setSampleRate(m_settings.m_outputSampleRate);
m_cwSmoother.setNbFadeSamples(m_settings.m_outputSampleRate / 250); // 4 ms
m_cwKeyer.setWPM(13);
m_cwKeyer.setMode(CWKeyer::CWNone);
m_cwKeyer.reset();
@ -223,13 +222,13 @@ void WFMMod::pullAF(Complex& sample)
if (m_cwKeyer.getSample())
{
m_cwSmoother.getFadeSample(true, fadeFactor);
m_cwKeyer.getCWSmoother().getFadeSample(true, fadeFactor);
sample.real(m_toneNcoRF.next() * m_settings.m_volumeFactor * fadeFactor);
sample.imag(0.0f);
}
else
{
if (m_cwSmoother.getFadeSample(false, fadeFactor))
if (m_cwKeyer.getCWSmoother().getFadeSample(false, fadeFactor))
{
sample.real(m_toneNcoRF.next() * m_settings.m_volumeFactor * fadeFactor);
sample.imag(0.0f);
@ -470,7 +469,6 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
if ((settings.m_outputSampleRate != m_settings.m_outputSampleRate) || force)
{
m_cwKeyer.setSampleRate(settings.m_outputSampleRate);
m_cwSmoother.setNbFadeSamples(settings.m_outputSampleRate / 250); // 4 ms
m_cwKeyer.reset();
}

View File

@ -298,7 +298,6 @@ private:
Real m_peakLevel;
Real m_levelSum;
CWKeyer m_cwKeyer;
CWSmoother m_cwSmoother;
static const int m_levelNbSamples;
void applySettings(const WFMModSettings& settings, bool force = false);