1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 13:21:50 -05:00

SSB demod: set limit on the maximum filter bandwidth relative to actual channel sample rate

This commit is contained in:
f4exb 2019-05-30 02:43:25 +02:00
parent 7e4753ac59
commit 766c5bff1c
3 changed files with 14 additions and 1 deletions

View File

@ -137,6 +137,7 @@ public:
}
uint32_t getAudioSampleRate() const { return m_audioSampleRate; }
uint32_t getInputSampleRate() const { return m_inputSampleRate; }
double getMagSq() const { return m_magsq; }
bool getAudioActive() const { return m_audioActive; }

View File

@ -371,14 +371,25 @@ void SSBDemodGUI::applySettings(bool force)
}
}
int SSBDemodGUI::spanLog2Limit(int spanLog2)
{
while (((m_ssbDemod->getAudioSampleRate() / (1<<spanLog2)) > m_ssbDemod->getInputSampleRate()) && (spanLog2 < 4)) {
spanLog2++;
}
return spanLog2;
}
void SSBDemodGUI::applyBandwidths(int spanLog2, bool force)
{
spanLog2 = spanLog2Limit(spanLog2);
ui->spanLog2->setMaximum(5 - spanLog2Limit(1));
bool dsb = ui->dsb->isChecked();
//int spanLog2 = ui->spanLog2->value();
m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<<spanLog2);
int bw = ui->BW->value();
int lw = ui->lowCut->value();
int bwMax = m_ssbDemod->getAudioSampleRate() / (100*(1<<spanLog2));
int bwMax = std::min(m_ssbDemod->getAudioSampleRate() / (100*(1<<spanLog2)), (3*m_ssbDemod->getInputSampleRate())/400);
int tickInterval = m_spectrumRate / 1200;
tickInterval = tickInterval == 0 ? 1 : tickInterval;

View File

@ -71,6 +71,7 @@ private:
bool blockApplySettings(bool block);
void applySettings(bool force = false);
void applyBandwidths(int spanLog2, bool force = false);
int spanLog2Limit(int spanLog2);
void displaySettings();
void displayAGCPowerThreshold(int value);