mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-28 15:56:33 -04:00
SSB demod: set limit on the maximum filter bandwidth relative to actual channel sample rate
This commit is contained in:
parent
7e4753ac59
commit
766c5bff1c
@ -137,6 +137,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getAudioSampleRate() const { return m_audioSampleRate; }
|
uint32_t getAudioSampleRate() const { return m_audioSampleRate; }
|
||||||
|
uint32_t getInputSampleRate() const { return m_inputSampleRate; }
|
||||||
double getMagSq() const { return m_magsq; }
|
double getMagSq() const { return m_magsq; }
|
||||||
bool getAudioActive() const { return m_audioActive; }
|
bool getAudioActive() const { return m_audioActive; }
|
||||||
|
|
||||||
|
@ -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)
|
void SSBDemodGUI::applyBandwidths(int spanLog2, bool force)
|
||||||
{
|
{
|
||||||
|
spanLog2 = spanLog2Limit(spanLog2);
|
||||||
|
ui->spanLog2->setMaximum(5 - spanLog2Limit(1));
|
||||||
bool dsb = ui->dsb->isChecked();
|
bool dsb = ui->dsb->isChecked();
|
||||||
//int spanLog2 = ui->spanLog2->value();
|
//int spanLog2 = ui->spanLog2->value();
|
||||||
m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<<spanLog2);
|
m_spectrumRate = m_ssbDemod->getAudioSampleRate() / (1<<spanLog2);
|
||||||
int bw = ui->BW->value();
|
int bw = ui->BW->value();
|
||||||
int lw = ui->lowCut->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;
|
int tickInterval = m_spectrumRate / 1200;
|
||||||
tickInterval = tickInterval == 0 ? 1 : tickInterval;
|
tickInterval = tickInterval == 0 ? 1 : tickInterval;
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ private:
|
|||||||
bool blockApplySettings(bool block);
|
bool blockApplySettings(bool block);
|
||||||
void applySettings(bool force = false);
|
void applySettings(bool force = false);
|
||||||
void applyBandwidths(int spanLog2, bool force = false);
|
void applyBandwidths(int spanLog2, bool force = false);
|
||||||
|
int spanLog2Limit(int spanLog2);
|
||||||
void displaySettings();
|
void displaySettings();
|
||||||
|
|
||||||
void displayAGCPowerThreshold(int value);
|
void displayAGCPowerThreshold(int value);
|
||||||
|
Loading…
Reference in New Issue
Block a user