diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index 22681d24e..3d23881e6 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -397,7 +397,8 @@ void SSBDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffse if ((m_inputSampleRate != inputSampleRate) || force) { m_settingsMutex.lock(); - m_interpolator.create(16, inputSampleRate, m_Bandwidth * 1.5f, 2.0f); + Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > inputSampleRate ? inputSampleRate : (m_Bandwidth * 1.5f); + m_interpolator.create(16, inputSampleRate, interpolatorBandwidth, 2.0f); m_interpolatorDistanceRemain = 0; m_interpolatorDistance = (Real) inputSampleRate / (Real) m_audioSampleRate; m_settingsMutex.unlock(); @@ -417,7 +418,8 @@ void SSBDemod::applyAudioSampleRate(int sampleRate) m_settingsMutex.lock(); - m_interpolator.create(16, m_inputSampleRate, m_Bandwidth * 1.5f, 2.0f); + Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > m_inputSampleRate ? m_inputSampleRate : (m_Bandwidth * 1.5f); + m_interpolator.create(16, m_inputSampleRate, interpolatorBandwidth, 2.0f); m_interpolatorDistanceRemain = 0; m_interpolatorDistance = (Real) m_inputSampleRate / (Real) sampleRate; @@ -516,7 +518,8 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force) m_LowCutoff = lowCutoff; m_settingsMutex.lock(); - m_interpolator.create(16, m_inputSampleRate, m_Bandwidth * 1.5f, 2.0f); + Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > m_inputSampleRate ? m_inputSampleRate : (m_Bandwidth * 1.5f); + m_interpolator.create(16, m_inputSampleRate, interpolatorBandwidth, 2.0f); m_interpolatorDistanceRemain = 0; m_interpolatorDistance = (Real) m_inputSampleRate / (Real) m_audioSampleRate; SSBFilter->create_filter(m_LowCutoff / (float) m_audioSampleRate, m_Bandwidth / (float) m_audioSampleRate); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 045991ec3..2bd3532e4 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -389,7 +389,7 @@ void SSBDemodGUI::applyBandwidths(int spanLog2, bool force) m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<BW->value(); int lw = ui->lowCut->value(); - int bwMax = std::min(m_ssbDemod->getAudioSampleRate() / (100*(1<getInputSampleRate())/400); + int bwMax = std::min(m_ssbDemod->getAudioSampleRate() / (100*(1<getInputSampleRate()/100); int tickInterval = m_spectrumRate / 1200; tickInterval = tickInterval == 0 ? 1 : tickInterval;