1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

hackrfinput - add auto bandpass filter selection

Add button to auto select the bandpass filter based on the sample rate. It matches the automatic selection done by libhackrf when sample rate is changed.
This commit is contained in:
FuzzyCheese
2021-03-19 23:50:56 -05:00
parent c59a394111
commit be85e680e0
6 changed files with 66 additions and 29 deletions
@@ -246,6 +246,7 @@ void HackRFInputGui::displaySettings()
ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
ui->dcOffset->setChecked(m_settings.m_dcBlock);
ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
ui->autoBBF->setChecked(m_settings.m_autoBBF);
displaySampleRate();
@@ -313,10 +314,23 @@ void HackRFInputGui::on_iqImbalance_toggled(bool checked)
sendSettings();
}
void HackRFInputGui::on_autoBBF_toggled(bool checked)
{
m_settings.m_autoBBF = checked;
if(checked){
m_settings.m_bandwidth = hackrf_compute_baseband_filter_bw(m_settings.m_devSampleRate);
ui->bbFilter->blockSignals(true);
displaySettings();
ui->bbFilter->blockSignals(false);
sendSettings();
}
}
void HackRFInputGui::on_bbFilter_currentIndexChanged(int index)
{
int newBandwidth = HackRFBandwidths::getBandwidth(index);
m_settings.m_bandwidth = newBandwidth * 1000;
ui->autoBBF->setChecked(false);
sendSettings();
}
@@ -346,6 +360,13 @@ void HackRFInputGui::on_sampleRate_changed(quint64 value)
m_settings.m_devSampleRate <<= m_settings.m_log2Decim;
}
if(m_settings.m_autoBBF){
m_settings.m_bandwidth = hackrf_compute_baseband_filter_bw(m_settings.m_devSampleRate);
ui->bbFilter->blockSignals(true);
displaySettings();
ui->bbFilter->blockSignals(false);
}
displayFcTooltip();
sendSettings();
}