1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-12 08:06:34 -04:00

WDSP receiver: fixed FM demod amd implement equalizer

This commit is contained in:
f4exb 2024-07-08 23:44:10 +02:00
parent 8dd46a08ea
commit a4f08dc210
19 changed files with 1462 additions and 461 deletions

View File

@ -6,6 +6,7 @@ on:
push:
branches:
- master
- feature-*
- mac_ci
tags:
- 'v*'

View File

@ -860,7 +860,7 @@ if (FFTW3F_FOUND)
set(FT8_SUPPORT ON CACHE INTERNAL "")
endif()
if (FFTW3F_FOUND AND LINUX)
if (FFTW3F_FOUND)
add_subdirectory(wdsp)
add_definitions(-DHAS_WDSP)
set(WDSP_SUPPORT ON CACHE INTERNAL "")

View File

@ -36,6 +36,8 @@ if(NOT SERVER_MODE)
wdsprxdnbdialog.ui
wdsprxdnrdialog.cpp
wdsprxdnrdialog.ui
wdsprxeqdialog.cpp
wdsprxeqdialog.ui
wdsprxfmdialog.cpp
wdsprxfmdialog.ui
wdsprxsquelchdialog.cpp
@ -51,6 +53,7 @@ if(NOT SERVER_MODE)
wdsprxcwpeakdialog.h
wdsprxdnbdialog.h
wdsprxdnrdialog.h
wdsprxeqdialog.h
wdsprxfmdialog.h
wdsprxsquelchdialog.h
)

View File

