2024-06-20 18:44:17 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// 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 PLUGINS_CHANNELRX_WDSPRX_WDSPRXSETTINGS_H_
|
|
|
|
#define PLUGINS_CHANNELRX_WDSPRX_WDSPRXSETTINGS_H_
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
#include "dsp/fftwindow.h"
|
|
|
|
|
|
|
|
class Serializable;
|
|
|
|
|
2024-06-26 21:39:25 -04:00
|
|
|
|
|
|
|
struct WDSPRxProfile
|
2024-06-20 18:44:17 -04:00
|
|
|
{
|
2024-06-26 21:39:25 -04:00
|
|
|
enum WDSPRxAGCMode
|
|
|
|
{
|
|
|
|
AGCLong,
|
|
|
|
AGCSlow,
|
|
|
|
AGCMedium,
|
|
|
|
AGCFast,
|
|
|
|
};
|
|
|
|
enum WDSPRxNRScheme
|
|
|
|
{
|
|
|
|
NRSchemeNR,
|
|
|
|
NRSchemeNR2,
|
|
|
|
};
|
|
|
|
enum WDSPRxNBScheme
|
|
|
|
{
|
|
|
|
NBSchemeNB,
|
|
|
|
NBSchemeNB2,
|
|
|
|
};
|
|
|
|
enum WDSPRxNR2Gain
|
|
|
|
{
|
|
|
|
NR2GainLinear,
|
|
|
|
NR2GainLog,
|
|
|
|
NR2GainGamma,
|
|
|
|
};
|
|
|
|
enum WDSPRxNR2NPE
|
|
|
|
{
|
|
|
|
NR2NPEOSMS,
|
|
|
|
NR2NPEMMSE,
|
|
|
|
};
|
|
|
|
enum WDSPRxNRPosition
|
|
|
|
{
|
|
|
|
NRPositionPreAGC,
|
|
|
|
NRPositionPostAGC,
|
|
|
|
};
|
|
|
|
enum WDSPRxNB2Mode
|
|
|
|
{
|
|
|
|
NB2ModeZero,
|
|
|
|
NB2ModeSampleAndHold,
|
|
|
|
NB2ModeMeanHold,
|
|
|
|
NB2ModeHoldSample,
|
|
|
|
NB2ModeInterpolate,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Filter
|
|
|
|
int m_spanLog2;
|
|
|
|
Real m_highCutoff;
|
|
|
|
Real m_lowCutoff;
|
|
|
|
int m_fftWindow; // 0: 4-term Blackman-Harris, 1: 7-term Blackman-Harris
|
|
|
|
// AGC
|
|
|
|
bool m_agc;
|
|
|
|
WDSPRxAGCMode m_agcMode;
|
|
|
|
int m_agcGain; //!< Fixed gain if AGC is off else top gain
|
|
|
|
int m_agcSlope;
|
|
|
|
int m_agcHangThreshold;
|
|
|
|
// Noise blanker
|
|
|
|
bool m_dnb;
|
|
|
|
WDSPRxNBScheme m_nbScheme;
|
|
|
|
WDSPRxNB2Mode m_nb2Mode;
|
2024-06-30 16:16:30 -04:00
|
|
|
double m_nbSlewTime; // a.k.a tau
|
2024-06-26 21:39:25 -04:00
|
|
|
double m_nbLeadTime;
|
|
|
|
double m_nbLagTime;
|
|
|
|
int m_nbThreshold;
|
2024-06-30 16:16:30 -04:00
|
|
|
double m_nb2SlewTime; // a.k.a tau
|
|
|
|
double m_nb2LeadTime;
|
|
|
|
double m_nb2LagTime;
|
|
|
|
int m_nb2Threshold;
|
2024-06-26 21:39:25 -04:00
|
|
|
// Noise rediction
|
2024-06-20 18:44:17 -04:00
|
|
|
bool m_dnr;
|
2024-06-26 21:39:25 -04:00
|
|
|
bool m_snb;
|
|
|
|
bool m_anf;
|
|
|
|
WDSPRxNRScheme m_nrScheme;
|
|
|
|
WDSPRxNR2Gain m_nr2Gain;
|
|
|
|
WDSPRxNR2NPE m_nr2NPE;
|
|
|
|
WDSPRxNRPosition m_nrPosition;
|
|
|
|
bool m_nr2ArtifactReduction;
|
2024-06-20 18:44:17 -04:00
|
|
|
|
2024-06-26 21:39:25 -04:00
|
|
|
WDSPRxProfile() :
|
2024-06-20 18:44:17 -04:00
|
|
|
m_spanLog2(3),
|
2024-06-24 04:20:14 -04:00
|
|
|
m_highCutoff(3000),
|
2024-06-20 18:44:17 -04:00
|
|
|
m_lowCutoff(300),
|
2024-06-26 21:39:25 -04:00
|
|
|
m_fftWindow(0),
|
|
|
|
m_agc(false),
|
|
|
|
m_agcMode(AGCMedium),
|
|
|
|
m_agcGain(80),
|
|
|
|
m_agcSlope(35),
|
|
|
|
m_agcHangThreshold(0),
|
|
|
|
m_dnb(false),
|
|
|
|
m_nbScheme(NBSchemeNB),
|
|
|
|
m_nb2Mode(NB2ModeZero),
|
|
|
|
m_nbSlewTime(0.01),
|
|
|
|
m_nbLeadTime(0.01),
|
|
|
|
m_nbLagTime(0.01),
|
|
|
|
m_nbThreshold(30),
|
2024-06-30 16:16:30 -04:00
|
|
|
m_nb2SlewTime(0.01),
|
|
|
|
m_nb2LeadTime(0.01),
|
|
|
|
m_nb2LagTime(0.01),
|
|
|
|
m_nb2Threshold(30),
|
2024-06-26 21:39:25 -04:00
|
|
|
m_dnr(false),
|
|
|
|
m_snb(false),
|
|
|
|
m_anf(false),
|
|
|
|
m_nrScheme(NRSchemeNR),
|
|
|
|
m_nr2Gain(NR2GainGamma),
|
|
|
|
m_nr2NPE(NR2NPEOSMS),
|
|
|
|
m_nrPosition(NRPositionPreAGC),
|
|
|
|
m_nr2ArtifactReduction(true)
|
2024-06-20 18:44:17 -04:00
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct WDSPRxSettings
|
|
|
|
{
|
|
|
|
qint32 m_inputFrequencyOffset;
|
2024-06-24 04:20:14 -04:00
|
|
|
// Real m_highCutoff;
|
2024-06-20 18:44:17 -04:00
|
|
|
// Real m_lowCutoff;
|
|
|
|
Real m_volume;
|
|
|
|
// int m_spanLog2;
|
|
|
|
bool m_audioBinaural;
|
|
|
|
bool m_audioFlipChannels;
|
|
|
|
bool m_dsb;
|
|
|
|
bool m_audioMute;
|
2024-06-26 21:39:25 -04:00
|
|
|
// AGC
|
2024-06-20 18:44:17 -04:00
|
|
|
bool m_agc;
|
2024-06-26 21:39:25 -04:00
|
|
|
WDSPRxProfile::WDSPRxAGCMode m_agcMode;
|
2024-06-24 04:20:14 -04:00
|
|
|
int m_agcGain; //!< Fixed gain if AGC is off else top gain
|
|
|
|
int m_agcSlope;
|
|
|
|
int m_agcHangThreshold;
|
2024-06-26 21:39:25 -04:00
|
|
|
// Noise blanker
|
|
|
|
bool m_dnb;
|
|
|
|
WDSPRxProfile::WDSPRxNBScheme m_nbScheme;
|
|
|
|
WDSPRxProfile::WDSPRxNB2Mode m_nb2Mode;
|
|
|
|
double m_nbSlewTime;
|
|
|
|
double m_nbLeadTime;
|
|
|
|
double m_nbLagTime;
|
|
|
|
int m_nbThreshold;
|
2024-06-30 16:16:30 -04:00
|
|
|
double m_nb2SlewTime;
|
|
|
|
double m_nb2LeadTime;
|
|
|
|
double m_nb2LagTime;
|
|
|
|
int m_nb2Threshold;
|
2024-06-26 21:39:25 -04:00
|
|
|
// Noise reduction
|
2024-06-20 18:44:17 -04:00
|
|
|
bool m_dnr;
|
2024-06-26 21:39:25 -04:00
|
|
|
bool m_snb;
|
|
|
|
bool m_anf;
|
|
|
|
WDSPRxProfile::WDSPRxNRScheme m_nrScheme;
|
|
|
|
WDSPRxProfile::WDSPRxNR2Gain m_nr2Gain;
|
|
|
|
WDSPRxProfile::WDSPRxNR2NPE m_nr2NPE;
|
|
|
|
WDSPRxProfile::WDSPRxNRPosition m_nrPosition;
|
|
|
|
bool m_nr2ArtifactReduction;
|
|
|
|
|
2024-06-20 18:44:17 -04:00
|
|
|
quint32 m_rgbColor;
|
|
|
|
QString m_title;
|
|
|
|
QString m_audioDeviceName;
|
|
|
|
int m_streamIndex; //!< MIMO channel. Not relevant when connected to SI (single Rx).
|
|
|
|
bool m_useReverseAPI;
|
|
|
|
QString m_reverseAPIAddress;
|
|
|
|
uint16_t m_reverseAPIPort;
|
|
|
|
uint16_t m_reverseAPIDeviceIndex;
|
|
|
|
uint16_t m_reverseAPIChannelIndex;
|
|
|
|
int m_workspaceIndex;
|
|
|
|
QByteArray m_geometryBytes;
|
|
|
|
bool m_hidden;
|
2024-06-26 21:39:25 -04:00
|
|
|
std::vector<WDSPRxProfile> m_profiles;
|
|
|
|
unsigned int m_profileIndex;
|
2024-06-20 18:44:17 -04:00
|
|
|
|
|
|
|
Serializable *m_channelMarker;
|
|
|
|
Serializable *m_spectrumGUI;
|
|
|
|
Serializable *m_rollupState;
|
|
|
|
|
|
|
|
WDSPRxSettings();
|
|
|
|
void resetToDefaults();
|
|
|
|
void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
|
|
|
|
void setSpectrumGUI(Serializable *spectrumGUI) { m_spectrumGUI = spectrumGUI; }
|
|
|
|
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
|
|
|
|
|
|
|
static const int m_minPowerThresholdDB;
|
|
|
|
static const float m_mminPowerThresholdDBf;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* PLUGINS_CHANNELRX_WDSPRX_WDSPRXSETTINGS_H_ */
|