NFM: enhancements to GUI and channel spacing handling

pull/714/head
f4exb 2020-11-12 18:32:24 +01:00
rodzic 3e95e2b1a5
commit 8ccb2e80c1
14 zmienionych plików z 81 dodań i 23 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 43 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 43 KiB

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 27 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 27 KiB

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -107,8 +107,10 @@ void NFMDemodGUI::on_deltaFrequency_changed(qint64 value)
applySettings();
}
void NFMDemodGUI::on_channelSpacing_currentIndexChanged(int index)
void NFMDemodGUI::on_channelSpacingApply_clicked()
{
int index = ui->channelSpacing->currentIndex();
qDebug("NFMDemodGUI::on_channelSpacing_currentIndexChanged: %d", index);
m_settings.m_rfBandwidth = NFMDemodSettings::getRFBW(index);
m_settings.m_afBandwidth = NFMDemodSettings::getAFBW(index);
m_settings.m_fmDeviation = 2.0 * NFMDemodSettings::getFMDev(index);
@ -120,7 +122,7 @@ void NFMDemodGUI::on_channelSpacing_currentIndexChanged(int index)
ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0);
ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0, 0, 'f', 1));
ui->afBW->setValue(m_settings.m_afBandwidth / 100.0);
ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDev->setValue(m_settings.m_fmDeviation / 200.0);
ui->rfBW->blockSignals(false);
ui->afBW->blockSignals(false);
@ -133,6 +135,12 @@ void NFMDemodGUI::on_rfBW_valueChanged(int value)
ui->rfBWText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1));
m_settings.m_rfBandwidth = value * 100.0;
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
ui->channelSpacing->blockSignals(true);
ui->channelSpacing->setCurrentIndex(NFMDemodSettings::getChannelSpacingIndex(m_settings.m_rfBandwidth));
ui->channelSpacing->update();
ui->channelSpacing->blockSignals(false);
applySettings();
}
@ -145,7 +153,7 @@ void NFMDemodGUI::on_afBW_valueChanged(int value)
void NFMDemodGUI::on_fmDev_valueChanged(int value)
{
ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1));
ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1));
m_settings.m_fmDeviation = value * 200.0;
applySettings();
}
@ -397,9 +405,13 @@ void NFMDemodGUI::displaySettings()
ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0, 0, 'f', 1));
ui->afBW->setValue(m_settings.m_afBandwidth / 100.0);
ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDev->setValue(m_settings.m_fmDeviation / 200.0);
ui->channelSpacing->blockSignals(true);
ui->channelSpacing->setCurrentIndex(NFMDemodSettings::getChannelSpacingIndex(m_settings.m_rfBandwidth));
ui->channelSpacing->blockSignals(false);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume*100.0, 0, 'f', 0));
ui->volume->setValue(m_settings.m_volume * 100.0);

Wyświetl plik

@ -64,7 +64,7 @@ private:
private slots:
void on_deltaFrequency_changed(qint64 value);
void on_channelSpacing_currentIndexChanged(int index);
void on_channelSpacingApply_clicked();
void on_rfBW_valueChanged(int value);
void on_afBW_valueChanged(int value);
void on_fmDev_valueChanged(int value);

Wyświetl plik

@ -204,7 +204,16 @@
<item>
<layout class="QHBoxLayout" name="rfBWLayout">
<item>
<widget class="QLabel" name="channelSpacingLabel">
<widget class="QPushButton" name="channelSpacingApply">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Apply channel spacing</string>
</property>
<property name="text">
<string>CS</string>
</property>
@ -219,7 +228,14 @@
</size>
</property>
<property name="toolTip">
<string>Apply channel spacing settings</string>
<string>Channel spacing selection</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="channelSpacingUnits">
<property name="text">
<string>k </string>
</property>
</widget>
</item>
@ -381,12 +397,12 @@
<widget class="QLabel" name="fmDevText">
<property name="minimumSize">
<size>
<width>35</width>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>20.0k</string>
<string>+20.0k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

Wyświetl plik

