1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-04 16:01:14 -05:00

SSB Demod: call applyChannelSettings with force=true at construction and start. Corrected decimator filter cutoff

This commit is contained in:
f4exb 2018-01-09 00:40:48 +01:00
parent 3248554cd1
commit 0af04cf66f
3 changed files with 9 additions and 7 deletions

View File

@ -91,6 +91,7 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
m_deviceAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this); m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true); applySettings(m_settings, true);
} }
@ -282,6 +283,7 @@ void SSBDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
void SSBDemod::start() void SSBDemod::start()
{ {
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
} }
void SSBDemod::stop() void SSBDemod::stop()
@ -333,22 +335,22 @@ bool SSBDemod::handleMessage(const Message& cmd)
} }
} }
void SSBDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset) void SSBDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force)
{ {
qDebug() << "SSBDemod::applyChannelSettings:" qDebug() << "SSBDemod::applyChannelSettings:"
<< " inputSampleRate: " << inputSampleRate << " inputSampleRate: " << inputSampleRate
<< " inputFrequencyOffset: " << inputFrequencyOffset; << " inputFrequencyOffset: " << inputFrequencyOffset;
if ((m_inputFrequencyOffset != inputFrequencyOffset) || if ((m_inputFrequencyOffset != inputFrequencyOffset) ||
(m_inputSampleRate != inputSampleRate)) (m_inputSampleRate != inputSampleRate) || force)
{ {
m_nco.setFreq(-inputFrequencyOffset, inputSampleRate); m_nco.setFreq(-inputFrequencyOffset, inputSampleRate);
} }
if (m_inputSampleRate != inputSampleRate) if ((m_inputSampleRate != inputSampleRate) || force)
{ {
m_settingsMutex.lock(); m_settingsMutex.lock();
m_interpolator.create(16, inputSampleRate, m_Bandwidth / 2.2f); m_interpolator.create(16, inputSampleRate, m_Bandwidth * 1.3f);
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) inputSampleRate / (Real) m_settings.m_audioSampleRate; m_interpolatorDistance = (Real) inputSampleRate / (Real) m_settings.m_audioSampleRate;
m_settingsMutex.unlock(); m_settingsMutex.unlock();
@ -405,7 +407,7 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
m_LowCutoff = lowCutoff; m_LowCutoff = lowCutoff;
m_settingsMutex.lock(); m_settingsMutex.lock();
m_interpolator.create(16, m_inputSampleRate, m_Bandwidth / 2.2f); m_interpolator.create(16, m_inputSampleRate, m_Bandwidth * 1.3f);
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_inputSampleRate / (Real) m_settings.m_audioSampleRate; m_interpolatorDistance = (Real) m_inputSampleRate / (Real) m_settings.m_audioSampleRate;
SSBFilter->create_filter(m_LowCutoff / (float) m_audioSampleRate, m_Bandwidth / (float) m_audioSampleRate); SSBFilter->create_filter(m_LowCutoff / (float) m_audioSampleRate, m_Bandwidth / (float) m_audioSampleRate);

View File

@ -279,7 +279,7 @@ private:
QMutex m_settingsMutex; QMutex m_settingsMutex;
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset); void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
void applySettings(const SSBDemodSettings& settings, bool force = false); void applySettings(const SSBDemodSettings& settings, bool force = false);
}; };

View File

@ -8,7 +8,7 @@
const PluginDescriptor SSBPlugin::m_pluginDescriptor = { const PluginDescriptor SSBPlugin::m_pluginDescriptor = {
QString("SSB Demodulator"), QString("SSB Demodulator"),
QString("3.9.0"), QString("3.10.1"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,