1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 15:33:34 -04:00

SSB demod: improve AGC threshold handling

This commit is contained in:
f4exb
2017-07-25 23:39:27 +02:00
parent 2597883015
commit 9ec4e6de98
7 changed files with 171 additions and 22 deletions
+1 -1
View File
@@ -302,7 +302,7 @@ bool SSBDemod::handleMessage(const Message& cmd)
DSBFilter->create_dsb_filter((2.0f * m_Bandwidth) / (float) m_audioSampleRate);
m_volume = cfg.getVolume();
m_volume *= m_volume * 0.1;
m_volume *= 2.0;
m_spanLog2 = cfg.getSpanLog2();
m_audioBinaual = cfg.getAudioBinaural();
+22 -5
View File
@@ -129,9 +129,17 @@ bool SSBDemodGUI::deserialize(const QByteArray& data)
d.readBool(11, &booltmp, false);
ui->agc->setChecked(booltmp);
d.readS32(12, &tmp, 7);
ui->agcTimeText->setText(QString("%1").arg((1<<tmp), 0, 'f', 0));
ui->agcTimeLog2->setValue(tmp);
QString s = QString::number((1<<tmp), 'f', 0);
ui->agcTimeText->setText(s);
d.readS32(13, &tmp, -20);
ui->agcPowerThresholdText->setText(QString("%1").arg(tmp, 0, 'f', 0));
ui->agcPowerThreshold->setValue(tmp);
s = QString::number(tmp, 'f', 0);
ui->agcPowerThresholdText->setText(s);
d.readS32(14, &tmp, 5);
ui->agcThresholdGate->setValue(tmp);
s = QString::number(tmp*10, 'f', 0);
ui->agcThresholdGateText->setText(s);
blockApplySettings(false);
m_channelMarker.blockSignals(false);
@@ -275,20 +283,29 @@ void SSBDemodGUI::on_volume_valueChanged(int value)
applySettings();
}
void SSBDemodGUI::on_agc_stateChanged(int state)
void SSBDemodGUI::on_agc_stateChanged(int state __attribute((__unused__)))
{
applySettings();
}
void SSBDemodGUI::on_agcTimeLog2_valueChanged(int value)
{
ui->agcTimeText->setText(QString("%1").arg((1<<value), 0, 'f', 0));
QString s = QString::number((1<<value), 'f', 0);
ui->agcTimeText->setText(s);
applySettings();
}
void SSBDemodGUI::on_agcPowerThreshold_valueChanged(int value)
{
ui->agcPowerThresholdText->setText(QString("%1").arg(value, 0, 'f', 0));
QString s = QString::number(value, 'f', 0);
ui->agcPowerThresholdText->setText(s);
applySettings();
}
void SSBDemodGUI::on_agcThresholdGate_valueChanged(int value)
{
QString s = QString::number(value * 10, 'f', 0);
ui->agcThresholdGateText->setText(s);
applySettings();
}
+1
View File
@@ -51,6 +51,7 @@ private slots:
void on_agc_stateChanged(int state);
void on_agcTimeLog2_valueChanged(int value);
void on_agcPowerThreshold_valueChanged(int value);
void on_agcThresholdGate_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_spanLog2_valueChanged(int value);
void onWidgetRolled(QWidget* widget, bool rollDown);
+48 -4
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>370</width>
<width>435</width>
<height>160</height>
</rect>
</property>
@@ -36,7 +36,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>360</width>
<width>421</width>
<height>151</height>
</rect>
</property>
@@ -479,8 +479,11 @@
<property name="toolTip">
<string>AGC time constant (ms in log2 steps)</string>
</property>
<property name="minimum">
<number>4</number>
</property>
<property name="maximum">
<number>10</number>
<number>11</number>
</property>
<property name="pageStep">
<number>1</number>
@@ -494,7 +497,7 @@
<widget class="QLabel" name="agcTimeText">
<property name="minimumSize">
<size>
<width>30</width>
<width>35</width>
<height>0</height>
</size>
</property>
@@ -553,6 +556,47 @@
</property>
</widget>
</item>
<item>
<widget class="QDial" name="agcThresholdGate">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Set threshiold gate (ms)</string>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="agcThresholdGateText">
<property name="minimumSize">
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Threshiold gate (ms)</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">