mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 08:04:49 -05:00
174 lines
4.0 KiB
C++
174 lines
4.0 KiB
C++
/* RXA.h
|
|
|
|
This file is part of a program that implements a Software-Defined Radio.
|
|
|
|
Copyright (C) 2013, 2014, 2015, 2016 Warren Pratt, NR0V
|
|
Copyright (C) 2024 Edouard Griffiths, F4EXB Adapted to SDRangel
|
|
|
|
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; either version 2
|
|
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 for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
The author can be reached by email at
|
|
|
|
warren@wpratt.com
|
|
|
|
*/
|
|
|
|
#ifndef wdsp_rxa_h
|
|
#define wdsp_rxa_h
|
|
|
|
#include "comm.hpp"
|
|
#include "unit.hpp"
|
|
#include "export.h"
|
|
|
|
namespace WDSP {
|
|
|
|
class METER;
|
|
class SHIFT;
|
|
class RESAMPLE;
|
|
class GEN;
|
|
class BANDPASS;
|
|
class BPS;
|
|
class NOTCHDB;
|
|
class NBP;
|
|
class BPSNBA;
|
|
class SNBA;
|
|
class SENDER;
|
|
class AMSQ;
|
|
class AMD;
|
|
class FMD;
|
|
class FMSQ;
|
|
class EQP;
|
|
class ANF;
|
|
class ANR;
|
|
class EMNR;
|
|
class WCPAGC;
|
|
class SPEAK;
|
|
class MPEAK;
|
|
class PANEL;
|
|
class SIPHON;
|
|
class CBL;
|
|
class SSQL;
|
|
class ANB;
|
|
class NOB;
|
|
class BufferProbe;
|
|
|
|
class WDSP_API RXA : public Unit
|
|
{
|
|
public:
|
|
enum rxaMode
|
|
{
|
|
RXA_LSB,
|
|
RXA_USB,
|
|
RXA_DSB,
|
|
RXA_CWL,
|
|
RXA_CWU,
|
|
RXA_FM,
|
|
RXA_AM,
|
|
RXA_DIGU,
|
|
RXA_SPEC,
|
|
RXA_DIGL,
|
|
RXA_SAM,
|
|
RXA_DRM
|
|
};
|
|
|
|
enum rxaMeterType
|
|
{
|
|
RXA_S_PK,
|
|
RXA_S_AV,
|
|
RXA_ADC_PK,
|
|
RXA_ADC_AV,
|
|
RXA_AGC_GAIN,
|
|
RXA_AGC_PK,
|
|
RXA_AGC_AV,
|
|
RXA_METERTYPE_LAST
|
|
};
|
|
|
|
int mode;
|
|
double meter[RXA_METERTYPE_LAST];
|
|
|
|
ANB *anb;
|
|
NOB *nob;
|
|
SHIFT *shift;
|
|
RESAMPLE *rsmpin;
|
|
GEN *gen0;
|
|
METER *adcmeter;
|
|
NOTCHDB *ndb;
|
|
NBP *nbp0;
|
|
BPSNBA *bpsnba;
|
|
SENDER *sender;
|
|
METER *smeter;
|
|
AMSQ *amsq;
|
|
AMD *amd;
|
|
FMD *fmd;
|
|
FMSQ *fmsq;
|
|
SNBA *snba;
|
|
EQP *eqp;
|
|
ANF *anf;
|
|
ANR *anr;
|
|
EMNR *emnr;
|
|
WCPAGC *agc;
|
|
METER *agcmeter;
|
|
BANDPASS *bp1;
|
|
BPS *bps1;
|
|
SIPHON *sip1;
|
|
CBL *cbl;
|
|
SPEAK *speak;
|
|
MPEAK *mpeak;
|
|
SSQL *ssql;
|
|
PANEL *panel;
|
|
RESAMPLE *rsmpout;
|
|
|
|
static RXA* create_rxa (
|
|
int in_rate, // input samplerate
|
|
int out_rate, // output samplerate
|
|
int dsp_rate, // sample rate for mainstream dsp processing
|
|
int dsp_size // number complex samples processed per buffer in mainstream dsp processing
|
|
);
|
|
static void destroy_rxa (RXA *rxa);
|
|
static void flush_rxa (RXA *rxa);
|
|
static void xrxa (RXA *rxa);
|
|
int get_insize() const { return dsp_insize; }
|
|
int get_outsize() const { return dsp_outsize; }
|
|
float *get_inbuff() { return inbuff; }
|
|
float *get_outbuff() { return outbuff; }
|
|
void setSpectrumProbe(BufferProbe *_spectrumProbe);
|
|
static void setInputSamplerate (RXA *rxa, int in_rate);
|
|
static void setOutputSamplerate (RXA *rxa, int out_rate);
|
|
static void setDSPSamplerate (RXA *rxa, int dsp_rate);
|
|
static void setDSPBuffsize (RXA *rxa, int dsp_size);
|
|
|
|
// RXA Properties
|
|
static void SetMode (RXA& rxa, int mode);
|
|
static void ResCheck (RXA& rxa);
|
|
static void bp1Check (RXA& rxa, int amd_run, int snba_run, int emnr_run, int anf_run, int anr_run);
|
|
static void bp1Set (RXA& rxa);
|
|
static void bpsnbaCheck (RXA& rxa, int mode, int notch_run);
|
|
static void bpsnbaSet (RXA& rxa);
|
|
|
|
// Collectives
|
|
static void SetPassband (RXA& rxa, float f_low, float f_high);
|
|
static void SetNC (RXA& rxa, int nc);
|
|
static void SetMP (RXA& rxa, int mp);
|
|
|
|
private:
|
|
float* inbuff;
|
|
float* midbuff;
|
|
float* outbuff;
|
|
};
|
|
|
|
} // namespace WDSP
|
|
|
|
#endif
|