mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
All other audio modulators: use CW keyer's pulse smoother
This commit is contained in:
parent
7570a2f9d8
commit
4815b4bc3e
@ -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;
|
||||
|
@ -289,7 +289,6 @@ private:
|
||||
Real m_peakLevel;
|
||||
Real m_levelSum;
|
||||
CWKeyer m_cwKeyer;
|
||||
CWSmoother m_cwSmoother;
|
||||
|
||||
static const int m_levelNbSamples;
|
||||
|
||||
|
@ -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) ||
|
||||
|
@ -295,7 +295,6 @@ private:
|
||||
Real m_peakLevel;
|
||||
Real m_levelSum;
|
||||
CWKeyer m_cwKeyer;
|
||||
CWSmoother m_cwSmoother;
|
||||
static const int m_levelNbSamples;
|
||||
|
||||
//void apply();
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user