mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-02 06:52:29 -04:00
Add separate audio bandwidth setting.
This commit is contained in:
parent
42f847f1a2
commit
53372d0508
@ -218,6 +218,7 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
|
|||||||
qDebug() << "AMDemod::applySettings:"
|
qDebug() << "AMDemod::applySettings:"
|
||||||
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
|
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
|
||||||
<< " m_rfBandwidth: " << settings.m_rfBandwidth
|
<< " m_rfBandwidth: " << settings.m_rfBandwidth
|
||||||
|
<< " m_afBandwidth: " << settings.m_afBandwidth
|
||||||
<< " m_volume: " << settings.m_volume
|
<< " m_volume: " << settings.m_volume
|
||||||
<< " m_squelch: " << settings.m_squelch
|
<< " m_squelch: " << settings.m_squelch
|
||||||
<< " m_audioMute: " << settings.m_audioMute
|
<< " m_audioMute: " << settings.m_audioMute
|
||||||
@ -238,6 +239,9 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
|
|||||||
if ((m_settings.m_rfBandwidth != settings.m_rfBandwidth) || force) {
|
if ((m_settings.m_rfBandwidth != settings.m_rfBandwidth) || force) {
|
||||||
reverseAPIKeys.append("rfBandwidth");
|
reverseAPIKeys.append("rfBandwidth");
|
||||||
}
|
}
|
||||||
|
if ((m_settings.m_afBandwidth != settings.m_afBandwidth) || force) {
|
||||||
|
reverseAPIKeys.append("afBandwidth");
|
||||||
|
}
|
||||||
if ((m_settings.m_bandpassEnable != settings.m_bandpassEnable) || force) {
|
if ((m_settings.m_bandpassEnable != settings.m_bandpassEnable) || force) {
|
||||||
reverseAPIKeys.append("bandpassEnable");
|
reverseAPIKeys.append("bandpassEnable");
|
||||||
}
|
}
|
||||||
@ -411,6 +415,9 @@ void AMDemod::webapiUpdateChannelSettings(
|
|||||||
if (channelSettingsKeys.contains("rfBandwidth")) {
|
if (channelSettingsKeys.contains("rfBandwidth")) {
|
||||||
settings.m_rfBandwidth = response.getAmDemodSettings()->getRfBandwidth();
|
settings.m_rfBandwidth = response.getAmDemodSettings()->getRfBandwidth();
|
||||||
}
|
}
|
||||||
|
if (channelSettingsKeys.contains("afBandwidth")) {
|
||||||
|
settings.m_afBandwidth = response.getAmDemodSettings()->getAfBandwidth();
|
||||||
|
}
|
||||||
if (channelSettingsKeys.contains("rgbColor")) {
|
if (channelSettingsKeys.contains("rgbColor")) {
|
||||||
settings.m_rgbColor = response.getAmDemodSettings()->getRgbColor();
|
settings.m_rgbColor = response.getAmDemodSettings()->getRgbColor();
|
||||||
}
|
}
|
||||||
@ -483,6 +490,7 @@ void AMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo
|
|||||||
response.getAmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
|
response.getAmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
|
||||||
response.getAmDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
|
response.getAmDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
|
||||||
response.getAmDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
|
response.getAmDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
|
||||||
|
response.getAmDemodSettings()->setAfBandwidth(settings.m_afBandwidth);
|
||||||
response.getAmDemodSettings()->setRgbColor(settings.m_rgbColor);
|
response.getAmDemodSettings()->setRgbColor(settings.m_rgbColor);
|
||||||
response.getAmDemodSettings()->setSquelch(settings.m_squelch);
|
response.getAmDemodSettings()->setSquelch(settings.m_squelch);
|
||||||
response.getAmDemodSettings()->setVolume(settings.m_volume);
|
response.getAmDemodSettings()->setVolume(settings.m_volume);
|
||||||
@ -634,6 +642,9 @@ void AMDemod::webapiFormatChannelSettings(
|
|||||||
if (channelSettingsKeys.contains("rfBandwidth") || force) {
|
if (channelSettingsKeys.contains("rfBandwidth") || force) {
|
||||||
swgAMDemodSettings->setRfBandwidth(settings.m_rfBandwidth);
|
swgAMDemodSettings->setRfBandwidth(settings.m_rfBandwidth);
|
||||||
}
|
}
|
||||||
|
if (channelSettingsKeys.contains("afBandwidth") || force) {
|
||||||
|
swgAMDemodSettings->setAfBandwidth(settings.m_afBandwidth);
|
||||||
|
}
|
||||||
if (channelSettingsKeys.contains("rgbColor") || force) {
|
if (channelSettingsKeys.contains("rgbColor") || force) {
|
||||||
swgAMDemodSettings->setRgbColor(settings.m_rgbColor);
|
swgAMDemodSettings->setRgbColor(settings.m_rgbColor);
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,14 @@ void AMDemodGUI::on_rfBW_valueChanged(int value)
|
|||||||
ui->rfBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
|
ui->rfBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
|
||||||
m_channelMarker.setBandwidth(value * 100);
|
m_channelMarker.setBandwidth(value * 100);
|
||||||
m_settings.m_rfBandwidth = value * 100;
|
m_settings.m_rfBandwidth = value * 100;
|
||||||
|
ui->afBW->setMaximum(value);
|
||||||
|
applySettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AMDemodGUI::on_afBW_valueChanged(int value)
|
||||||
|
{
|
||||||
|
ui->afBWText->setText(QString("%1 kHz").arg(value / 10.0, 0, 'f', 1));
|
||||||
|
m_settings.m_afBandwidth = value * 100;
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,6 +362,10 @@ void AMDemodGUI::displaySettings()
|
|||||||
ui->rfBW->setValue(displayValue);
|
ui->rfBW->setValue(displayValue);
|
||||||
ui->rfBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1));
|
ui->rfBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1));
|
||||||
|
|
||||||
|
displayValue = m_settings.m_afBandwidth / 100.0;
|
||||||
|
ui->afBW->setValue(displayValue);
|
||||||
|
ui->afBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1));
|
||||||
|
|
||||||
ui->volume->setValue(m_settings.m_volume * 10.0);
|
ui->volume->setValue(m_settings.m_volume * 10.0);
|
||||||
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
|
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
|
||||||
|
|
||||||
@ -503,6 +515,7 @@ void AMDemodGUI::makeUIConnections()
|
|||||||
QObject::connect(ui->ssb, &QToolButton::toggled, this, &AMDemodGUI::on_ssb_toggled);
|
QObject::connect(ui->ssb, &QToolButton::toggled, this, &AMDemodGUI::on_ssb_toggled);
|
||||||
QObject::connect(ui->bandpassEnable, &ButtonSwitch::toggled, this, &AMDemodGUI::on_bandpassEnable_toggled);
|
QObject::connect(ui->bandpassEnable, &ButtonSwitch::toggled, this, &AMDemodGUI::on_bandpassEnable_toggled);
|
||||||
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &AMDemodGUI::on_rfBW_valueChanged);
|
QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &AMDemodGUI::on_rfBW_valueChanged);
|
||||||
|
QObject::connect(ui->afBW, &QSlider::valueChanged, this, &AMDemodGUI::on_afBW_valueChanged);
|
||||||
QObject::connect(ui->volume, &QSlider::valueChanged, this, &AMDemodGUI::on_volume_valueChanged);
|
QObject::connect(ui->volume, &QSlider::valueChanged, this, &AMDemodGUI::on_volume_valueChanged);
|
||||||
QObject::connect(ui->squelch, &QSlider::valueChanged, this, &AMDemodGUI::on_squelch_valueChanged);
|
QObject::connect(ui->squelch, &QSlider::valueChanged, this, &AMDemodGUI::on_squelch_valueChanged);
|
||||||
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &AMDemodGUI::on_audioMute_toggled);
|
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &AMDemodGUI::on_audioMute_toggled);
|
||||||
|
@ -87,6 +87,7 @@ private slots:
|
|||||||
void on_ssb_toggled(bool checked);
|
void on_ssb_toggled(bool checked);
|
||||||
void on_bandpassEnable_toggled(bool checked);
|
void on_bandpassEnable_toggled(bool checked);
|
||||||
void on_rfBW_valueChanged(int value);
|
void on_rfBW_valueChanged(int value);
|
||||||
|
void on_afBW_valueChanged(int value);
|
||||||
void on_volume_valueChanged(int value);
|
void on_volume_valueChanged(int value);
|
||||||
void on_squelch_valueChanged(int value);
|
void on_squelch_valueChanged(int value);
|
||||||
void on_audioMute_toggled(bool checked);
|
void on_audioMute_toggled(bool checked);
|
||||||
|
@ -279,21 +279,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="ButtonSwitch" name="bandpassEnable">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Toggle boxcar bandpass filter with 300 Hz low cutoff</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../sdrgui/resources/res.qrc">
|
|
||||||
<normaloff>:/filter_bandpass.png</normaloff>
|
|
||||||
<normalon>:/filter_bandpass.png</normalon>:/filter_bandpass.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSlider" name="rfBW">
|
<widget class="QSlider" name="rfBW">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -332,6 +317,73 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="ButtonSwitch" name="bandpassEnable">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Toggle boxcar bandpass filter with 300 Hz low cutoff</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../sdrgui/resources/res.qrc">
|
||||||
|
<normaloff>:/filter_bandpass.png</normaloff>
|
||||||
|
<normalon>:/filter_bandpass.png</normalon>:/filter_bandpass.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="afBWLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>AF BW</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSlider" name="afBW">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Audio bandwidth</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>400</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>50</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="afBWText">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>5.0 kHz</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -434,10 +486,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ValueDialZ</class>
|
<class>ButtonSwitch</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QToolButton</extends>
|
||||||
<header>gui/valuedialz.h</header>
|
<header>gui/buttonswitch.h</header>
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>RollupContents</class>
|
<class>RollupContents</class>
|
||||||
@ -445,17 +496,18 @@
|
|||||||
<header>gui/rollupcontents.h</header>
|
<header>gui/rollupcontents.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ValueDialZ</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/valuedialz.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>LevelMeterSignalDB</class>
|
<class>LevelMeterSignalDB</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>gui/levelmeter.h</header>
|
<header>gui/levelmeter.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>ButtonSwitch</class>
|
|
||||||
<extends>QToolButton</extends>
|
|
||||||
<header>gui/buttonswitch.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||||
|
@ -38,6 +38,7 @@ void AMDemodSettings::resetToDefaults()
|
|||||||
m_volume = 2.0;
|
m_volume = 2.0;
|
||||||
m_audioMute = false;
|
m_audioMute = false;
|
||||||
m_bandpassEnable = false;
|
m_bandpassEnable = false;
|
||||||
|
m_afBandwidth = 5000;
|
||||||
m_rgbColor = QColor(255, 255, 0).rgb();
|
m_rgbColor = QColor(255, 255, 0).rgb();
|
||||||
m_title = "AM Demodulator";
|
m_title = "AM Demodulator";
|
||||||
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;
|
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;
|
||||||
@ -69,6 +70,7 @@ QByteArray AMDemodSettings::serialize() const
|
|||||||
s.writeU32(7, m_rgbColor);
|
s.writeU32(7, m_rgbColor);
|
||||||
s.writeBool(8, m_bandpassEnable);
|
s.writeBool(8, m_bandpassEnable);
|
||||||
s.writeString(9, m_title);
|
s.writeString(9, m_title);
|
||||||
|
s.writeReal(10, m_afBandwidth);
|
||||||
s.writeString(11, m_audioDeviceName);
|
s.writeString(11, m_audioDeviceName);
|
||||||
s.writeBool(12, m_pll);
|
s.writeBool(12, m_pll);
|
||||||
s.writeS32(13, (int) m_syncAMOperation);
|
s.writeS32(13, (int) m_syncAMOperation);
|
||||||
@ -85,6 +87,7 @@ QByteArray AMDemodSettings::serialize() const
|
|||||||
s.writeS32(20, m_workspaceIndex);
|
s.writeS32(20, m_workspaceIndex);
|
||||||
s.writeBlob(21, m_geometryBytes);
|
s.writeBlob(21, m_geometryBytes);
|
||||||
s.writeBool(22, m_hidden);
|
s.writeBool(22, m_hidden);
|
||||||
|
s.writeBool(23, m_audioMute);
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
@ -124,6 +127,7 @@ bool AMDemodSettings::deserialize(const QByteArray& data)
|
|||||||
d.readU32(7, &m_rgbColor);
|
d.readU32(7, &m_rgbColor);
|
||||||
d.readBool(8, &m_bandpassEnable, false);
|
d.readBool(8, &m_bandpassEnable, false);
|
||||||
d.readString(9, &m_title, "AM Demodulator");
|
d.readString(9, &m_title, "AM Demodulator");
|
||||||
|
d.readReal(10, &m_afBandwidth, 5000);
|
||||||
d.readString(11, &m_audioDeviceName, AudioDeviceManager::m_defaultDeviceName);
|
d.readString(11, &m_audioDeviceName, AudioDeviceManager::m_defaultDeviceName);
|
||||||
d.readBool(12, &m_pll, false);
|
d.readBool(12, &m_pll, false);
|
||||||
d.readS32(13, &tmp, 0);
|
d.readS32(13, &tmp, 0);
|
||||||
@ -152,6 +156,7 @@ bool AMDemodSettings::deserialize(const QByteArray& data)
|
|||||||
d.readS32(20, &m_workspaceIndex, 0);
|
d.readS32(20, &m_workspaceIndex, 0);
|
||||||
d.readBlob(21, &m_geometryBytes);
|
d.readBlob(21, &m_geometryBytes);
|
||||||
d.readBool(22, &m_hidden, false);
|
d.readBool(22, &m_hidden, false);
|
||||||
|
d.readBool(23, &m_audioMute);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ struct AMDemodSettings
|
|||||||
Real m_volume;
|
Real m_volume;
|
||||||
bool m_audioMute;
|
bool m_audioMute;
|
||||||
bool m_bandpassEnable;
|
bool m_bandpassEnable;
|
||||||
|
Real m_afBandwidth; //!< High frequency for bandpass
|
||||||
quint32 m_rgbColor;
|
quint32 m_rgbColor;
|
||||||
QString m_title;
|
QString m_title;
|
||||||
Serializable *m_channelMarker;
|
Serializable *m_channelMarker;
|
||||||
|
@ -273,19 +273,21 @@ void AMDemodSink::applySettings(const AMDemodSettings& settings, bool force)
|
|||||||
<< " m_squelch: " << settings.m_squelch
|
<< " m_squelch: " << settings.m_squelch
|
||||||
<< " m_audioMute: " << settings.m_audioMute
|
<< " m_audioMute: " << settings.m_audioMute
|
||||||
<< " m_bandpassEnable: " << settings.m_bandpassEnable
|
<< " m_bandpassEnable: " << settings.m_bandpassEnable
|
||||||
|
<< " m_afBandwidth: " << settings.m_afBandwidth
|
||||||
<< " m_audioDeviceName: " << settings.m_audioDeviceName
|
<< " m_audioDeviceName: " << settings.m_audioDeviceName
|
||||||
<< " m_pll: " << settings.m_pll
|
<< " m_pll: " << settings.m_pll
|
||||||
<< " m_syncAMOperation: " << (int) settings.m_syncAMOperation
|
<< " m_syncAMOperation: " << (int) settings.m_syncAMOperation
|
||||||
<< " force: " << force;
|
<< " force: " << force;
|
||||||
|
|
||||||
if((m_settings.m_rfBandwidth != settings.m_rfBandwidth) ||
|
if((m_settings.m_rfBandwidth != settings.m_rfBandwidth) ||
|
||||||
(m_settings.m_bandpassEnable != settings.m_bandpassEnable) || force)
|
(m_settings.m_bandpassEnable != settings.m_bandpassEnable) ||
|
||||||
|
(m_settings.m_afBandwidth != settings.m_afBandwidth) || force)
|
||||||
{
|
{
|
||||||
m_interpolator.create(16, m_channelSampleRate, settings.m_rfBandwidth / 2.2f);
|
m_interpolator.create(16, m_channelSampleRate, settings.m_rfBandwidth / 2.2f);
|
||||||
m_interpolatorDistanceRemain = 0;
|
m_interpolatorDistanceRemain = 0;
|
||||||
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) m_audioSampleRate;
|
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) m_audioSampleRate;
|
||||||
m_bandpass.create(301, m_audioSampleRate, 300.0, settings.m_rfBandwidth / 2.0f);
|
m_bandpass.create(301, m_audioSampleRate, 300.0, settings.m_afBandwidth / 2.0f);
|
||||||
m_lowpass.create(301, m_audioSampleRate, settings.m_rfBandwidth / 2.0f);
|
m_lowpass.create(301, m_audioSampleRate, settings.m_afBandwidth / 2.0f);
|
||||||
DSBFilter->create_dsb_filter((2.0f * settings.m_rfBandwidth) / (float) m_audioSampleRate);
|
DSBFilter->create_dsb_filter((2.0f * settings.m_rfBandwidth) / (float) m_audioSampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,8 +328,8 @@ void AMDemodSink::applyAudioSampleRate(int sampleRate)
|
|||||||
m_interpolator.create(16, m_channelSampleRate, m_settings.m_rfBandwidth / 2.2f);
|
m_interpolator.create(16, m_channelSampleRate, m_settings.m_rfBandwidth / 2.2f);
|
||||||
m_interpolatorDistanceRemain = 0;
|
m_interpolatorDistanceRemain = 0;
|
||||||
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) sampleRate;
|
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) sampleRate;
|
||||||
m_bandpass.create(301, sampleRate, 300.0, m_settings.m_rfBandwidth / 2.0f);
|
m_bandpass.create(301, sampleRate, 300.0, m_settings.m_afBandwidth / 2.0f);
|
||||||
m_lowpass.create(301, sampleRate, m_settings.m_rfBandwidth / 2.0f);
|
m_lowpass.create(301, sampleRate, m_settings.m_afBandwidth / 2.0f);
|
||||||
m_audioFifo.setSize(sampleRate);
|
m_audioFifo.setSize(sampleRate);
|
||||||
m_squelchDelayLine.resize(sampleRate/5);
|
m_squelchDelayLine.resize(sampleRate/5);
|
||||||
DSBFilter->create_dsb_filter((2.0f * m_settings.m_rfBandwidth) / (float) sampleRate);
|
DSBFilter->create_dsb_filter((2.0f * m_settings.m_rfBandwidth) / (float) sampleRate);
|
||||||
|
@ -55,3 +55,10 @@ This is the volume of the audio signal from 0.0 (mute) to 10.0 (maximum). It can
|
|||||||
<h3>10: Squelch threshold</h3>
|
<h3>10: Squelch threshold</h3>
|
||||||
|
|
||||||
This is the squelch threshold in dB. The average total power received in the signal bandwidth before demodulation is compared to this value and the squelch input is open above this value. It can be varied continuously in 0.1 dB steps from 0.0 to -100.0 dB using the dial button.
|
This is the squelch threshold in dB. The average total power received in the signal bandwidth before demodulation is compared to this value and the squelch input is open above this value. It can be varied continuously in 0.1 dB steps from 0.0 to -100.0 dB using the dial button.
|
||||||
|
|
||||||
|
<h3>11: Audio bandwidth</h3>
|
||||||
|
|
||||||
|
Specifies cutoff frequency of low pass (or band pass if boxcar (7) enabled) filter applied to audio.
|
||||||
|
In many use cases, this can be the same as the RF bandwidth (8). However, where offset carrier is used
|
||||||
|
(a.k.a CLIMAX as used by some ATC ground stations), this can reduce noise, when the RF bandwidth is set around ~20kHz
|
||||||
|
to cope with the offset, but the audio is only ~5-6kHz wide.
|
||||||
|
@ -9,6 +9,10 @@ AMDemodSettings:
|
|||||||
description: channel RF bandwidth in Hz (floors to next 100 Hz)
|
description: channel RF bandwidth in Hz (floors to next 100 Hz)
|
||||||
type: number
|
type: number
|
||||||
format: float
|
format: float
|
||||||
|
afBandwidth:
|
||||||
|
description: AF bandwidth in Hz
|
||||||
|
type: number
|
||||||
|
format: float
|
||||||
squelch:
|
squelch:
|
||||||
description: power squelch threshold in decibels
|
description: power squelch threshold in decibels
|
||||||
type: number
|
type: number
|
||||||
|
@ -32,6 +32,8 @@ SWGAMDemodSettings::SWGAMDemodSettings() {
|
|||||||
m_input_frequency_offset_isSet = false;
|
m_input_frequency_offset_isSet = false;
|
||||||
rf_bandwidth = 0.0f;
|
rf_bandwidth = 0.0f;
|
||||||
m_rf_bandwidth_isSet = false;
|
m_rf_bandwidth_isSet = false;
|
||||||
|
af_bandwidth = 0.0f;
|
||||||
|
m_af_bandwidth_isSet = false;
|
||||||
squelch = 0.0f;
|
squelch = 0.0f;
|
||||||
m_squelch_isSet = false;
|
m_squelch_isSet = false;
|
||||||
volume = 0.0f;
|
volume = 0.0f;
|
||||||
@ -78,6 +80,8 @@ SWGAMDemodSettings::init() {
|
|||||||
m_input_frequency_offset_isSet = false;
|
m_input_frequency_offset_isSet = false;
|
||||||
rf_bandwidth = 0.0f;
|
rf_bandwidth = 0.0f;
|
||||||
m_rf_bandwidth_isSet = false;
|
m_rf_bandwidth_isSet = false;
|
||||||
|
af_bandwidth = 0.0f;
|
||||||
|
m_af_bandwidth_isSet = false;
|
||||||
squelch = 0.0f;
|
squelch = 0.0f;
|
||||||
m_squelch_isSet = false;
|
m_squelch_isSet = false;
|
||||||
volume = 0.0f;
|
volume = 0.0f;
|
||||||
@ -123,6 +127,7 @@ SWGAMDemodSettings::cleanup() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(title != nullptr) {
|
if(title != nullptr) {
|
||||||
delete title;
|
delete title;
|
||||||
}
|
}
|
||||||
@ -162,6 +167,8 @@ SWGAMDemodSettings::fromJsonObject(QJsonObject &pJson) {
|
|||||||
|
|
||||||
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&af_bandwidth, pJson["afBandwidth"], "float", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "float", "");
|
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "float", "");
|
||||||
|
|
||||||
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
|
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
|
||||||
@ -218,6 +225,9 @@ SWGAMDemodSettings::asJsonObject() {
|
|||||||
if(m_rf_bandwidth_isSet){
|
if(m_rf_bandwidth_isSet){
|
||||||
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
|
||||||
}
|
}
|
||||||
|
if(m_af_bandwidth_isSet){
|
||||||
|
obj->insert("afBandwidth", QJsonValue(af_bandwidth));
|
||||||
|
}
|
||||||
if(m_squelch_isSet){
|
if(m_squelch_isSet){
|
||||||
obj->insert("squelch", QJsonValue(squelch));
|
obj->insert("squelch", QJsonValue(squelch));
|
||||||
}
|
}
|
||||||
@ -293,6 +303,16 @@ SWGAMDemodSettings::setRfBandwidth(float rf_bandwidth) {
|
|||||||
this->m_rf_bandwidth_isSet = true;
|
this->m_rf_bandwidth_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
SWGAMDemodSettings::getAfBandwidth() {
|
||||||
|
return af_bandwidth;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGAMDemodSettings::setAfBandwidth(float af_bandwidth) {
|
||||||
|
this->af_bandwidth = af_bandwidth;
|
||||||
|
this->m_af_bandwidth_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
SWGAMDemodSettings::getSquelch() {
|
SWGAMDemodSettings::getSquelch() {
|
||||||
return squelch;
|
return squelch;
|
||||||
@ -474,6 +494,9 @@ SWGAMDemodSettings::isSet(){
|
|||||||
if(m_rf_bandwidth_isSet){
|
if(m_rf_bandwidth_isSet){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
|
if(m_af_bandwidth_isSet){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
if(m_squelch_isSet){
|
if(m_squelch_isSet){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
@ -529,4 +552,3 @@ SWGAMDemodSettings::isSet(){
|
|||||||
return isObjectUpdated;
|
return isObjectUpdated;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@ public:
|
|||||||
float getRfBandwidth();
|
float getRfBandwidth();
|
||||||
void setRfBandwidth(float rf_bandwidth);
|
void setRfBandwidth(float rf_bandwidth);
|
||||||
|
|
||||||
|
float getAfBandwidth();
|
||||||
|
void setAfBandwidth(float af_bandwidth);
|
||||||
|
|
||||||
float getSquelch();
|
float getSquelch();
|
||||||
void setSquelch(float squelch);
|
void setSquelch(float squelch);
|
||||||
|
|
||||||
@ -111,6 +114,9 @@ private:
|
|||||||
float rf_bandwidth;
|
float rf_bandwidth;
|
||||||
bool m_rf_bandwidth_isSet;
|
bool m_rf_bandwidth_isSet;
|
||||||
|
|
||||||
|
float af_bandwidth;
|
||||||
|
bool m_af_bandwidth_isSet;
|
||||||
|
|
||||||
float squelch;
|
float squelch;
|
||||||
bool m_squelch_isSet;
|
bool m_squelch_isSet;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user