@ -12,7 +12,7 @@
const PluginDescriptor NFMPlugin::m_pluginDescriptor = {
NFMDemod::m_channelId,
QString("NFM Demodulator"),
QString("4.21.3"),
QString("6.0.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

Wyświetl plik

@ -24,7 +24,7 @@ Average total power in dB relative to a +/- 1.0 amplitude signal received in the
<h3>4: Channel spacing presets</h3>
This selector will apply RF bandwidth, AF bandwidth and FM deviation settings according to the channel spacing scheme as follows:
Clicking on the "CS" button will apply RF bandwidth, AF bandwidth and FM deviation settings according to the channel spacing scheme selected in the combo box as follows:
<table>
<tr>
@ -92,6 +92,8 @@ This selector will apply RF bandwidth, AF bandwidth and FM deviation settings ac
When you are lost with the RF, AF bandwidths and FM deviation settings you can always come back to these standards and generally get good results.
When changing the RF bandwidth the channel spacing selection in the combo box is adjusted to fit within this bandwidth.
&#9758; The demodulation is done at the channel sample rate which is guaranteed not to be lower than the requested audio sample rate but can possibly be equal to it. This means that for correct operation in any case you must ensure that the sample rate of the audio device is not lower than the Nyquist rate required to process this channel bandwidth.
&#9758; The channel sample rate is always the baseband signal rate divided by an integer power of two so depending on the baseband sample rate obtained from the sampling device you could also guarantee a minimal channel bandwidth. For example with a 125 kS/s baseband sample rate and a 8 kS/s audio sample rate the channel sample rate cannot be lower than 125/8 = 15.625 kS/s (125/16 = 7.8125 kS/s is too small) which is still OK for 5 or 6.25 kHz channel bandwidths.

Wyświetl plik

@ -137,8 +137,9 @@ void NFMModGUI::on_deltaFrequency_changed(qint64 value)
applySettings();
}
void NFMModGUI::on_channelSpacing_currentIndexChanged(int index)
void NFMModGUI::on_channelSpacingApply_clicked()
{
int index = ui->channelSpacing->currentIndex();
m_settings.m_rfBandwidth = NFMModSettings::getRFBW(index);
m_settings.m_afBandwidth = NFMModSettings::getAFBW(index);
m_settings.m_fmDeviation = 2.0 * NFMModSettings::getFMDev(index);
@ -150,7 +151,7 @@ void NFMModGUI::on_channelSpacing_currentIndexChanged(int index)
ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0);
ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0, 0, 'f', 1));
ui->afBW->setValue(m_settings.m_afBandwidth / 100.0);
ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDev->setValue(m_settings.m_fmDeviation / 200.0);
ui->rfBW->blockSignals(false);
ui->afBW->blockSignals(false);
@ -163,7 +164,12 @@ void NFMModGUI::on_rfBW_valueChanged(int value)
ui->rfBWText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1));
m_settings.m_rfBandwidth = value * 100.0;
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
applySettings();
ui->channelSpacing->blockSignals(true);
ui->channelSpacing->setCurrentIndex(NFMModSettings::getChannelSpacingIndex(m_settings.m_rfBandwidth));
ui->channelSpacing->blockSignals(false);
applySettings();
}
void NFMModGUI::on_afBW_valueChanged(int value)
@ -175,7 +181,7 @@ void NFMModGUI::on_afBW_valueChanged(int value)
void NFMModGUI::on_fmDev_valueChanged(int value)
{
ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1));
ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1));
m_settings.m_fmDeviation = value * 200.0;
applySettings();
}
@ -478,9 +484,13 @@ void NFMModGUI::displaySettings()
ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0, 0, 'f', 1));
ui->afBW->setValue(m_settings.m_afBandwidth / 100.0);
ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 2000.0, 0, 'f', 1));
ui->fmDev->setValue(m_settings.m_fmDeviation / 200.0);
ui->channelSpacing->blockSignals(true);
ui->channelSpacing->setCurrentIndex(NFMModSettings::getChannelSpacingIndex(m_settings.m_rfBandwidth));
ui->channelSpacing->blockSignals(false);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
ui->volume->setValue(m_settings.m_volumeFactor * 10.0);

Wyświetl plik

@ -89,7 +89,7 @@ private slots:
void handleSourceMessages();
void on_deltaFrequency_changed(qint64 value);
void on_channelSpacing_currentIndexChanged(int index);
void on_channelSpacingApply_clicked();
void on_rfBW_valueChanged(int value);
void on_afBW_valueChanged(int value);
void on_fmDev_valueChanged(int value);

Wyświetl plik

@ -186,7 +186,16 @@
<item>
<layout class="QHBoxLayout" name="rfBandwidthLayout">
<item>
<widget class="QLabel" name="channelSpacingLabel">
<widget class="QPushButton" name="channelSpacingApply">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Apply channel spacing</string>
</property>
<property name="text">
<string>CS</string>
</property>
@ -201,7 +210,14 @@
</size>
</property>
<property name="toolTip">
<string>Apply channel spacing settings</string>
<string>Channel spacing selection</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="channelSpacingUnits">
<property name="text">
<string>k </string>
</property>
</widget>
</item>
@ -348,12 +364,12 @@
<widget class="QLabel" name="fmDevText">
<property name="minimumSize">
<size>
<width>35</width>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>5.0k</string>
<string>+20.0k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

Wyświetl plik

@ -28,7 +28,7 @@
const PluginDescriptor NFMModPlugin::m_pluginDescriptor = {
NFMMod::m_channelId,
QString("NFM Modulator"),
QString("4.21.3"),
QString("6.0.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

Wyświetl plik

@ -22,7 +22,7 @@ Use this button to toggle mute for this channel.
<h3>4: Channel spacing presets</h3>
This selector will apply RF bandwidth, AF bandwidth and FM deviation settings according to the channel spacing scheme as follows:
Clicking on the "CS" button will apply RF bandwidth, AF bandwidth and FM deviation settings according to the channel spacing scheme selected in the combo box as follows:
<table>
<tr>
@ -90,6 +90,8 @@ This selector will apply RF bandwidth, AF bandwidth and FM deviation settings ac
When you are lost with the RF, AF bandwidths and FM deviation settings you can always come back to these standards and generally get good results.
When changing the RF bandwidth the channel spacing selection in the combo box is adjusted to fit within this bandwidth.
<h3>5: Audio frequency bandwidth</h3>
This is the bandwidth in khz of the modulating signal filtered before modulation.