1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-03 10:08:30 -04:00

SSB demod: allow FFT filter bandwidth limit to reach input sample rate

This commit is contained in:
f4exb 2019-05-30 10:39:30 +02:00
parent 766c5bff1c
commit 552af0b250
2 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -389,7 +389,7 @@ void SSBDemodGUI::applyBandwidths(int spanLog2, bool force)
m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<<spanLog2);
int bw = ui->BW->value();
int lw = ui->lowCut->value();
int bwMax = std::min(m_ssbDemod->getAudioSampleRate() / (100*(1<<spanLog2)), (3*m_ssbDemod->getInputSampleRate())/400);
int bwMax = std::min(m_ssbDemod->getAudioSampleRate() / (100*(1<<spanLog2)), m_ssbDemod->getInputSampleRate()/100);
int tickInterval = m_spectrumRate / 1200;
tickInterval = tickInterval == 0 ? 1 : tickInterval;