@ -0,0 +1,252 @@
///////////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2024 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////////
#include "wdsprxeqdialog.h"
#include "ui_wdsprxeqdialog.h"
WDSPRxEqDialog::WDSPRxEqDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::WDSPRxEqDialog)
{
ui->setupUi(this);
}
WDSPRxEqDialog::~WDSPRxEqDialog()
{
delete ui;
}
void WDSPRxEqDialog::setEqF(const std::array<float, 11>& eqF)
{
m_eqF = eqF;
ui->f1->blockSignals(true);
ui->f2->blockSignals(true);
ui->f3->blockSignals(true);
ui->f4->blockSignals(true);
ui->f5->blockSignals(true);
ui->f6->blockSignals(true);
ui->f7->blockSignals(true);
ui->f8->blockSignals(true);
ui->f9->blockSignals(true);
ui->f10->blockSignals(true);
ui->f1->setValue((int) m_eqF[1]);
ui->f2->setValue((int) m_eqF[2]);
ui->f3->setValue((int) m_eqF[3]);
ui->f4->setValue((int) m_eqF[4]);
ui->f5->setValue((int) m_eqF[5]);
ui->f6->setValue((int) m_eqF[6]);
ui->f7->setValue((int) m_eqF[7]);
ui->f8->setValue((int) m_eqF[8]);
ui->f9->setValue((int) m_eqF[9]);
ui->f10->setValue((int) m_eqF[10]);
ui->f1->blockSignals(false);
ui->f2->blockSignals(false);
ui->f3->blockSignals(false);
ui->f4->blockSignals(false);
ui->f5->blockSignals(false);
ui->f6->blockSignals(false);
ui->f7->blockSignals(false);
ui->f8->blockSignals(false);
ui->f9->blockSignals(false);
ui->f10->blockSignals(false);
}
void WDSPRxEqDialog::setEqG(const std::array<float, 11>& eqG)
{
m_eqG = eqG;
ui->preampGain->blockSignals(true);
ui->f1Gain->blockSignals(true);
ui->f2Gain->blockSignals(true);
ui->f3Gain->blockSignals(true);
ui->f4Gain->blockSignals(true);
ui->f5Gain->blockSignals(true);
ui->f6Gain->blockSignals(true);
ui->f7Gain->blockSignals(true);
ui->f8Gain->blockSignals(true);
ui->f9Gain->blockSignals(true);
ui->f10Gain->blockSignals(true);
ui->preampGain->setValue((int) m_eqG[0]);
ui->f1Gain->setValue((int) m_eqG[1]);
ui->f2Gain->setValue((int) m_eqG[2]);
ui->f3Gain->setValue((int) m_eqG[3]);
ui->f4Gain->setValue((int) m_eqG[4]);
ui->f5Gain->setValue((int) m_eqG[5]);
ui->f6Gain->setValue((int) m_eqG[6]);
ui->f7Gain->setValue((int) m_eqG[7]);
ui->f8Gain->setValue((int) m_eqG[8]);
ui->f9Gain->setValue((int) m_eqG[9]);
ui->f10Gain->setValue((int) m_eqG[10]);
ui->preampGain->blockSignals(false);
ui->f1Gain->blockSignals(false);
ui->f2Gain->blockSignals(false);
ui->f3Gain->blockSignals(false);
ui->f4Gain->blockSignals(false);
ui->f5Gain->blockSignals(false);
ui->f6Gain->blockSignals(false);
ui->f7Gain->blockSignals(false);
ui->f8Gain->blockSignals(false);
ui->f9Gain->blockSignals(false);
ui->f10Gain->blockSignals(false);
ui->preampGainText->setText(tr("%1 dB").arg((int) m_eqG[0]));
ui->f1GainText->setText(tr("%1 dB").arg((int) m_eqG[1]));
ui->f2GainText->setText(tr("%1 dB").arg((int) m_eqG[2]));
ui->f3GainText->setText(tr("%1 dB").arg((int) m_eqG[3]));
ui->f4GainText->setText(tr("%1 dB").arg((int) m_eqG[4]));
ui->f5GainText->setText(tr("%1 dB").arg((int) m_eqG[5]));
ui->f6GainText->setText(tr("%1 dB").arg((int) m_eqG[6]));
ui->f7GainText->setText(tr("%1 dB").arg((int) m_eqG[7]));
ui->f8GainText->setText(tr("%1 dB").arg((int) m_eqG[8]));
ui->f9GainText->setText(tr("%1 dB").arg((int) m_eqG[9]));
ui->f10GainText->setText(tr("%1 dB").arg((int) m_eqG[10]));
}
void WDSPRxEqDialog::on_f1_valueChanged(int value)
{
m_eqF[1] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f2_valueChanged(int value)
{
m_eqF[2] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f3_valueChanged(int value)
{
m_eqF[3] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f4_valueChanged(int value)
{
m_eqF[4] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f5_valueChanged(int value)
{
m_eqF[5] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f6_valueChanged(int value)
{
m_eqF[6] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f7_valueChanged(int value)
{
m_eqF[7] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f8_valueChanged(int value)
{
m_eqF[8] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f9_valueChanged(int value)
{
m_eqF[9] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_f10_valueChanged(int value)
{
m_eqF[10] = (float) value;
emit valueChanged(ChangedFrequency);
}
void WDSPRxEqDialog::on_preampGain_valueChanged(int value)
{
m_eqG[0] = (float) value;
ui->preampGainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f1Gain_valueChanged(int value)
{
m_eqG[1] = (float) value;
ui->f1GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f2Gain_valueChanged(int value)
{
m_eqG[2] = (float) value;
ui->f2GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f3Gain_valueChanged(int value)
{
m_eqG[3] = (float) value;
ui->f3GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f4Gain_valueChanged(int value)
{
m_eqG[4] = (float) value;
ui->f4GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f5Gain_valueChanged(int value)
{
m_eqG[5] = (float) value;
ui->f5GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f6Gain_valueChanged(int value)
{
m_eqG[6] = (float) value;
ui->f6GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f7Gain_valueChanged(int value)
{
m_eqG[7] = (float) value;
ui->f7GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f8Gain_valueChanged(int value)
{
m_eqG[8] = (float) value;
ui->f8GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f9Gain_valueChanged(int value)
{
m_eqG[9] = (float) value;
ui->f9GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}
void WDSPRxEqDialog::on_f10Gain_valueChanged(int value)
{
m_eqG[10] = (float) value;
ui->f10GainText->setText(tr("%1 dB").arg(value));
emit valueChanged(ChangedGain);
}

View File

@ -0,0 +1,79 @@
///////////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2024 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_WDSPRXEQDIALOG_H
#define INCLUDE_WDSPRXEQDIALOG_H
#include <array>
#include <QDialog>
#include "export.h"
#include "wdsprxsettings.h"
namespace Ui {
class WDSPRxEqDialog;
}
class SDRGUI_API WDSPRxEqDialog : public QDialog {
Q_OBJECT
public:
enum ValueChanged {
ChangedFrequency,
ChangedGain,
};
explicit WDSPRxEqDialog(QWidget* parent = nullptr);
~WDSPRxEqDialog();
void setEqF(const std::array<float, 11>& eqF);
void setEqG(const std::array<float, 11>& eqG);
const std::array<float, 11>& getEqF() const { return m_eqF; }
const std::array<float, 11>& getEqG() const { return m_eqG; }
signals:
void valueChanged(int valueChanged);
private:
Ui::WDSPRxEqDialog *ui;
std::array<float, 11> m_eqF;
std::array<float, 11> m_eqG;
private slots:
void on_f1_valueChanged(int value);
void on_f2_valueChanged(int value);
void on_f3_valueChanged(int value);
void on_f4_valueChanged(int value);
void on_f5_valueChanged(int value);
void on_f6_valueChanged(int value);
void on_f7_valueChanged(int value);
void on_f8_valueChanged(int value);
void on_f9_valueChanged(int value);
void on_f10_valueChanged(int value);
void on_preampGain_valueChanged(int value);
void on_f1Gain_valueChanged(int value);
void on_f2Gain_valueChanged(int value);
void on_f3Gain_valueChanged(int value);
void on_f4Gain_valueChanged(int value);
void on_f5Gain_valueChanged(int value);
void on_f6Gain_valueChanged(int value);
void on_f7Gain_valueChanged(int value);
void on_f8Gain_valueChanged(int value);
void on_f9Gain_valueChanged(int value);
void on_f10Gain_valueChanged(int value);
};
#endif

View File

@ -0,0 +1,889 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WDSPRxEqDialog</class>
<widget class="QDialog" name="WDSPRxEqDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>410</width>
<height>440</height>
</rect>
</property>
<property name="windowTitle">
<string>Equalizer settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="eqLayout">
<item row="7" column="3">
<widget class="QLabel" name="f7GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="f3">
<property name="toolTip">
<string>Frequency point #3 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>95</number>
</property>
<property name="maximum">
<number>187</number>
</property>
<property name="value">
<number>125</number>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="f6">
<property name="toolTip">
<string>Frequency point #6 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>751</number>
</property>
<property name="maximum">
<number>1500</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="f5Label">
<property name="text">
<string>f5 (Hz)</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="f7">
<property name="toolTip">
<string>Frequency point #7 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>1501</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="value">
<number>2000</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="f7Label">
<property name="text">
<string>f7 (Hz)</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="TickedSlider" name="f4Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #4 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="f4Label">
<property name="text">
<string>f4 (Hz)</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="f5">
<property name="toolTip">
<string>Frequency point #5 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>376</number>
</property>
<property name="maximum">
<number>750</number>
</property>
<property name="value">
<number>500</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="TickedSlider" name="preampGain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Preamp gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="f8">
<property name="toolTip">
<string>Frequency point #8 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>3001</number>
</property>
<property name="maximum">
<number>6000</number>
</property>
<property name="value">
<number>4000</number>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QLabel" name="f8GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="f4GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="preampLabel">
<property name="text">
<string>Preamp</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="TickedSlider" name="f1Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #1 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="f2Label">
<property name="text">
<string>f2 (Hz)</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="TickedSlider" name="f7Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #7 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="TickedSlider" name="f5Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #5 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="TickedSlider" name="f8Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #8 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="f6Label">
<property name="text">
<string>f6 (Hz)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="f2">
<property name="toolTip">
<string>Frequency point #2 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>49</number>
</property>
<property name="maximum">
<number>94</number>
</property>
<property name="value">
<number>63</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="f9Label">
<property name="text">
<string>f9 (Hz)</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="f8Label">
<property name="text">
<string>f8 (Hz)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="f1">
<property name="toolTip">
<string>Frequency point #1 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>48</number>
</property>
<property name="value">
<number>32</number>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QLabel" name="f9GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="f3Label">
<property name="text">
<string>f3 (Hz)</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="TickedSlider" name="f2Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #2 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="f2GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="preampGainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="f3GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="TickedSlider" name="f9Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #9 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="f6GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="f4">
<property name="toolTip">
<string>Frequency point #4 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>188</number>
</property>
<property name="maximum">
<number>375</number>
</property>
<property name="value">
<number>250</number>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QSpinBox" name="f9">
<property name="toolTip">
<string>Frequency point #9 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>6001</number>
</property>
<property name="maximum">
<number>12000</number>
</property>
<property name="value">
<number>8000</number>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="f1GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="TickedSlider" name="f3Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #3 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="f5GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="TickedSlider" name="f6Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #6 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="f1Label">
<property name="text">
<string>f1 (Hz)</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="f10Label">
<property name="text">
<string>f10 (Hz)</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QSpinBox" name="f10">
<property name="toolTip">
<string>Frequency point #10 (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>12001</number>
</property>
<property name="maximum">
<number>20000</number>
</property>
<property name="value">
<number>16000</number>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="TickedSlider" name="f10Gain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Frequency point #10 gain (dB)</string>
</property>
<property name="minimum">
<number>-15</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item row="10" column="3">
<widget class="QLabel" name="f10GainText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>TickedSlider</class>
<extends>QSlider</extends>
<header>gui/tickedslider.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>WDSPRxEqDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>WDSPRxEqDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -50,9 +50,18 @@
</item>
<item>
<widget class="QLabel" name="deviationText">
<property name="minimumSize">
<size>
<width>32</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>20.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
@ -262,23 +271,32 @@
<string>AF volume limter gain (dB)</string>
</property>
<property name="minimum">
<number>-30</number>
<number>-80</number>
</property>
<property name="maximum">
<number>30</number>
<number>0</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>0</number>
<number>-40</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="afLimiterGainText">
<property name="minimumSize">
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>20</string>
<string>-40</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>

View File

@ -44,6 +44,7 @@
#include "wdsprxfmdialog.h"
#include "wdsprxcwpeakdialog.h"
#include "wdsprxsquelchdialog.h"
#include "wdsprxeqdialog.h"
WDSPRxGUI* WDSPRxGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{
@ -341,17 +342,28 @@ void WDSPRxGUI::on_profileIndex_valueChanged(int value)
m_settings.m_fmCTCSSNotchFrequency = m_settings.m_profiles[m_settings.m_profileIndex].m_fmCTCSSNotchFrequency;
// Squelch
m_settings.m_squelch = m_settings.m_profiles[m_settings.m_profileIndex].m_squelch;
m_settings.m_squelchThreshold = m_settings.m_profiles[m_settings.m_profileIndex].m_squelchThreshold;
m_settings.m_squelchMode = m_settings.m_profiles[m_settings.m_profileIndex].m_squelchMode;
m_settings.m_ssqlTauMute = m_settings.m_profiles[m_settings.m_profileIndex].m_ssqlTauMute;
m_settings.m_ssqlTauUnmute = m_settings.m_profiles[m_settings.m_profileIndex].m_ssqlTauUnmute;
m_settings.m_amsqMaxTail = m_settings.m_profiles[m_settings.m_profileIndex].m_amsqMaxTail;
// Equalizer
m_settings.m_equalizer = m_settings.m_profiles[m_settings.m_profileIndex].m_equalizer;
m_settings.m_eqF = m_settings.m_profiles[m_settings.m_profileIndex].m_eqF;
m_settings.m_eqG = m_settings.m_profiles[m_settings.m_profileIndex].m_eqG;
displaySettings();
applyBandwidths(m_settings.m_profiles[m_settings.m_profileIndex].m_spanLog2, true); // does applySettings(true)
}
void WDSPRxGUI::on_demod_currentIndexChanged(int index)
{
m_settings.m_demod = (WDSPRxProfile::WDSPRxDemod) index;
WDSPRxProfile::WDSPRxDemod demod = (WDSPRxProfile::WDSPRxDemod) index;
if ((m_settings.m_demod != WDSPRxProfile::DemodSSB) && (demod == WDSPRxProfile::DemodSSB)) {
m_settings.m_dsb = false;
}
m_settings.m_demod = demod;
m_settings.m_profiles[m_settings.m_profileIndex].m_demod = m_settings.m_demod;
switch(m_settings.m_demod)
@ -482,6 +494,9 @@ WDSPRxGUI::WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
CRightClickEnabler *squelchRightClickEnabler = new CRightClickEnabler(ui->squelch);
connect(squelchRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(squelchSetupDialog(const QPoint &)));
CRightClickEnabler *equalizerRightClickEnabler = new CRightClickEnabler(ui->equalizer);
connect(equalizerRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(equalizerSetupDialog(const QPoint &)));
CRightClickEnabler *demodRightClickEnabler = new CRightClickEnabler(ui->demod);
connect(demodRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(demodSetupDialog(const QPoint &)));
@ -757,6 +772,7 @@ void WDSPRxGUI::displaySettings()
ui->squelch->setChecked(m_settings.m_squelch);
ui->squelchThreshold->setValue(m_settings.m_squelchThreshold);
ui->squelchThresholdText->setText(tr("%1").arg(m_settings.m_squelchThreshold));
ui->equalizer->setChecked(m_settings.m_equalizer);
ui->audioBinaural->setChecked(m_settings.m_audioBinaural);
ui->audioFlipChannels->setChecked(m_settings.m_audioFlipChannels);
ui->audioMute->setChecked(m_settings.m_audioMute);
@ -1208,6 +1224,44 @@ void WDSPRxGUI::squelchSetup(int iValueChanged)
}
}
void WDSPRxGUI::equalizerSetupDialog(const QPoint& p)
{
m_equalizerDialog = new WDSPRxEqDialog();
m_equalizerDialog->move(p);
m_equalizerDialog->setEqF(m_settings.m_eqF);
m_equalizerDialog->setEqG(m_settings.m_eqG);
QObject::connect(m_equalizerDialog, &WDSPRxEqDialog::valueChanged, this, &WDSPRxGUI::equalizerSetup);
m_equalizerDialog->exec();
QObject::disconnect(m_equalizerDialog, &WDSPRxEqDialog::valueChanged, this, &WDSPRxGUI::equalizerSetup);
m_equalizerDialog->deleteLater();
m_equalizerDialog = nullptr;
}
void WDSPRxGUI::equalizerSetup(int iValueChanged)
{
if (!m_equalizerDialog) {
return;
}
WDSPRxEqDialog::ValueChanged valueChanged = (WDSPRxEqDialog::ValueChanged) iValueChanged;
switch (valueChanged)
{
case WDSPRxEqDialog::ChangedFrequency:
m_settings.m_eqF = m_equalizerDialog->getEqF();
m_settings.m_profiles[m_settings.m_profileIndex].m_eqF = m_settings.m_eqF;
applySettings();
break;
case WDSPRxEqDialog::ChangedGain:
m_settings.m_eqG = m_equalizerDialog->getEqG();
m_settings.m_profiles[m_settings.m_profileIndex].m_eqG = m_settings.m_eqG;
applySettings();
break;
default:
break;
}
}
void WDSPRxGUI::tick()
{
double powDbAvg, powDbPeak;

View File

@ -41,6 +41,7 @@ class WDSPRxAMDialog;
class WDSPRxFMDialog;
class WDSPRxCWPeakDialog;
class WDSPRxSquelchDialog;
class WDSPRxEqDialog;
class SpectrumVis;
class BasebandSampleSink;
@ -103,6 +104,7 @@ private:
WDSPRxFMDialog* m_fmDialog;
WDSPRxCWPeakDialog* m_cwPeakDialog;
WDSPRxSquelchDialog* m_squelchDialog;
WDSPRxEqDialog* m_equalizerDialog;
QIcon m_iconDSBUSB;
QIcon m_iconDSBLSB;
@ -144,6 +146,7 @@ private slots:
void on_cwPeaking_toggled(bool checked);
void on_squelch_toggled(bool checked);
void on_squelchThreshold_valueChanged(int value);
void on_equalizer_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void handleInputMessages();
@ -161,6 +164,8 @@ private slots:
void fmSetup(int valueChanged);
void squelchSetupDialog(const QPoint& p);
void squelchSetup(int valueChanged);
void equalizerSetupDialog(const QPoint& p);
void equalizerSetup(int valueChanged);
void tick();
};

View File

@ -993,6 +993,19 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="equalizer">
<property name="toolTip">
<string>Toggle equalizer (righ-click for options)</string>
</property>
<property name="text">
<string>EQ</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">

View File

@ -79,8 +79,8 @@ void WDSPRxSettings::resetToDefaults()
m_fmDeviation = 2500.0;
m_fmAFLow = 300.0;
m_fmAFHigh = 3000.0;
m_fmAFLimiter = false;
m_fmAFLimiterGain = 10.0;
m_fmAFLimiter = true;
m_fmAFLimiterGain = -40.0;
m_fmCTCSSNotch = false;
m_fmCTCSSNotchFrequency = 67.0;
// Squelch
@ -90,6 +90,10 @@ void WDSPRxSettings::resetToDefaults()
m_ssqlTauMute = 0.1;
m_ssqlTauUnmute = 0.1;
m_amsqMaxTail = 1.5;
// Equalizer
m_equalizer = false;
m_eqF = {0.0, 32.0, 63.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0};
m_eqG = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
//
m_volume = 1.0;
m_inputFrequencyOffset = 0;
@ -166,6 +170,30 @@ QByteArray WDSPRxSettings::serialize() const
s.writeDouble(63, m_ssqlTauMute);
s.writeDouble(64, m_ssqlTauUnmute);
s.writeDouble(65, m_amsqMaxTail);
// Equalizer
s.writeBool( 90, m_equalizer);
s.writeFloat(4000, m_eqF[0]);
s.writeFloat(4001, m_eqF[1]);
s.writeFloat(4002, m_eqF[2]);
s.writeFloat(4003, m_eqF[3]);
s.writeFloat(4004, m_eqF[4]);
s.writeFloat(4005, m_eqF[5]);
s.writeFloat(4006, m_eqF[6]);
s.writeFloat(4007, m_eqF[7]);
s.writeFloat(4008, m_eqF[8]);
s.writeFloat(4009, m_eqF[9]);
s.writeFloat(4010, m_eqF[10]);
s.writeFloat(4020, m_eqG[0]);
s.writeFloat(4021, m_eqG[1]);
s.writeFloat(4022, m_eqG[2]);
s.writeFloat(4023, m_eqG[3]);
s.writeFloat(4024, m_eqG[4]);
s.writeFloat(4025, m_eqG[5]);
s.writeFloat(4026, m_eqG[6]);
s.writeFloat(4027, m_eqG[7]);
s.writeFloat(4028, m_eqG[8]);
s.writeFloat(4029, m_eqG[9]);
s.writeFloat(4030, m_eqG[10]);
//
s.writeString(70, m_title);
s.writeString(71, m_audioDeviceName);
@ -237,6 +265,30 @@ QByteArray WDSPRxSettings::serialize() const
s.writeDouble(163 + 100*i, m_profiles[i].m_ssqlTauMute);
s.writeDouble(164 + 100*i, m_profiles[i].m_ssqlTauUnmute);
s.writeDouble(165 + 100*i, m_profiles[i].m_amsqMaxTail);
// Equalizer
s.writeBool( 190 + 100*i, m_profiles[i].m_equalizer);
s.writeFloat(4100 + 100*i, m_profiles[i].m_eqF[0]);
s.writeFloat(4101 + 100*i, m_profiles[i].m_eqF[1]);
s.writeFloat(4102 + 100*i, m_profiles[i].m_eqF[2]);
s.writeFloat(4103 + 100*i, m_profiles[i].m_eqF[3]);
s.writeFloat(4104 + 100*i, m_profiles[i].m_eqF[4]);
s.writeFloat(4105 + 100*i, m_profiles[i].m_eqF[5]);
s.writeFloat(4106 + 100*i, m_profiles[<