diff --git a/plugins/channeltx/modpacket/packetmodsettings.cpp b/plugins/channeltx/modpacket/packetmodsettings.cpp
index 2fa689746..4cc882cd3 100644
--- a/plugins/channeltx/modpacket/packetmodsettings.cpp
+++ b/plugins/channeltx/modpacket/packetmodsettings.cpp
@@ -52,8 +52,8 @@ void PacketModSettings::resetToDefaults()
m_ax25Control = 3;
m_ax25PID = 0xf0;
m_preEmphasis = false;
- m_preEmphasisTau = 50e-6f;
- m_preEmphasisHighFreq = 12000.0f;
+ m_preEmphasisTau = 531e-6f; // Narrowband FM
+ m_preEmphasisHighFreq = 3000.0f;
m_lpfTaps = 301;
m_bbNoise = false;
m_rfNoise = false;
@@ -222,8 +222,8 @@ bool PacketModSettings::deserialize(const QByteArray& data)
d.readS32(18, &m_ax25Control, 3);
d.readS32(19, &m_ax25PID, 0xf0);
d.readBool(20, &m_preEmphasis, false);
- d.readReal(21, &m_preEmphasisTau, 50e-6f);
- d.readReal(22, &m_preEmphasisHighFreq, 12000.0f);
+ d.readReal(21, &m_preEmphasisTau, 531e-6f);
+ d.readReal(22, &m_preEmphasisHighFreq, 3000.0f);
d.readS32(23, &m_lpfTaps, 301);
d.readBool(24, &m_bbNoise, false);
d.readBool(25, &m_rfNoise, false);
diff --git a/sdrgui/gui/fmpreemphasisdialog.cpp b/sdrgui/gui/fmpreemphasisdialog.cpp
index f265095b8..54ddd80b6 100644
--- a/sdrgui/gui/fmpreemphasisdialog.cpp
+++ b/sdrgui/gui/fmpreemphasisdialog.cpp
@@ -51,6 +51,7 @@ void FMPreemphasisDialog::on_tau_valueChanged(double value)
// Set corresponding low frequency
ui->lowFreq->blockSignals(true);
ui->lowFreq->setValue(1.0/(2.0*M_PI*(value/TAU_SCALE)));
+ updateCombo();
ui->lowFreq->blockSignals(false);
}
@@ -59,5 +60,41 @@ void FMPreemphasisDialog::on_lowFreq_valueChanged(double value)
// Set corresponding tau
ui->tau->blockSignals(true);
ui->tau->setValue(TAU_SCALE*1.0/(2.0*M_PI*value));
+ updateCombo();
ui->tau->blockSignals(false);
}
+
+void FMPreemphasisDialog::updateCombo()
+{
+ double value = ui->tau->value();
+ if (value == 531.0)
+ ui->preset->setCurrentIndex(0);
+ else if (value == 75.0)
+ ui->preset->setCurrentIndex(1);
+ else if (value == 50.0)
+ ui->preset->setCurrentIndex(2);
+ else
+ ui->preset->setCurrentIndex(3);
+}
+
+void FMPreemphasisDialog::on_preset_currentIndexChanged(int value)
+{
+ if (value == 0)
+ {
+ // Narrowband FM
+ ui->lowFreq->setValue(300.0);
+ ui->highFreq->setValue(3000.0);
+ }
+ else if (value == 1)
+ {
+ // Broadcast FM (US)
+ ui->tau->setValue(75.0);
+ ui->highFreq->setValue(12000.0);
+ }
+ else if (value == 2)
+ {
+ // Broadcast FM (EU)
+ ui->tau->setValue(50.0);
+ ui->highFreq->setValue(12000.0);
+ }
+}
diff --git a/sdrgui/gui/fmpreemphasisdialog.h b/sdrgui/gui/fmpreemphasisdialog.h
index 780c5cf42..24f34b4c0 100644
--- a/sdrgui/gui/fmpreemphasisdialog.h
+++ b/sdrgui/gui/fmpreemphasisdialog.h
@@ -32,6 +32,7 @@ class SDRGUI_API FMPreemphasisDialog : public QDialog {
public:
explicit FMPreemphasisDialog(float tau, float highFreq, QWidget* parent = 0);
~FMPreemphasisDialog();
+ void updateCombo();
float m_tau;
float m_highFreq;
@@ -40,6 +41,7 @@ private slots:
void accept();
void on_tau_valueChanged(double value);
void on_lowFreq_valueChanged(double value);
+ void on_preset_currentIndexChanged(int value);
private:
Ui::FMPreemphasisDialog* ui;
diff --git a/sdrgui/gui/fmpreemphasisdialog.ui b/sdrgui/gui/fmpreemphasisdialog.ui
index d87f83b92..b47bcdc69 100644
--- a/sdrgui/gui/fmpreemphasisdialog.ui
+++ b/sdrgui/gui/fmpreemphasisdialog.ui
@@ -7,7 +7,7 @@
0
0
351
- 142
+ 169
@@ -23,21 +23,21 @@
-
-
-
+
-
Time constant (Tau) (us)
- -
+
-
Low frequency corner (Hz)
- -
+
-
Low frequency corner. Automatically calculated based on tau.
@@ -50,14 +50,14 @@
- -
+
-
High frequency corner (Hz)
- -
+
-
High frequency corner.
@@ -70,7 +70,7 @@
- -
+
-
Time constant in us. 50 for EU. 75 for USA.
@@ -86,6 +86,40 @@
+ -
+
+
+ Preset preemphasis values.
+
+
-
+
+ Narrowband FM
+
+
+ -
+
+ Broadcast FM (US)
+
+
+ -
+
+ Broadcast FM (EU, Asia)
+
+
+ -
+
+ User-defined
+
+
+
+
+ -
+
+
+ Preset
+
+
+