1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

WDSP: simplify RXA structs

This commit is contained in:
f4exb 2024-07-23 00:39:21 +02:00
parent 78b73ae529
commit 994898d9fc
28 changed files with 568 additions and 631 deletions

View File

@ -45,9 +45,7 @@ class LDPCEncoder
return b < TYPE(0) ? -a : b > TYPE(0) ? a : TYPE(0);
}
public:
LDPCEncoder()
{
}
LDPCEncoder() = default
void init(LDPCInterface *it)
{

View File

@ -89,7 +89,7 @@ RXA* RXA::create_rxa (
std::fill(rxa->meter, rxa->meter + RXA_METERTYPE_LAST, 0);
// Noise blanker (ANB or "NB")
rxa->anb.p = ANB::create_anb(
rxa->anb = ANB::create_anb(
0, // run
rxa->dsp_insize, // input buffer size
rxa->inbuff, // pointer to input buffer
@ -102,7 +102,7 @@ RXA* RXA::create_rxa (
30 // thershold
);
// Noise blanker (NOB or "NB2")
rxa->nob.p = NOB::create_nob(
rxa->nob = NOB::create_nob(
0, // run
rxa->dsp_insize, // input buffer size
rxa->inbuff, // pointer to input buffer
@ -119,7 +119,7 @@ RXA* RXA::create_rxa (
);
// Ftequency shifter - shift to select a slice of spectrum
rxa->shift.p = SHIFT::create_shift (
rxa->shift = SHIFT::create_shift (
0, // run
rxa->dsp_insize, // input buffer size
rxa->inbuff, // pointer to input buffer
@ -128,7 +128,7 @@ RXA* RXA::create_rxa (
0.0); // amount to shift (Hz)
// Input resampler - resample to dsp rate for main processing
rxa->rsmpin.p = RESAMPLE::create_resample (
rxa->rsmpin = RESAMPLE::create_resample (
0, // run - will be turned ON below if needed
rxa->dsp_insize, // input buffer size
rxa->inbuff, // pointer to input buffer
@ -140,7 +140,7 @@ RXA* RXA::create_rxa (
1.0); // gain
// Signal generator
rxa->gen0.p = GEN::create_gen (
rxa->gen0 = GEN::create_gen (
0, // run
rxa->dsp_size, // buffer size
rxa->midbuff, // input buffer
@ -149,7 +149,7 @@ RXA* RXA::create_rxa (
2); // mode
// Input meter - ADC
rxa->adcmeter.p = METER::create_meter (
rxa->adcmeter = METER::create_meter (
0, // run
0, // optional pointer to another 'run'
rxa->dsp_size, // size
@ -166,12 +166,12 @@ RXA* RXA::create_rxa (
// Notched bandpass section
// notch database
rxa->ndb.p = NOTCHDB::create_notchdb (
rxa->ndb = NOTCHDB::create_notchdb (
0, // master run for all nbp's
1024); // max number of notches
// notched bandpass
rxa->nbp0.p = NBP::create_nbp (
rxa->nbp0 = NBP::create_nbp (
1, // run, always runs
0, // run the notches
0, // position
@ -187,10 +187,10 @@ RXA* RXA::create_rxa (
1.0, // gain
1, // auto-increase notch width
1025, // max number of passbands
rxa->ndb.p); // addr of database pointer
rxa->ndb); // addr of database pointer
// bandpass for snba
rxa->bpsnba.p = BPSNBA::create_bpsnba (
rxa->bpsnba = BPSNBA::create_bpsnba (
0, // bpsnba run flag
0, // run the notches
0, // position
@ -208,10 +208,10 @@ RXA* RXA::create_rxa (
1.0, // gain
1, // auto-increase notch width
1025, // max number of passbands
rxa->ndb.p); // addr of database pointer
rxa->ndb); // addr of database pointer
// Post filter display send - send spectrum display (after S-meter in the block diagram)
rxa->sender.p = SENDER::create_sender (
rxa->sender = SENDER::create_sender (
0, // run
0, // flag
0, // mode
@ -222,7 +222,7 @@ RXA* RXA::create_rxa (
// End notched bandpass section
// S-meter
rxa->smeter.p = METER::create_meter (
rxa->smeter = METER::create_meter (
1, // run
0, // optional pointer to another 'run'
rxa->dsp_size, // size
@ -237,7 +237,7 @@ RXA* RXA::create_rxa (
0); // pointer for gain computation
// AM squelch capture (for other modes than FM)
rxa->amsq.p = AMSQ::create_amsq (
rxa->amsq = AMSQ::create_amsq (
0, // run
rxa->dsp_size, // buffer size
rxa->midbuff, // pointer to signal input buffer used by xamsq
@ -254,7 +254,7 @@ RXA* RXA::create_rxa (
0.0); // muted gain
// AM/SAM demodulator
rxa->amd.p = AMD::create_amd (
rxa->amd = AMD::create_amd (
0, // run - OFF by default
rxa->dsp_size, // buffer size
rxa->midbuff, // pointer to input buffer
@ -271,7 +271,7 @@ RXA* RXA::create_rxa (
1.4); // tauI
// FM demodulator
rxa->fmd.p = FMD::create_fmd (
rxa->fmd = FMD::create_fmd (
0, // run
rxa->dsp_size, // buffer size
rxa->midbuff, // pointer to input buffer
@ -294,15 +294,15 @@ RXA* RXA::create_rxa (
0); // min phase flag for audio cutoff filter
// FM squelch apply
rxa->fmsq.p = FMSQ::create_fmsq (
rxa->fmsq = FMSQ::create_fmsq (
0, // run
rxa->dsp_size, // buffer size
rxa->midbuff, // pointer to input signal buffer
rxa->midbuff, // pointer to output signal buffer
rxa->fmd.p->audio, // pointer to trigger buffer
rxa->fmd->audio, // pointer to trigger buffer
rxa->dsp_rate, // sample rate
5000.0, // cutoff freq for noise filter (Hz)
&rxa->fmd.p->pllpole, // pointer to pole frequency of the fmd pll (Hz)
&rxa->fmd->pllpole, // pointer to pole frequency of the fmd pll (Hz)
0.100, // delay time after channel flush
0.001, // tau for noise averaging
0.100, // tau for long noise averaging
@ -316,7 +316,7 @@ RXA* RXA::create_rxa (
0); // minimum phase flag
// Spectral noise blanker (SNB)
rxa->snba.p = SNBA::create_snba (
rxa->snba = SNBA::create_snba (
0, // run
rxa->midbuff, // input buffer
rxa->midbuff, // output buffer
@ -341,7 +341,7 @@ RXA* RXA::create_rxa (
float default_F[11] = {0.0, 32.0, 63.0, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0};
//float default_G[11] = {0.0, -12.0, -12.0, -12.0, -1.0, +1.0, +4.0, +9.0, +12.0, -10.0, -10.0};
float default_G[11] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
rxa->eqp.p = EQP::create_eqp (
rxa->eqp = EQP::create_eqp (
0, // run - OFF by default
rxa->dsp_size, // buffer size
std::max(2048, rxa->dsp_size), // number of filter coefficients
@ -357,7 +357,7 @@ RXA* RXA::create_rxa (
}
// Auto notch filter
rxa->anf.p = ANF::create_anf (
rxa->anf = ANF::create_anf (
0, // run - OFF by default
0, // position
rxa->dsp_size, // buffer size
@ -377,7 +377,7 @@ RXA* RXA::create_rxa (
3.0); // ldecr
// LMS noise reduction (ANR or "NR")
rxa->anr.p = ANR::create_anr (
rxa->anr = ANR::create_anr (
0, // run - OFF by default
0, // position
rxa->dsp_size, // buffer size
@ -397,7 +397,7 @@ RXA* RXA::create_rxa (
3.0); // ldecr
// Spectral noise reduyction (EMNR or "NR2")
rxa->emnr.p = EMNR::create_emnr (
rxa->emnr = EMNR::create_emnr (
0, // run
0, // position
rxa->dsp_size, // buffer size
@ -413,7 +413,7 @@ RXA* RXA::create_rxa (
1); // ae_run
// AGC
rxa->agc.p = WCPAGC::create_wcpagc (
rxa->agc = WCPAGC::create_wcpagc (
1, // run
3, // mode
1, // peakmode = envelope
@ -439,7 +439,7 @@ RXA* RXA::create_rxa (
0.100); // tau_hang_decay
// AGC meter
rxa->agcmeter.p = METER::create_meter (
rxa->agcmeter = METER::create_meter (
0, // run
0, // optional pointer to another 'run'
rxa->dsp_size, // size
@ -451,10 +451,10 @@ RXA* RXA::create_rxa (
RXA_AGC_AV, // index for average value
RXA_AGC_PK, // index for peak value
RXA_AGC_GAIN, // index for gain value
&rxa->agc.p->gain); // pointer for gain computation
&rxa->agc->gain); // pointer for gain computation
// Bandpass filter - After spectral noise reduction in the block diagram
rxa->bp1.p = BANDPASS::create_bandpass (
rxa->bp1 = BANDPASS::create_bandpass (
1, // run - used only with ( AM || ANF || ANR || EMNR)
0, // position
rxa->dsp_size, // buffer size
@ -469,7 +469,7 @@ RXA* RXA::create_rxa (
1.0); // gain
// Scope/phase display send - pull phase & scope display data
rxa->sip1.p = SIPHON::create_siphon (
rxa->sip1 = SIPHON::create_siphon (
0, // run - needed only for phase display
0, // position
0, // mode
@ -481,7 +481,7 @@ RXA* RXA::create_rxa (
0); // specmode
// AM carrier block
rxa->cbl.p = CBL::create_cbl (
rxa->cbl = CBL::create_cbl (
0, // run - needed only if set to ON
rxa->dsp_size, // buffer size
rxa->midbuff, // pointer to input buffer
@ -491,7 +491,7 @@ RXA* RXA::create_rxa (
0.02); // tau
// CW peaking filter
rxa->speak.p = SPEAK::create_speak (
rxa->speak = SPEAK::create_speak (
0, // run
rxa->dsp_size, // buffer size,
rxa->midbuff, // pointer to input buffer
@ -509,7 +509,7 @@ RXA* RXA::create_rxa (
double def_freq[2] = {2125.0, 2295.0};
double def_bw[2] = {75.0, 75.0};
double def_gain[2] = {1.0, 1.0};
rxa->mpeak.p = MPEAK::create_mpeak (
rxa->mpeak = MPEAK::create_mpeak (
0, // run
rxa->dsp_size, // size
rxa->midbuff, // pointer to input buffer
@ -524,7 +524,7 @@ RXA* RXA::create_rxa (
}
// Syllabic squelch (Voice suelch) - Not in the block diagram
rxa->ssql.p = SSQL::create_ssql(
rxa->ssql = SSQL::create_ssql(
0, // run
rxa->dsp_size, // size
rxa->midbuff, // pointer to input buffer
@ -541,7 +541,7 @@ RXA* RXA::create_rxa (
2000.0); // max freq for f_to_v converter
// PatchPanel
rxa->panel.p = PANEL::create_panel (
rxa->panel = PANEL::create_panel (
1, // run
rxa->dsp_size, // size
rxa->midbuff, // pointer to input buffer
@ -555,7 +555,7 @@ RXA* RXA::create_rxa (
// AM squelch apply - absent but in the block diagram
// Output resampler
rxa->rsmpout.p = RESAMPLE::create_resample (
rxa->rsmpout = RESAMPLE::create_resample (
0, // run - will be turned ON below if needed
rxa->dsp_size, // input buffer size
rxa->midbuff, // pointer to input buffer
@ -573,36 +573,36 @@ RXA* RXA::create_rxa (
void RXA::destroy_rxa (RXA *rxa)
{
RESAMPLE::destroy_resample (rxa->rsmpout.p);
PANEL::destroy_panel (rxa->panel.p);
SSQL::destroy_ssql (rxa->ssql.p);
MPEAK::destroy_mpeak (rxa->mpeak.p);
SPEAK::destroy_speak (rxa->speak.p);
CBL::destroy_cbl (rxa->cbl.p);
SIPHON::destroy_siphon (rxa->sip1.p);
BANDPASS::destroy_bandpass (rxa->bp1.p);
METER::destroy_meter (rxa->agcmeter.p);
WCPAGC::destroy_wcpagc (rxa->agc.p);
EMNR::destroy_emnr (rxa->emnr.p);
ANR::destroy_anr (rxa->anr.p);
ANF::destroy_anf (rxa->anf.p);
EQP::destroy_eqp (rxa->eqp.p);
SNBA::destroy_snba (rxa->snba.p);
FMSQ::destroy_fmsq (rxa->fmsq.p);
FMD::destroy_fmd (rxa->fmd.p);
AMD::destroy_amd (rxa->amd.p);
AMSQ::destroy_amsq (rxa->amsq.p);
METER::destroy_meter (rxa->smeter.p);
SENDER::destroy_sender (rxa->sender.p);
BPSNBA::destroy_bpsnba (rxa->bpsnba.p);
NBP::destroy_nbp (rxa->nbp0.p);
NOTCHDB::destroy_notchdb (rxa->ndb.p);
METER::destroy_meter (rxa->adcmeter.p);
GEN::destroy_gen (rxa->gen0.p);
RESAMPLE::destroy_resample (rxa->rsmpin.p);
SHIFT::destroy_shift (rxa->shift.p);
ANB::destroy_anb(rxa->anb.p);
NOB::destroy_nob(rxa->nob.p);
RESAMPLE::destroy_resample (rxa->rsmpout);
PANEL::destroy_panel (rxa->panel);
SSQL::destroy_ssql (rxa->ssql);
MPEAK::destroy_mpeak (rxa->mpeak);
SPEAK::destroy_speak (rxa->speak);
CBL::destroy_cbl (rxa->cbl);
SIPHON::destroy_siphon (rxa->sip1);
BANDPASS::destroy_bandpass (rxa->bp1);
METER::destroy_meter (rxa->agcmeter);
WCPAGC::destroy_wcpagc (rxa->agc);
EMNR::destroy_emnr (rxa->emnr);
ANR::destroy_anr (rxa->anr);
ANF::destroy_anf (rxa->anf);
EQP::destroy_eqp (rxa->eqp);
SNBA::destroy_snba (rxa->snba);
FMSQ::destroy_fmsq (rxa->fmsq);
FMD::destroy_fmd (rxa->fmd);
AMD::destroy_amd (rxa->amd);
AMSQ::destroy_amsq (rxa->amsq);
METER::destroy_meter (rxa->smeter);
SENDER::destroy_sender (rxa->sender);
BPSNBA::destroy_bpsnba (rxa->bpsnba);
NBP::destroy_nbp (rxa->nbp0);
NOTCHDB::destroy_notchdb (rxa->ndb);
METER::destroy_meter (rxa->adcmeter);
GEN::destroy_gen (rxa->gen0);
RESAMPLE::destroy_resample (rxa->rsmpin);
SHIFT::destroy_shift (rxa->shift);
NOB::destroy_nob(rxa->nob);
ANB::destroy_anb(rxa->anb);
delete[] (rxa->midbuff);
delete[] (rxa->outbuff);
delete[] (rxa->inbuff);
@ -614,76 +614,76 @@ void RXA::flush_rxa (RXA *rxa)
std::fill(rxa->inbuff, rxa->inbuff + 1 * rxa->dsp_insize * 2, 0);
std::fill(rxa->outbuff, rxa->outbuff + 1 * rxa->dsp_outsize * 2, 0);
std::fill(rxa->midbuff, rxa->midbuff + 2 * rxa->dsp_size * 2, 0);
SHIFT::flush_shift (rxa->shift.p);
RESAMPLE::flush_resample (rxa->rsmpin.p);
GEN::flush_gen (rxa->gen0.p);
METER::flush_meter (rxa->adcmeter.p);
NBP::flush_nbp (rxa->nbp0.p);
BPSNBA::flush_bpsnba (rxa->bpsnba.p);
SENDER::flush_sender (rxa->sender.p);
METER::flush_meter (rxa->smeter.p);
AMSQ::flush_amsq (rxa->amsq.p);
AMD::flush_amd (rxa->amd.p);
FMD::flush_fmd (rxa->fmd.p);
FMSQ::flush_fmsq (rxa->fmsq.p);
SNBA::flush_snba (rxa->snba.p);
EQP::flush_eqp (rxa->eqp.p);
ANF::flush_anf (rxa->anf.p);
ANR::flush_anr (rxa->anr.p);
EMNR::flush_emnr (rxa->emnr.p);
WCPAGC::flush_wcpagc (rxa->agc.p);
METER::flush_meter (rxa->agcmeter.p);
BANDPASS::flush_bandpass (rxa->bp1.p);
SIPHON::flush_siphon (rxa->sip1.p);
CBL::flush_cbl (rxa->cbl.p);
SPEAK::flush_speak (rxa->speak.p);
MPEAK::flush_mpeak (rxa->mpeak.p);
SSQL::flush_ssql (rxa->ssql.p);
PANEL::flush_panel (rxa->panel.p);
RESAMPLE::flush_resample (rxa->rsmpout.p);
ANB::flush_anb (rxa->anb.p);
NOB::flush_nob(rxa->nob.p);
ANB::flush_anb (rxa->anb);
NOB::flush_nob(rxa->nob);
SHIFT::flush_shift (rxa->shift);
RESAMPLE::flush_resample (rxa->rsmpin);
GEN::flush_gen (rxa->gen0);
METER::flush_meter (rxa->adcmeter);
NBP::flush_nbp (rxa->nbp0);
BPSNBA::flush_bpsnba (rxa->bpsnba);
SENDER::flush_sender (rxa->sender);
METER::flush_meter (rxa->smeter);
AMSQ::flush_amsq (rxa->amsq);
AMD::flush_amd (rxa->amd);
FMD::flush_fmd (rxa->fmd);
FMSQ::flush_fmsq (rxa->fmsq);
SNBA::flush_snba (rxa->snba);
EQP::flush_eqp (rxa->eqp);
ANF::flush_anf (rxa->anf);
ANR::flush_anr (rxa->anr);
EMNR::flush_emnr (rxa->emnr);
WCPAGC::flush_wcpagc (rxa->agc);
METER::flush_meter (rxa->agcmeter);
BANDPASS::flush_bandpass (rxa->bp1);
SIPHON::flush_siphon (rxa->sip1);
CBL::flush_cbl (rxa->cbl);
SPEAK::flush_speak (rxa->speak);
MPEAK::flush_mpeak (rxa->mpeak);
SSQL::flush_ssql (rxa->ssql);
PANEL::flush_panel (rxa->panel);
RESAMPLE::flush_resample (rxa->rsmpout);
}
void RXA::xrxa (RXA *rxa)
{
ANB::xanb (rxa->anb.p);
NOB::xnob (rxa->nob.p);
SHIFT::xshift (rxa->shift.p);
RESAMPLE::xresample (rxa->rsmpin.p);
GEN::xgen (rxa->gen0.p);
METER::xmeter (rxa->adcmeter.p);
BPSNBA::xbpsnbain (rxa->bpsnba.p, 0);
NBP::xnbp (rxa->nbp0.p, 0);
METER::xmeter (rxa->smeter.p);
SENDER::xsender (rxa->sender.p);
AMSQ::xamsqcap (rxa->amsq.p);
BPSNBA::xbpsnbaout (rxa->bpsnba.p, 0);
AMD::xamd (rxa->amd.p);
FMD::xfmd (rxa->fmd.p);
FMSQ::xfmsq (rxa->fmsq.p);
BPSNBA::xbpsnbain (rxa->bpsnba.p, 1);
BPSNBA::xbpsnbaout (rxa->bpsnba.p, 1);
SNBA::xsnba (rxa->snba.p);
EQP::xeqp (rxa->eqp.p);
ANF::xanf (rxa->anf.p, 0);
ANR::xanr (rxa->anr.p, 0);
EMNR::xemnr (rxa->emnr.p, 0);
BANDPASS::xbandpass (rxa->bp1.p, 0);
WCPAGC::xwcpagc (rxa->agc.p);
ANF::xanf (rxa->anf.p, 1);
ANR::xanr (rxa->anr.p, 1);
EMNR::xemnr (rxa->emnr.p, 1);
BANDPASS::xbandpass (rxa->bp1.p, 1);
METER::xmeter (rxa->agcmeter.p);
SIPHON::xsiphon (rxa->sip1.p, 0);
CBL::xcbl (rxa->cbl.p);
SPEAK::xspeak (rxa->speak.p);
MPEAK::xmpeak (rxa->mpeak.p);
SSQL::xssql (rxa->ssql.p);
PANEL::xpanel (rxa->panel.p);
AMSQ::xamsq (rxa->amsq.p);
RESAMPLE::xresample (rxa->rsmpout.p);
ANB::xanb (rxa->anb);
NOB::xnob (rxa->nob);
SHIFT::xshift (rxa->shift);
RESAMPLE::xresample (rxa->rsmpin);
GEN::xgen (rxa->gen0);
METER::xmeter (rxa->adcmeter);
BPSNBA::xbpsnbain (rxa->bpsnba, 0);
NBP::xnbp (rxa->nbp0, 0);
METER::xmeter (rxa->smeter);
SENDER::xsender (rxa->sender);
AMSQ::xamsqcap (rxa->amsq);
BPSNBA::xbpsnbaout (rxa->bpsnba, 0);
AMD::xamd (rxa->amd);
FMD::xfmd (rxa->fmd);
FMSQ::xfmsq (rxa->fmsq);
BPSNBA::xbpsnbain (rxa->bpsnba, 1);
BPSNBA::xbpsnbaout (rxa->bpsnba, 1);
SNBA::xsnba (rxa->snba);
EQP::xeqp (rxa->eqp);
ANF::xanf (rxa->anf, 0);
ANR::xanr (rxa->anr, 0);
EMNR::xemnr (rxa->emnr, 0);
BANDPASS::xbandpass (rxa->bp1, 0);
WCPAGC::xwcpagc (rxa->agc);
ANF::xanf (rxa->anf, 1);
ANR::xanr (rxa->anr, 1);
EMNR::xemnr (rxa->emnr, 1);
BANDPASS::xbandpass (rxa->bp1, 1);
METER::xmeter (rxa->agcmeter);
SIPHON::xsiphon (rxa->sip1, 0);
CBL::xcbl (rxa->cbl);
SPEAK::xspeak (rxa->speak);
MPEAK::xmpeak (rxa->mpeak);
SSQL::xssql (rxa->ssql);
PANEL::xpanel (rxa->panel);
AMSQ::xamsq (rxa->amsq);
RESAMPLE::xresample (rxa->rsmpout);
}
void RXA::setInputSamplerate (RXA *rxa, int in_rate)
@ -698,21 +698,21 @@ void RXA::setInputSamplerate (RXA *rxa, int in_rate)
delete[] (rxa->inbuff);
rxa->inbuff = new float[1 * rxa->dsp_insize * 2]; // (float *)malloc0(1 * ch.dsp_insize * sizeof(complex));
// anb
ANB::setBuffers_anb(rxa->anb.p, rxa->inbuff, rxa->inbuff);
ANB::setSize_anb(rxa->anb.p, rxa->dsp_insize);
ANB::setSamplerate_anb(rxa->anb.p, rxa->in_rate);
ANB::setBuffers_anb(rxa->anb, rxa->inbuff, rxa->inbuff);
ANB::setSize_anb(rxa->anb, rxa->dsp_insize);
ANB::setSamplerate_anb(rxa->anb, rxa->in_rate);
// nob
NOB::setBuffers_nob(rxa->nob.p, rxa->inbuff, rxa->inbuff);
NOB::setSize_nob(rxa->nob.p, rxa->dsp_insize);
NOB::setSamplerate_nob(rxa->nob.p, rxa->in_rate);
NOB::setBuffers_nob(rxa->nob, rxa->inbuff, rxa->inbuff);
NOB::setSize_nob(rxa->nob, rxa->dsp_insize);
NOB::setSamplerate_nob(rxa->nob, rxa->in_rate);
// shift
SHIFT::setBuffers_shift (rxa->shift.p, rxa->inbuff, rxa->inbuff);
SHIFT::setSize_shift (rxa->shift.p, rxa->dsp_insize);
SHIFT::setSamplerate_shift (rxa->shift.p, rxa->in_rate);
SHIFT::setBuffers_shift (rxa->shift, rxa->inbuff, rxa->inbuff);
SHIFT::setSize_shift (rxa->shift, rxa->dsp_insize);
SHIFT::setSamplerate_shift (rxa->shift, rxa->in_rate);
// input resampler
RESAMPLE::setBuffers_resample (rxa->rsmpin.p, rxa->inbuff, rxa->midbuff);
RESAMPLE::setSize_resample (rxa->rsmpin.p, rxa->dsp_insize);
RESAMPLE::setInRate_resample (rxa->rsmpin.p, rxa->in_rate);
RESAMPLE::setBuffers_resample (rxa->rsmpin, rxa->inbuff, rxa->midbuff);
RESAMPLE::setSize_resample (rxa->rsmpin, rxa->dsp_insize);
RESAMPLE::setInRate_resample (rxa->rsmpin, rxa->in_rate);
ResCheck (*rxa);
}
@ -728,8 +728,8 @@ void RXA::setOutputSamplerate (RXA *rxa, int out_rate)
delete[] (rxa->outbuff);
rxa->outbuff = new float[1 * rxa->dsp_outsize * 2]; // (float *)malloc0(1 * ch.dsp_outsize * sizeof(complex));
// output resampler
RESAMPLE::setBuffers_resample (rxa->rsmpout.p, rxa->midbuff, rxa->outbuff);
RESAMPLE::setOutRate_resample (rxa->rsmpout.p, rxa->out_rate);
RESAMPLE::setBuffers_resample (rxa->rsmpout, rxa->midbuff, rxa->outbuff);
RESAMPLE::setOutRate_resample (rxa->rsmpout, rxa->out_rate);
ResCheck (*rxa);
}
@ -752,47 +752,47 @@ void RXA::setDSPSamplerate (RXA *rxa, int dsp_rate)
delete[] (rxa->outbuff);
rxa->outbuff = new float[1 * rxa->dsp_outsize * 2]; // (float *)malloc0(1 * rxa->dsp_outsize * sizeof(complex));
// anb
ANB::setBuffers_anb (rxa->anb.p, rxa->inbuff, rxa->inbuff);
ANB::setSize_anb(rxa->anb.p, rxa->dsp_insize);
ANB::setBuffers_anb (rxa->anb, rxa->inbuff, rxa->inbuff);
ANB::setSize_anb(rxa->anb, rxa->dsp_insize);
// nob
NOB::setBuffers_nob(rxa->nob.p, rxa->inbuff, rxa->inbuff);
NOB::setSize_nob(rxa->nob.p, rxa->dsp_insize);
NOB::setBuffers_nob(rxa->nob, rxa->inbuff, rxa->inbuff);
NOB::setSize_nob(rxa->nob, rxa->dsp_insize);
// shift
SHIFT::setBuffers_shift (rxa->shift.p, rxa->inbuff, rxa->inbuff);
SHIFT::setSize_shift (rxa->shift.p, rxa->dsp_insize);
SHIFT::setBuffers_shift (rxa->shift, rxa->inbuff, rxa->inbuff);
SHIFT::setSize_shift (rxa->shift, rxa->dsp_insize);
// input resampler
RESAMPLE::setBuffers_resample (rxa->rsmpin.p, rxa->inbuff, rxa->midbuff);
RESAMPLE::setSize_resample (rxa->rsmpin.p, rxa->dsp_insize);
RESAMPLE::setOutRate_resample (rxa->rsmpin.p, rxa->dsp_rate);
RESAMPLE::setBuffers_resample (rxa->rsmpin, rxa->inbuff, rxa->midbuff);
RESAMPLE::setSize_resample (rxa->rsmpin, rxa->dsp_insize);
RESAMPLE::setOutRate_resample (rxa->rsmpin, rxa->dsp_rate);
// dsp_rate blocks
GEN::setSamplerate_gen (rxa->gen0.p, rxa->dsp_rate);
METER::setSamplerate_meter (rxa->adcmeter.p, rxa->dsp_rate);
NBP::setSamplerate_nbp (rxa->nbp0.p, rxa->dsp_rate);
BPSNBA::setSamplerate_bpsnba (rxa->bpsnba.p, rxa->dsp_rate);
METER::setSamplerate_meter (rxa->smeter.p, rxa->dsp_rate);
SENDER::setSamplerate_sender (rxa->sender.p, rxa->dsp_rate);
AMSQ::setSamplerate_amsq (rxa->amsq.p, rxa->dsp_rate);
AMD::setSamplerate_amd (rxa->amd.p, rxa->dsp_rate);
FMD::setSamplerate_fmd (rxa->fmd.p, rxa->dsp_rate);
FMSQ::setBuffers_fmsq (rxa->fmsq.p, rxa->midbuff, rxa->midbuff, rxa->fmd.p->audio);
FMSQ::setSamplerate_fmsq (rxa->fmsq.p, rxa->dsp_rate);
SNBA::setSamplerate_snba (rxa->snba.p, rxa->dsp_rate);
EQP::setSamplerate_eqp (rxa->eqp.p, rxa->dsp_rate);
ANF::setSamplerate_anf (rxa->anf.p, rxa->dsp_rate);
ANR::setSamplerate_anr (rxa->anr.p, rxa->dsp_rate);
EMNR::setSamplerate_emnr (rxa->emnr.p, rxa->dsp_rate);
BANDPASS::setSamplerate_bandpass (rxa->bp1.p, rxa->dsp_rate);
WCPAGC::setSamplerate_wcpagc (rxa->agc.p, rxa->dsp_rate);
METER::setSamplerate_meter (rxa->agcmeter.p, rxa->dsp_rate);
SIPHON::setSamplerate_siphon (rxa->sip1.p, rxa->dsp_rate);
CBL::setSamplerate_cbl (rxa->cbl.p, rxa->dsp_rate);
SPEAK::setSamplerate_speak (rxa->speak.p, rxa->dsp_rate);
MPEAK::setSamplerate_mpeak (rxa->mpeak.p, rxa->dsp_rate);
SSQL::setSamplerate_ssql (rxa->ssql.p, rxa->dsp_rate);
PANEL::setSamplerate_panel (rxa->panel.p, rxa->dsp_rate);
GEN::setSamplerate_gen (rxa->gen0, rxa->dsp_rate);
METER::setSamplerate_meter (rxa->adcmeter, rxa->dsp_rate);
NBP::setSamplerate_nbp (rxa->nbp0, rxa->dsp_rate);
BPSNBA::setSamplerate_bpsnba (rxa->bpsnba, rxa->dsp_rate);
METER::setSamplerate_meter (rxa->smeter, rxa->dsp_rate);
SENDER::setSamplerate_sender (rxa->sender, rxa->dsp_rate);
AMSQ::setSamplerate_amsq (rxa->amsq, rxa->dsp_rate);
AMD::setSamplerate_amd (rxa->amd, rxa->dsp_rate);
FMD::setSamplerate_fmd (rxa->fmd, rxa->dsp_rate);
FMSQ::setBuffers_fmsq (rxa->fmsq, rxa->midbuff, rxa->midbuff, rxa->fmd->audio);
FMSQ::setSamplerate_fmsq (rxa->fmsq, rxa->dsp_rate);
SNBA::setSamplerate_snba (rxa->snba, rxa->dsp_rate);
EQP::setSamplerate_eqp (rxa->eqp, rxa->dsp_rate);
ANF::setSamplerate_anf (rxa->anf, rxa->dsp_rate);
ANR::setSamplerate_anr (rxa->anr, rxa->dsp_rate);
EMNR::setSamplerate_emnr (rxa->emnr, rxa->dsp_rate);
BANDPASS::setSamplerate_bandpass (rxa->bp1, rxa->dsp_rate);
WCPAGC::setSamplerate_wcpagc (rxa->agc, rxa->dsp_rate);
METER::setSamplerate_meter (rxa->agcmeter, rxa->dsp_rate);
SIPHON::setSamplerate_siphon (rxa->sip1, rxa->dsp_rate);
CBL::setSamplerate_cbl (rxa->cbl, rxa->dsp_rate);
SPEAK::setSamplerate_speak (rxa->speak, rxa->dsp_rate);
MPEAK::setSamplerate_mpeak (rxa->mpeak, rxa->dsp_rate);
SSQL::setSamplerate_ssql (rxa->ssql, rxa->dsp_rate);
PANEL::setSamplerate_panel (rxa->panel, rxa->dsp_rate);
// output resampler
RESAMPLE::setBuffers_resample (rxa->rsmpout.p, rxa->midbuff, rxa->outbuff);
RESAMPLE::setInRate_resample (rxa->rsmpout.p, rxa->dsp_rate);
RESAMPLE::setBuffers_resample (rxa->rsmpout, rxa->midbuff, rxa->outbuff);
RESAMPLE::setInRate_resample (rxa->rsmpout, rxa->dsp_rate);
ResCheck (*rxa);
}
@ -817,75 +817,75 @@ void RXA::setDSPBuffsize (RXA *rxa, int dsp_size)
delete[] (rxa->outbuff);
rxa->outbuff = new float[1 * rxa->dsp_outsize * 2]; // (float *)malloc0(1 * rxa->dsp_outsize * sizeof(complex));
// anb
ANB::setBuffers_anb (rxa->anb.p, rxa->inbuff, rxa->inbuff);
ANB::setSize_anb (rxa->anb.p, rxa->dsp_insize);
ANB::setBuffers_anb (rxa->anb, rxa->inbuff, rxa->inbuff);
ANB::setSize_anb (rxa->anb, rxa->dsp_insize);
// nob
NOB::setBuffers_nob(rxa->nob.p, rxa->inbuff, rxa->inbuff);
NOB::setSize_nob(rxa->nob.p, rxa->dsp_insize);
NOB::setBuffers_nob(rxa->nob, rxa->inbuff, rxa->inbuff);
NOB::setSize_nob(rxa->nob, rxa->dsp_insize);
// shift
SHIFT::setBuffers_shift (rxa->shift.p, rxa->inbuff, rxa->inbuff);
SHIFT::setSize_shift (rxa->shift.p, rxa->dsp_insize);
SHIFT::setBuffers_shift (rxa->shift, rxa->inbuff, rxa->inbuff);
SHIFT::setSize_shift (rxa->shift, rxa->dsp_insize);
// input resampler
RESAMPLE::setBuffers_resample (rxa->rsmpin.p, rxa->inbuff, rxa->midbuff);
RESAMPLE::setSize_resample (rxa->rsmpin.p, rxa->dsp_insize);
RESAMPLE::setBuffers_resample (rxa->rsmpin, rxa->inbuff, rxa->midbuff);
RESAMPLE::setSize_resample (rxa->rsmpin, rxa->dsp_insize);
// dsp_size blocks
GEN::setBuffers_gen (rxa->gen0.p, rxa->midbuff, rxa->midbuff);
GEN::setSize_gen (rxa->gen0.p, rxa->dsp_size);
METER::setBuffers_meter (rxa->adcmeter.p, rxa->midbuff);
METER::setSize_meter (rxa->adcmeter.p, rxa->dsp_size);
NBP::setBuffers_nbp (rxa->nbp0.p, rxa->midbuff, rxa->midbuff);
NBP::setSize_nbp (rxa->nbp0.p, rxa->dsp_size);
BPSNBA::setBuffers_bpsnba (rxa->bpsnba.p, rxa->midbuff, rxa->midbuff);
BPSNBA::setSize_bpsnba (rxa->bpsnba.p, rxa->dsp_size);
METER::setBuffers_meter (rxa->smeter.p, rxa->midbuff);
METER::setSize_meter (rxa->smeter.p, rxa->dsp_size);
SENDER::setBuffers_sender (rxa->sender.p, rxa->midbuff);
SENDER::setSize_sender (rxa->sender.p, rxa->dsp_size);
AMSQ::setBuffers_amsq (rxa->amsq.p, rxa->midbuff, rxa->midbuff, rxa->midbuff);
AMSQ::setSize_amsq (rxa->amsq.p, rxa->dsp_size);
AMD::setBuffers_amd (rxa->amd.p, rxa->midbuff, rxa->midbuff);
AMD::setSize_amd (rxa->amd.p, rxa->dsp_size);
FMD::setBuffers_fmd (rxa->fmd.p, rxa->midbuff, rxa->midbuff);
FMD::setSize_fmd (rxa->fmd.p, rxa->dsp_size);
FMSQ::setBuffers_fmsq (rxa->fmsq.p, rxa->midbuff, rxa->midbuff, rxa->fmd.p->audio);
FMSQ::setSize_fmsq (rxa->fmsq.p, rxa->dsp_size);
SNBA::setBuffers_snba (rxa->snba.p, rxa->midbuff, rxa->midbuff);
SNBA::setSize_snba (rxa->snba.p, rxa->dsp_size);
EQP::setBuffers_eqp (rxa->eqp.p, rxa->midbuff, rxa->midbuff);
EQP::setSize_eqp (rxa->eqp.p, rxa->dsp_size);
ANF::setBuffers_anf (rxa->anf.p, rxa->midbuff, rxa->midbuff);
ANF::setSize_anf (rxa->anf.p, rxa->dsp_size);
ANR::setBuffers_anr (rxa->anr.p, rxa->midbuff, rxa->midbuff);
ANR::setSize_anr (rxa->anr.p, rxa->dsp_size);
EMNR::setBuffers_emnr (rxa->emnr.p, rxa->midbuff, rxa->midbuff);
EMNR::setSize_emnr (rxa->emnr.p, rxa->dsp_size);
BANDPASS::setBuffers_bandpass (rxa->bp1.p, rxa->midbuff, rxa->midbuff);
BANDPASS::setSize_bandpass (rxa->bp1.p, rxa->dsp_size);
WCPAGC::setBuffers_wcpagc (rxa->agc.p, rxa->midbuff, rxa->midbuff);
WCPAGC::setSize_wcpagc (rxa->agc.p, rxa->dsp_size);
METER::setBuffers_meter (rxa->agcmeter.p, rxa->midbuff);
METER::setSize_meter (rxa->agcmeter.p, rxa->dsp_size);
SIPHON::setBuffers_siphon (rxa->sip1.p, rxa->midbuff);
SIPHON::setSize_siphon (rxa->sip1.p, rxa->dsp_size);
CBL::setBuffers_cbl (rxa->cbl.p, rxa->midbuff, rxa->midbuff);
CBL::setSize_cbl (rxa->cbl.p, rxa->dsp_size);
SPEAK::setBuffers_speak (rxa->speak.p, rxa->midbuff, rxa->midbuff);
SPEAK::setSize_speak (rxa->speak.p, rxa->dsp_size);
MPEAK::setBuffers_mpeak (rxa->mpeak.p, rxa->midbuff, rxa->midbuff);
MPEAK::setSize_mpeak (rxa->mpeak.p, rxa->dsp_size);
SSQL::setBuffers_ssql (rxa->ssql.p, rxa->midbuff, rxa->midbuff);
SSQL::setSize_ssql (rxa->ssql.p, rxa->dsp_size);
PANEL::setBuffers_panel (rxa->panel.p, rxa->midbuff, rxa->midbuff);
PANEL::setSize_panel (rxa->panel.p, rxa->dsp_size);
GEN::setBuffers_gen (rxa->gen0, rxa->midbuff, rxa->midbuff);
GEN::setSize_gen (rxa->gen0, rxa->dsp_size);
METER::setBuffers_meter (rxa->adcmeter, rxa->midbuff);
METER::setSize_meter (rxa->adcmeter, rxa->dsp_size);
NBP::setBuffers_nbp (rxa->nbp0, rxa->midbuff, rxa->midbuff);
NBP::setSize_nbp (rxa->nbp0, rxa->dsp_size);
BPSNBA::setBuffers_bpsnba (rxa->bpsnba, rxa->midbuff, rxa->midbuff);
BPSNBA::setSize_bpsnba (rxa->bpsnba, rxa->dsp_size);
METER::setBuffers_meter (rxa->smeter, rxa->midbuff);
METER::setSize_meter (rxa->smeter, rxa->dsp_size);
SENDER::setBuffers_sender (rxa->sender, rxa->midbuff);
SENDER::setSize_sender (rxa->sender, rxa->dsp_size);
AMSQ::setBuffers_amsq (rxa->amsq, rxa->midbuff, rxa->midbuff, rxa->midbuff);
AMSQ::setSize_amsq (rxa->amsq, rxa->dsp_size);
AMD::setBuffers_amd (rxa->amd, rxa->midbuff, rxa->midbuff);
AMD::setSize_amd (rxa->amd, rxa->dsp_size);
FMD::setBuffers_fmd (rxa->fmd, rxa->midbuff, rxa->midbuff);
FMD::setSize_fmd (rxa->fmd, rxa->dsp_size);
FMSQ::setBuffers_fmsq (rxa->fmsq, rxa->midbuff, rxa->midbuff, rxa->fmd->audio);
FMSQ::setSize_fmsq (rxa->fmsq, rxa->dsp_size);
SNBA::setBuffers_snba (rxa->snba, rxa->midbuff, rxa->midbuff);
SNBA::setSize_snba (rxa->snba, rxa->dsp_size);
EQP::setBuffers_eqp (rxa->eqp, rxa->midbuff, rxa->midbuff);
EQP::setSize_eqp (rxa->eqp, rxa->dsp_size);
ANF::setBuffers_anf (rxa->anf, rxa->midbuff, rxa->midbuff);
ANF::setSize_anf (rxa->anf, rxa->dsp_size);
ANR::setBuffers_anr (rxa->anr, rxa->midbuff, rxa->midbuff);
ANR::setSize_anr (rxa->anr, rxa->dsp_size);
EMNR::setBuffers_emnr (rxa->emnr, rxa->midbuff, rxa->midbuff);
EMNR::setSize_emnr (rxa->emnr, rxa->dsp_size);
BANDPASS::setBuffers_bandpass (rxa->bp1, rxa->midbuff, rxa->midbuff);
BANDPASS::setSize_bandpass (rxa->bp1, rxa->dsp_size);
WCPAGC::setBuffers_wcpagc (rxa->agc, rxa->midbuff, rxa->midbuff);
WCPAGC::setSize_wcpagc (rxa->agc, rxa->dsp_size);
METER::setBuffers_meter (rxa->agcmeter, rxa->midbuff);
METER::setSize_meter (rxa->agcmeter, rxa->dsp_size);
SIPHON::setBuffers_siphon (rxa->sip1, rxa->midbuff);
SIPHON::setSize_siphon (rxa->sip1, rxa->dsp_size);
CBL::setBuffers_cbl (rxa->cbl, rxa->midbuff, rxa->midbuff);
CBL::setSize_cbl (rxa->cbl, rxa->dsp_size);
SPEAK::setBuffers_speak (rxa->speak, rxa->midbuff, rxa->midbuff);
SPEAK::setSize_speak (rxa->speak, rxa->dsp_size);
MPEAK::setBuffers_mpeak (rxa->mpeak, rxa->midbuff, rxa->midbuff);
MPEAK::setSize_mpeak (rxa->mpeak, rxa->dsp_size);
SSQL::setBuffers_ssql (rxa->ssql, rxa->midbuff, rxa->midbuff);
SSQL::setSize_ssql (rxa->ssql, rxa->dsp_size);
PANEL::setBuffers_panel (rxa->panel, rxa->midbuff, rxa->midbuff);
PANEL::setSize_panel (rxa->panel, rxa->dsp_size);
// output resampler
RESAMPLE::setBuffers_resample (rxa->rsmpout.p, rxa->midbuff, rxa->outbuff);
RESAMPLE::setSize_resample (rxa->rsmpout.p, rxa->dsp_size);
RESAMPLE::setBuffers_resample (rxa->rsmpout, rxa->midbuff, rxa->outbuff);
RESAMPLE::setSize_resample (rxa->rsmpout, rxa->dsp_size);
}
void RXA::setSpectrumProbe(BufferProbe *spectrumProbe)
{
SENDER::SetSpectrum(*this, 1, spectrumProbe);
sender.p->run = 1;
sender->run = 1;
}
/********************************************************************************************************
@ -899,33 +899,33 @@ void RXA::SetMode (RXA& rxa, int mode)
if (rxa.mode != mode)
{
int amd_run = (mode == RXA_AM) || (mode == RXA_SAM);
bpsnbaCheck (rxa, mode, rxa.ndb.p->master_run);
bpsnbaCheck (rxa, mode, rxa.ndb->master_run);
bp1Check (
rxa,
amd_run,
rxa.snba.p->run,
rxa.emnr.p->run,
rxa.anf.p->run,
rxa.anr.p->run
rxa.snba->run,
rxa.emnr->run,
rxa.anf->run,
rxa.anr->run
);
rxa.mode = mode;
rxa.amd.p->run = 0;
rxa.fmd.p->run = 0;
rxa.amd->run = 0;
rxa.fmd->run = 0;
switch (mode)
{
case RXA_AM:
rxa.amd.p->run = 1;
rxa.amd.p->mode = 0;
rxa.amd->run = 1;
rxa.amd->mode = 0;
break;
case RXA_SAM:
rxa.amd.p->run = 1;
rxa.amd.p->mode = 1;
rxa.amd->run = 1;
rxa.amd->mode = 1;
break;
case RXA_DSB:
break;
case RXA_FM:
rxa.fmd.p->run = 1;
rxa.fmd->run = 1;
break;
default:
@ -940,12 +940,12 @@ void RXA::SetMode (RXA& rxa, int mode)
void RXA::ResCheck (RXA& rxa)
{
// turn OFF/ON resamplers depending upon whether they're needed
RESAMPLE *a = rxa.rsmpin.p;
RESAMPLE *a = rxa.rsmpin;
if (rxa.in_rate != rxa.dsp_rate)
a->run = 1;
else
a->run = 0;
a = rxa.rsmpout.p;
a = rxa.rsmpout;
if (rxa.dsp_rate != rxa.out_rate)
a->run = 1;
else
@ -961,7 +961,7 @@ void RXA::bp1Check (
int anr_run
)
{
BANDPASS *a = rxa.bp1.p;
BANDPASS *a = rxa.bp1;
float gain;
if (amd_run ||
snba_run ||
@ -978,13 +978,13 @@ void RXA::bp1Check (
void RXA::bp1Set (RXA& rxa)
{
BANDPASS *a = rxa.bp1.p;
BANDPASS *a = rxa.bp1;
int old = a->run;
if ((rxa.amd.p->run == 1) ||
(rxa.snba.p->run == 1) ||
(rxa.emnr.p->run == 1) ||
(rxa.anf.p->run == 1) ||
(rxa.anr.p->run == 1)
if ((rxa.amd->run == 1) ||
(rxa.snba->run == 1) ||
(rxa.emnr->run == 1) ||
(rxa.anf->run == 1) ||
(rxa.anr->run == 1)
)
a->run = 1;
else
@ -998,7 +998,7 @@ void RXA::bpsnbaCheck (RXA& rxa, int mode, int notch_run)
{
// for BPSNBA: set run, position, freqs, run_notches
// call this upon change in RXA_mode, snba_run, notch_master_run
BPSNBA *a = rxa.bpsnba.p;
BPSNBA *a = rxa.bpsnba;
float f_low = 0.0, f_high = 0.0;
int run_notches = 0;
switch (mode)
@ -1052,29 +1052,29 @@ void RXA::bpsnbaSet (RXA& rxa)
{
// for BPSNBA: set run, position, freqs, run_notches
// call this upon change in RXA_mode, snba_run, notch_master_run
BPSNBA *a = rxa.bpsnba.p;
BPSNBA *a = rxa.bpsnba;
switch (rxa.mode)
{
case RXA_LSB:
case RXA_CWL:
case RXA_DIGL:
a->run = rxa.snba.p->run;
a->run = rxa.snba->run;
a->position = 0;
break;
case RXA_USB:
case RXA_CWU:
case RXA_DIGU:
a->run = rxa.snba.p->run;
a->run = rxa.snba->run;
a->position = 0;
break;
case RXA_AM:
case RXA_SAM:
case RXA_DSB:
a->run = rxa.snba.p->run;
a->run = rxa.snba->run;
a->position = 1;
break;
case RXA_FM:
a->run = rxa.snba.p->run;
a->run = rxa.snba->run;
a->position = 1;
break;
case RXA_DRM:

View File

@ -98,118 +98,37 @@ public:
int mode;
double meter[RXA_METERTYPE_LAST];
struct
{
METER *p;
} smeter, adcmeter, agcmeter;
struct
{
SHIFT *p;
} shift;
struct
{
RESAMPLE *p;
} rsmpin, rsmpout;
struct
{
GEN *p;
} gen0;
struct
{
BANDPASS *p;
} bp1;
struct
{
BPS *p;
} bps1;
struct
{
NOTCHDB *p;
} ndb;
struct
{
NBP *p;
} nbp0;
struct
{
BPSNBA *p;
} bpsnba;
struct
{
SNBA *p;
} snba;
struct
{
SENDER *p;
} sender;
struct
{
AMSQ *p;
} amsq;
struct
{
AMD *p;
} amd;
struct
{
FMD *p;
} fmd;
struct
{
FMSQ *p;
} fmsq;
struct
{
EQP *p;
} eqp;
struct
{
ANF *p;
} anf;
struct
{
ANR *p;
} anr;
struct
{
EMNR *p;
} emnr;
struct
{
WCPAGC *p;
} agc;
struct
{
SPEAK *p;
} speak;
struct
{
MPEAK *p;
} mpeak;
struct
{
PANEL *p;
} panel;
struct
{
SIPHON *p;
} sip1;
struct
{
CBL *p;
} cbl;
struct
{
SSQL *p;
} ssql;
struct
{
ANB *p;
} anb;
struct
{
NOB *p;
} nob;
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

View File

@ -296,17 +296,17 @@ void AMD::setSize_amd (AMD *a, int size)
void AMD::SetAMDRun(RXA& rxa, int run)
{
AMD *a = rxa.amd.p;
AMD *a = rxa.amd;
if (a->run != run)
{
RXA::bp1Check (
rxa,
run,
rxa.snba.p->run,
rxa.emnr.p->run,
rxa.anf.p->run,
rxa.anr.p->run
rxa.snba->run,
rxa.emnr->run,
rxa.anf->run,
rxa.anr->run
);
a->run = run;
@ -316,12 +316,12 @@ void AMD::SetAMDRun(RXA& rxa, int run)
void AMD::SetAMDSBMode(RXA& rxa, int sbmode)
{
rxa.amd.p->sbmode = sbmode;
rxa.amd->sbmode = sbmode;
}
void AMD::SetAMDFadeLevel(RXA& rxa, int levelfade)
{
rxa.amd.p->levelfade = levelfade;
rxa.amd->levelfade = levelfade;
}
} // namesoace WDSP

View File

@ -255,20 +255,20 @@ void AMSQ::setSize_amsq (AMSQ *a, int size)
void AMSQ::SetAMSQRun (RXA& rxa, int run)
{
rxa.amsq.p->run = run;
rxa.amsq->run = run;
}
void AMSQ::SetAMSQThreshold (RXA& rxa, double threshold)
{
double thresh = pow (10.0, threshold / 20.0);
rxa.amsq.p->tail_thresh = 0.9 * thresh;
rxa.amsq.p->unmute_thresh = thresh;
rxa.amsq->tail_thresh = 0.9 * thresh;
rxa.amsq->unmute_thresh = thresh;
}
void AMSQ::SetAMSQMaxTail (RXA& rxa, double tail)
{
AMSQ *a;
a = rxa.amsq.p;
a = rxa.amsq;
if (tail < a->min_tail)
tail = a->min_tail;

View File

@ -241,54 +241,54 @@ void ANB::setSize_anb (ANB *a, int size)
void ANB::SetANBRun (RXA& rxa, int run)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->run = run;
}
void ANB::SetANBBuffsize (RXA& rxa, int size)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->buffsize = size;
}
void ANB::SetANBSamplerate (RXA& rxa, int rate)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->samplerate = (double) rate;
initBlanker (a);
}
void ANB::SetANBTau (RXA& rxa, double tau)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->tau = tau;
initBlanker (a);
}
void ANB::SetANBHangtime (RXA& rxa, double time)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->hangtime = time;
initBlanker (a);
}
void ANB::SetANBAdvtime (RXA& rxa, double time)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->advtime = time;
initBlanker (a);
}
void ANB::SetANBBacktau (RXA& rxa, double tau)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->backtau = tau;
initBlanker (a);
}
void ANB::SetANBThreshold (RXA& rxa, double thresh)
{
ANB *a = rxa.anb.p;
ANB *a = rxa.anb;
a->threshold = thresh;
}

View File

@ -184,17 +184,17 @@ void ANF::setSize_anf (ANF *a, int size)
void ANF::SetANFRun (RXA& rxa, int run)
{
ANF *a = rxa.anf.p;
ANF *a = rxa.anf;
if (a->run != run)
{
RXA::bp1Check (
rxa,
rxa.amd.p->run,
rxa.snba.p->run,
rxa.emnr.p->run,
rxa.amd->run,
rxa.snba->run,
rxa.emnr->run,
run,
rxa.anr.p->run
rxa.anr->run
);
a->run = run;
RXA::bp1Set (rxa);
@ -205,42 +205,42 @@ void ANF::SetANFRun (RXA& rxa, int run)
void ANF::SetANFVals (RXA& rxa, int taps, int delay, double gain, double leakage)
{
rxa.anf.p->n_taps = taps;
rxa.anf.p->delay = delay;
rxa.anf.p->two_mu = gain; //try two_mu = 1e-4
rxa.anf.p->gamma = leakage; //try gamma = 0.10
flush_anf (rxa.anf.p);
rxa.anf->n_taps = taps;
rxa.anf->delay = delay;
rxa.anf->two_mu = gain; //try two_mu = 1e-4
rxa.anf->gamma = leakage; //try gamma = 0.10
flush_anf (rxa.anf);
}
void ANF::SetANFTaps (RXA& rxa, int taps)
{
rxa.anf.p->n_taps = taps;
flush_anf (rxa.anf.p);
rxa.anf->n_taps = taps;
flush_anf (rxa.anf);
}
void ANF::SetANFDelay (RXA& rxa, int delay)
{
rxa.anf.p->delay = delay;
flush_anf (rxa.anf.p);
rxa.anf->delay = delay;
flush_anf (rxa.anf);
}
void ANF::SetANFGain (RXA& rxa, double gain)
{
rxa.anf.p->two_mu = gain;
flush_anf (rxa.anf.p);
rxa.anf->two_mu = gain;
flush_anf (rxa.anf);
}
void ANF::SetANFLeakage (RXA& rxa, double leakage)
{
rxa.anf.p->gamma = leakage;
flush_anf (rxa.anf.p);
rxa.anf->gamma = leakage;
flush_anf (rxa.anf);
}
void ANF::SetANFPosition (RXA& rxa, int position)
{
rxa.anf.p->position = position;
rxa.bp1.p->position = position;
flush_anf (rxa.anf.p);
rxa.anf->position = position;
rxa.bp1->position = position;
flush_anf (rxa.anf);
}
} // namespace WDSP

View File

@ -184,16 +184,16 @@ void ANR::setSize_anr (ANR *a, int size)
void ANR::SetANRRun (RXA& rxa, int run)
{
ANR *a = rxa.anr.p;
ANR *a = rxa.anr;
if (a->run != run)
{
RXA::bp1Check (
rxa,
rxa.amd.p->run,
rxa.snba.p->run,
rxa.emnr.p->run,
rxa.anf.p->run,
rxa.amd->run,
rxa.snba->run,
rxa.emnr->run,
rxa.anf->run,
run
);
a->run = run;
@ -204,42 +204,42 @@ void ANR::SetANRRun (RXA& rxa, int run)
void ANR::SetANRVals (RXA& rxa, int taps, int delay, double gain, double leakage)
{
rxa.anr.p->n_taps = taps;
rxa.anr.p->delay = delay;
rxa.anr.p->two_mu = gain;
rxa.anr.p->gamma = leakage;
flush_anr (rxa.anr.p);
rxa.anr->n_taps = taps;
rxa.anr->delay = delay;
rxa.anr->two_mu = gain;
rxa.anr->gamma = leakage;
flush_anr (rxa.anr);
}
void ANR::SetANRTaps (RXA& rxa, int taps)
{
rxa.anr.p->n_taps = taps;
flush_anr (rxa.anr.p);
rxa.anr->n_taps = taps;
flush_anr (rxa.anr);
}
void ANR::SetANRDelay (RXA& rxa, int delay)
{
rxa.anr.p->delay = delay;
flush_anr (rxa.anr.p);
rxa.anr->delay = delay;
flush_anr (rxa.anr);
}
void ANR::SetANRGain (RXA& rxa, double gain)
{
rxa.anr.p->two_mu = gain;
flush_anr (rxa.anr.p);
rxa.anr->two_mu = gain;
flush_anr (rxa.anr);
}
void ANR::SetANRLeakage (RXA& rxa, double leakage)
{
rxa.anr.p->gamma = leakage;
flush_anr (rxa.anr.p);
rxa.anr->gamma = leakage;
flush_anr (rxa.anr);
}
void ANR::SetANRPosition (RXA& rxa, int position)
{
rxa.anr.p->position = position;
rxa.bp1.p->position = position;
flush_anr (rxa.anr.p);
rxa.anr->position = position;
rxa.bp1->position = position;
flush_anr (rxa.anr);
}
} // namespace WDSP

View File

@ -189,7 +189,7 @@ void BANDPASS::CalcBandpassFilter (BANDPASS *a, double f_low, double f_high, dou
void BANDPASS::SetBandpassFreqs (RXA& rxa, double f_low, double f_high)
{
BANDPASS *a = rxa.bp1.p;
BANDPASS *a = rxa.bp1;
if ((f_low != a->f_low) || (f_high != a->f_high))
{
@ -215,7 +215,7 @@ void BANDPASS::SetBandpassNC (RXA& rxa, int nc)
{
// NOTE: 'nc' must be >= 'size'
BANDPASS *a;
a = rxa.bp1.p;
a = rxa.bp1;
if (nc != a->nc)
{
@ -237,7 +237,7 @@ void BANDPASS::SetBandpassNC (RXA& rxa, int nc)
void BANDPASS::SetBandpassMP (RXA& rxa, int mp)
{
BANDPASS *a;
a = rxa.bp1.p;
a = rxa.bp1;
if (mp != a->mp)
{

View File

@ -61,8 +61,18 @@ void BPS::decalc_bps (BPS *a)
delete[] (a->infilt);
}
BPS* BPS::create_bps (int run, int position, int size, float* in, float* out,
float f_low, float f_high, int samplerate, int wintype, float gain)
BPS* BPS::create_bps (
int run,
int position,
int size,
float* in,
float* out,
float f_low,
float f_high,
int samplerate,
int wintype,
float gain
)
{
BPS *a = new BPS;
a->run = run;
@ -150,14 +160,14 @@ void BPS::setFreqs_bps (BPS *a, float f_low, float f_high)
void BPS::SetBPSRun (RXA& rxa, int run)
{
rxa.bp1.p->run = run;
rxa.bp1->run = run;
}
void BPS::SetBPSFreqs (RXA& rxa, float f_low, float f_high)
{
float* impulse;
BPS *a1;
a1 = rxa.bps1.p;
a1 = rxa.bps1;
if ((f_low != a1->f_low) || (f_high != a1->f_high))
{
@ -174,7 +184,7 @@ void BPS::SetBPSWindow (RXA& rxa, int wintype)
{
float* impulse;
BPS *a1;
a1 = rxa.bps1.p;
a1 = rxa.bps1;
if ((a1->wintype != wintype))
{

View File

@ -61,8 +61,18 @@ public:
fftwf_plan CFor;
fftwf_plan CRev;
static BPS* create_bps (int run, int position, int size, float* in, float* out,
float f_low, float f_high, int samplerate, int wintype, float gain);
static BPS* create_bps (
int run,
int position,
int size,
float* in,
float* out,
float f_low,
float f_high,
int samplerate,
int wintype,
float gain
);
static void destroy_bps (BPS *a);
static void flush_bps (BPS *a);
static void xbps (BPS *a, int pos);

View File

@ -193,7 +193,7 @@ void BPSNBA::recalc_bpsnba_filter (BPSNBA *a, int update)
void BPSNBA::BPSNBASetNC (RXA& rxa, int nc)
{
BPSNBA *a = rxa.bpsnba.p;
BPSNBA *a = rxa.bpsnba;
if (a->nc != nc)
{
@ -205,7 +205,7 @@ void BPSNBA::BPSNBASetNC (RXA& rxa, int nc)
void BPSNBA::BPSNBASetMP (RXA& rxa, int mp)
{
BPSNBA *a = rxa.bpsnba.p;
BPSNBA *a = rxa.bpsnba;
if (a->mp != mp)
{

View File

@ -130,7 +130,7 @@ void CBL::setSize_cbl (CBL *a, int size)
void CBL::SetCBLRun(RXA& rxa, int setit)
{
rxa.cbl.p->run = setit;
rxa.cbl->run = setit;
}
} // namespace WDSP

View File

@ -1077,17 +1077,17 @@ void EMNR::setSize_emnr (EMNR *a, int size)
void EMNR::SetEMNRRun (RXA& rxa, int run)
{
EMNR *a = rxa.emnr.p;
EMNR *a = rxa.emnr;
if (a->run != run)
{
RXA::bp1Check (
rxa,
rxa.amd.p->run,
rxa.snba.p->run,
rxa.amd->run,
rxa.snba->run,
run,
rxa.anf.p->run,
rxa.anr.p->run
rxa.anf->run,
rxa.anr->run
);
a->run = run;
RXA::bp1Set (rxa);
@ -1096,33 +1096,33 @@ void EMNR::SetEMNRRun (RXA& rxa, int run)
void EMNR::SetEMNRgainMethod (RXA& rxa, int method)
{
rxa.emnr.p->g.gain_method = method;
rxa.emnr->g.gain_method = method;
}
void EMNR::SetEMNRnpeMethod (RXA& rxa, int method)
{
rxa.emnr.p->g.npe_method = method;
rxa.emnr->g.npe_method = method;
}
void EMNR::SetEMNRaeRun (RXA& rxa, int run)
{
rxa.emnr.p->g.ae_run = run;
rxa.emnr->g.ae_run = run;
}
void EMNR::SetEMNRPosition (RXA& rxa, int position)
{
rxa.emnr.p->position = position;
rxa.bp1.p->position = position;
rxa.emnr->position = position;
rxa.bp1->position = position;
}
void EMNR::SetEMNRaeZetaThresh (RXA& rxa, double zetathresh)
{
rxa.emnr.p->ae.zetaThresh = zetathresh;
rxa.emnr->ae.zetaThresh = zetathresh;
}
void EMNR::SetEMNRaePsi (RXA& rxa, double psi)
{
rxa.emnr.p->ae.psi = psi;
rxa.emnr->ae.psi = psi;
}
} // namespace WDSP

View File

@ -289,14 +289,14 @@ void EQP::setSize_eqp (EQP *a, int size)
void EQP::SetEQRun (RXA& rxa, int run)
{
rxa.eqp.p->run = run;
rxa.eqp->run = run;
}
void EQP::SetEQNC (RXA& rxa, int nc)
{
EQP *a;
float* impulse;
a = rxa.eqp.p;
a = rxa.eqp;
if (a->nc != nc)
{
@ -310,7 +310,7 @@ void EQP::SetEQNC (RXA& rxa, int nc)
void EQP::SetEQMP (RXA& rxa, int mp)
{
EQP *a;
a = rxa.eqp.p;
a = rxa.eqp;
if (a->mp != mp)
{
a->mp = mp;
@ -322,7 +322,7 @@ void EQP::SetEQProfile (RXA& rxa, int nfreqs, const float* F, const float* G)
{
EQP *a;
float* impulse;
a = rxa.eqp.p;
a = rxa.eqp;
delete[] (a->G);
delete[] (a->F);
a->nfreqs = nfreqs;
@ -340,7 +340,7 @@ void EQP::SetEQCtfmode (RXA& rxa, int mode)
{
EQP *a;
float* impulse;
a = rxa.eqp.p;
a = rxa.eqp;
a->ctfmode = mode;
impulse = eq_impulse (a->nc, a->nfreqs, a->F, a->G, a->samplerate, 1.0 / (2.0 * a->size), a->ctfmode, a->wintype);
FIRCORE::setImpulse_fircore (a->p, impulse, 1);
@ -351,7 +351,7 @@ void EQP::SetEQWintype (RXA& rxa, int wintype)
{
EQP *a;
float* impulse;
a = rxa.eqp.p;
a = rxa.eqp;
a->wintype = wintype;
impulse = eq_impulse (a->nc, a->nfreqs, a->F, a->G, a->samplerate, 1.0 / (2.0 * a->size), a->ctfmode, a->wintype);
FIRCORE::setImpulse_fircore (a->p, impulse, 1);
@ -362,7 +362,7 @@ void EQP::SetGrphEQ (RXA& rxa, int *rxeq)
{ // three band equalizer (legacy compatibility)
EQP *a;
float* impulse;
a = rxa.eqp.p;
a = rxa.eqp;
delete[] (a->G);
delete[] (a->F);
a->nfreqs = 4;
@ -388,7 +388,7 @@ void EQP::SetGrphEQ10 (RXA& rxa, int *rxeq)
EQP *a;
float* impulse;
int i;
a = rxa.eqp.p;
a = rxa.eqp;
delete[] (a->G);
delete[] (a->F);
a->nfreqs = 10;

View File

@ -275,7 +275,7 @@ void FMD::setSize_fmd (FMD *a, int size)
void FMD::SetFMDeviation (RXA& rxa, double deviation)
{
FMD *a;
a = rxa.fmd.p;
a = rxa.fmd;
a->deviation = deviation;
a->again = a->rate / (a->deviation * TWOPI);
}
@ -283,7 +283,7 @@ void FMD::SetFMDeviation (RXA& rxa, double deviation)
void FMD::SetCTCSSFreq (RXA& rxa, double freq)
{
FMD *a;
a = rxa.fmd.p;
a = rxa.fmd;
a->ctcss_freq = freq;
SNOTCH::SetSNCTCSSFreq (a->sntch, a->ctcss_freq);
}
@ -291,7 +291,7 @@ void FMD::SetCTCSSFreq (RXA& rxa, double freq)
void FMD::SetCTCSSRun (RXA& rxa, int run)
{
FMD *a;
a = rxa.fmd.p;
a = rxa.fmd;
a->sntch_run = run;
SNOTCH::SetSNCTCSSRun (a->sntch, a->sntch_run);
}
@ -300,7 +300,7 @@ void FMD::SetFMNCde (RXA& rxa, int nc)
{
FMD *a;
float* impulse;
a = rxa.fmd.p;
a = rxa.fmd;
if (a->nc_de != nc)
{
@ -314,7 +314,7 @@ void FMD::SetFMNCde (RXA& rxa, int nc)
void FMD::SetFMMPde (RXA& rxa, int mp)
{
FMD *a;
a = rxa.fmd.p;
a = rxa.fmd;
if (a->mp_de != mp)
{
a->mp_de = mp;
@ -326,7 +326,7 @@ void FMD::SetFMNCaud (RXA& rxa, int nc)
{
FMD *a;
float* impulse;
a = rxa.fmd.p;
a = rxa.fmd;
if (a->nc_aud != nc)
{
@ -340,7 +340,7 @@ void FMD::SetFMNCaud (RXA& rxa, int nc)
void FMD::SetFMMPaud (RXA& rxa, int mp)
{
FMD *a;
a = rxa.fmd.p;
a = rxa.fmd;
if (a->mp_aud != mp)
{
a->mp_aud = mp;
@ -351,7 +351,7 @@ void FMD::SetFMMPaud (RXA& rxa, int mp)
void FMD::SetFMLimRun (RXA& rxa, int run)
{
FMD *a;
a = rxa.fmd.p;
a = rxa.fmd;
if (a->lim_run != run) {
a->lim_run = run;
@ -361,7 +361,7 @@ void FMD::SetFMLimRun (RXA& rxa, int run)
void FMD::SetFMLimGain (RXA& rxa, double gaindB)
{
double gain = pow(10.0, gaindB / 20.0);
FMD *a = rxa.fmd.p;
FMD *a = rxa.fmd;
if (a->lim_gain != gain)
{
@ -373,7 +373,7 @@ void FMD::SetFMLimGain (RXA& rxa, double gaindB)
void FMD::SetFMAFFilter(RXA& rxa, double low, double high)
{
FMD *a = rxa.fmd.p;
FMD *a = rxa.fmd;
float* impulse;
if (a->f_low != low || a->f_high != high)

View File

@ -290,20 +290,20 @@ void FMSQ::setSize_fmsq (FMSQ *a, int size)
void FMSQ::SetFMSQRun (RXA& rxa, int run)
{
rxa.fmsq.p->run = run;
rxa.fmsq->run = run;
}
void FMSQ::SetFMSQThreshold (RXA& rxa, double threshold)
{
rxa.fmsq.p->tail_thresh = threshold;
rxa.fmsq.p->unmute_thresh = 0.9 * threshold;
rxa.fmsq->tail_thresh = threshold;
rxa.fmsq->unmute_thresh = 0.9 * threshold;
}
void FMSQ::SetFMSQNC (RXA& rxa, int nc)
{
FMSQ *a;
float* impulse;
a = rxa.fmsq.p;
a = rxa.fmsq;
if (a->nc != nc)
{
@ -317,7 +317,7 @@ void FMSQ::SetFMSQNC (RXA& rxa, int nc)
void FMSQ::SetFMSQMP (RXA& rxa, int mp)
{
FMSQ *a;
a = rxa.fmsq.p;
a = rxa.fmsq;
if (a->mp != mp)
{

View File

@ -390,46 +390,46 @@ void GEN::setSize_gen (GEN *a, int size)
void GEN::SetPreGenRun (RXA& rxa, int run)
{
rxa.gen0.p->run = run;
rxa.gen0->run = run;
}
void GEN::SetPreGenMode (RXA& rxa, int mode)
{
rxa.gen0.p->mode = mode;
rxa.gen0->mode = mode;
}
void GEN::SetPreGenToneMag (RXA& rxa, float mag)
{
rxa.gen0.p->tone.mag = mag;
rxa.gen0->tone.mag = mag;
}
void GEN::SetPreGenToneFreq (RXA& rxa, float freq)
{
rxa.gen0.p->tone.freq = freq;
calc_tone (rxa.gen0.p);
rxa.gen0->tone.freq = freq;
calc_tone (rxa.gen0);
}
void GEN::SetPreGenNoiseMag (RXA& rxa, float mag)
{
rxa.gen0.p->noise.mag = mag;
rxa.gen0->noise.mag = mag;
}
void GEN::SetPreGenSweepMag (RXA& rxa, float mag)
{
rxa.gen0.p->sweep.mag = mag;
rxa.gen0->sweep.mag = mag;
}
void GEN::SetPreGenSweepFreq (RXA& rxa, float freq1, float freq2)
{
rxa.gen0.p->sweep.f1 = freq1;
rxa.gen0.p->sweep.f2 = freq2;
calc_sweep (rxa.gen0.p);
rxa.gen0->sweep.f1 = freq1;
rxa.gen0->sweep.f2 = freq2;
calc_sweep (rxa.gen0);
}
void GEN::SetPreGenSweepRate (RXA& rxa, float rate)
{
rxa.gen0.p->sweep.sweeprate = rate;
calc_sweep (rxa.gen0.p);
rxa.gen0->sweep.sweeprate = rate;
calc_sweep (rxa.gen0);
}

View File

@ -334,27 +334,27 @@ void SPEAK::setSize_speak (SPEAK *a, int size)
void SPEAK::SetSPCWRun (RXA& rxa, int run)
{
SPEAK *a = rxa.speak.p;
SPEAK *a = rxa.speak;
a->run = run;
}
void SPEAK::SetSPCWFreq (RXA& rxa, double freq)
{
SPEAK *a = rxa.speak.p;
SPEAK *a = rxa.speak;
a->f = freq;
calc_speak (a);
}
void SPEAK::SetSPCWBandwidth (RXA& rxa, double bw)
{
SPEAK *a = rxa.speak.p;
SPEAK *a = rxa.speak;
a->bw = bw;
calc_speak (a);
}
void SPEAK::SetSPCWGain (RXA& rxa, double gain)
{
SPEAK *a = rxa.speak.p;
SPEAK *a = rxa.speak;
a->gain = gain;
calc_speak (a);
}
@ -504,25 +504,25 @@ void MPEAK::setSize_mpeak (MPEAK *a, int size)
void MPEAK::SetmpeakRun (RXA& rxa, int run)
{
MPEAK *a = rxa.mpeak.p;
MPEAK *a = rxa.mpeak;
a->run = run;
}
void MPEAK::SetmpeakNpeaks (RXA& rxa, int npeaks)
{
MPEAK *a = rxa.mpeak.p;
MPEAK *a = rxa.mpeak;
a->npeaks = npeaks;
}
void MPEAK::SetmpeakFilEnable (RXA& rxa, int fil, int enable)
{
MPEAK *a = rxa.mpeak.p;
MPEAK *a = rxa.mpeak;
a->enable[fil] = enable;
}
void MPEAK::SetmpeakFilFreq (RXA& rxa, int fil, double freq)
{
MPEAK *a = rxa.mpeak.p;
MPEAK *a = rxa.mpeak;
a->f[fil] = freq;
a->pfil[fil]->f = freq;
SPEAK::calc_speak(a->pfil[fil]);
@ -530,7 +530,7 @@ void MPEAK::SetmpeakFilFreq (RXA& rxa, int fil, double freq)
void MPEAK::SetmpeakFilBw (RXA& rxa, int fil, double bw)
{
MPEAK *a = rxa.mpeak.p;
MPEAK *a = rxa.mpeak;
a->bw[fil] = bw;
a->pfil[fil]->bw = bw;
SPEAK::calc_speak(a->pfil[fil]);
@ -538,7 +538,7 @@ void MPEAK::SetmpeakFilBw (RXA& rxa, int fil, double bw)
void MPEAK::SetmpeakFilGain (RXA& rxa, int fil, double gain)
{
MPEAK *a = rxa.mpeak.p;
MPEAK *a = rxa.mpeak;
a->gain[fil] = gain;
a->pfil[fil]->gain = gain;
SPEAK::calc_speak(a->pfil[fil]);

View File

@ -414,14 +414,14 @@ void NBP::setMp_nbp (NBP *a)
void NBP::UpdateNBPFiltersLightWeight (RXA& rxa)
{ // called when setting tune freq or shift freq
calc_nbp_lightweight (rxa.nbp0.p);
calc_nbp_lightweight (rxa.bpsnba.p->bpsnba);
calc_nbp_lightweight (rxa.nbp0);
calc_nbp_lightweight (rxa.bpsnba->bpsnba);
}
void NBP::UpdateNBPFilters(RXA& rxa)
{
NBP *a = rxa.nbp0.p;
BPSNBA *b = rxa.bpsnba.p;
NBP *a = rxa.nbp0;
BPSNBA *b = rxa.bpsnba;
if (a->fnfrun)
{
calc_nbp_impulse (a);
@ -439,7 +439,7 @@ int NBP::NBPAddNotch (RXA& rxa, int notch, double fcenter, double fwidth, int ac
NOTCHDB *b;
int i, j;
int rval;
b = rxa.ndb.p;
b = rxa.ndb;
if (notch <= b->nn && b->nn < b->maxnotches)
{
b->nn++;
@ -468,7 +468,7 @@ int NBP::NBPGetNotch (RXA& rxa, int notch, double* fcenter, double* fwidth, int*
{
NOTCHDB *a;
int rval;
a = rxa.ndb.p;
a = rxa.ndb;
if (notch < a->nn)
{
@ -493,7 +493,7 @@ int NBP::NBPDeleteNotch (RXA& rxa, int notch)
int i, j;
int rval;
NOTCHDB *a;
a = rxa.ndb.p;
a = rxa.ndb;
if (notch < a->nn)
{
a->nn--;
@ -517,7 +517,7 @@ int NBP::NBPEditNotch (RXA& rxa, int notch, double fcenter, double fwidth, int a
{
NOTCHDB *a;
int rval;
a = rxa.ndb.p;
a = rxa.ndb;
if (notch < a->nn)
{
a->fcenter[notch] = fcenter;
@ -536,14 +536,14 @@ int NBP::NBPEditNotch (RXA& rxa, int notch, double fcenter, double fwidth, int a
void NBP::NBPGetNumNotches (RXA& rxa, int* nnotches)
{
NOTCHDB *a;
a = rxa.ndb.p;
a = rxa.ndb;
*nnotches = a->nn;
}
void NBP::NBPSetTuneFrequency (RXA& rxa, double tunefreq)
{
NOTCHDB *a;
a = rxa.ndb.p;
a = rxa.ndb;
if (tunefreq != a->tunefreq)
{
@ -555,7 +555,7 @@ void NBP::NBPSetTuneFrequency (RXA& rxa, double tunefreq)
void NBP::NBPSetShiftFrequency (RXA& rxa, double shift)
{
NOTCHDB *a;
a = rxa.ndb.p;
a = rxa.ndb;
if (shift != a->shift)
{
a->shift = shift;
@ -565,8 +565,8 @@ void NBP::NBPSetShiftFrequency (RXA& rxa, double shift)
void NBP::NBPSetNotchesRun (RXA& rxa, int run)
{
NOTCHDB *a = rxa.ndb.p;
NBP *b = rxa.nbp0.p;
NOTCHDB *a = rxa.ndb;
NBP *b = rxa.nbp0;
if ( run != a->master_run)
{
@ -586,14 +586,14 @@ void NBP::NBPSetNotchesRun (RXA& rxa, int run)
void NBP::NBPSetRun (RXA& rxa, int run)
{
NBP *a;
a = rxa.nbp0.p;
a = rxa.nbp0;
a->run = run;
}
void NBP::NBPSetFreqs (RXA& rxa, double flow, double fhigh)
{
NBP *a;
a = rxa.nbp0.p;
a = rxa.nbp0;
if ((flow != a->flow) || (fhigh != a->fhigh))
{
@ -609,8 +609,8 @@ void NBP::NBPSetWindow (RXA& rxa, int wintype)
{
NBP *a;
BPSNBA *b;
a = rxa.nbp0.p;
b = rxa.bpsnba.p;
a = rxa.nbp0;
b = rxa.bpsnba;
if ((a->wintype != wintype))
{
@ -631,7 +631,7 @@ void NBP::NBPSetNC (RXA& rxa, int nc)
{
// NOTE: 'nc' must be >= 'size'
NBP *a;
a = rxa.nbp0.p;
a = rxa.nbp0;
if (a->nc != nc)
{
@ -643,7 +643,7 @@ void NBP::NBPSetNC (RXA& rxa, int nc)
void NBP::NBPSetMP (RXA& rxa, int mp)
{
NBP *a;
a = rxa.nbp0.p;
a = rxa.nbp0;
if (a->mp != mp)
{
@ -655,7 +655,7 @@ void NBP::NBPSetMP (RXA& rxa, int mp)
void NBP::NBPGetMinNotchWidth (RXA& rxa, double* minwidth)
{
NBP *a;
a = rxa.nbp0.p;
a = rxa.nbp0;
*minwidth = min_notch_width (a);
}
@ -663,8 +663,8 @@ void NBP::NBPSetAutoIncrease (RXA& rxa, int autoincr)
{
NBP *a;
BPSNBA *b;
a = rxa.nbp0.p;
b = rxa.bpsnba.p;
a = rxa.nbp0;
b = rxa.bpsnba;
if ((a->autoincr != autoincr))
{

View File

@ -614,32 +614,32 @@ void NOB::setSize_nob (NOB *a, int size)
void NOB::SetNOBRun (RXA& rxa, int run)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->run = run;
}
void NOB::SetNOBMode (RXA& rxa, int mode)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->mode = mode;
}
void NOB::SetNOBBuffsize (RXA& rxa, int size)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->buffsize = size;
}
void NOB::SetNOBSamplerate (RXA& rxa, int rate)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->samplerate = (double) rate;
init_nob (a);
}
void NOB::SetNOBTau (RXA& rxa, double tau)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->advslewtime = tau;
a->hangslewtime = tau;
init_nob (a);
@ -647,28 +647,28 @@ void NOB::SetNOBTau (RXA& rxa, double tau)
void NOB::SetNOBHangtime (RXA& rxa, double time)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->hangtime = time;
init_nob (a);
}
void NOB::SetNOBAdvtime (RXA& rxa, double time)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->advtime = time;
init_nob (a);
}
void NOB::SetNOBBacktau (RXA& rxa, double tau)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->backtau = tau;
init_nob (a);
}
void NOB::SetNOBThreshold (RXA& rxa, double thresh)
{
NOB *a = rxa.nob.p;
NOB *a = rxa.nob;
a->threshold = thresh;
}

View File

@ -139,23 +139,23 @@ void PANEL::setSize_panel (PANEL *a, int size)
void PANEL::SetPanelRun (RXA& rxa, int run)
{
rxa.panel.p->run = run;
rxa.panel->run = run;
}
void PANEL::SetPanelSelect (RXA& rxa, int select)
{
rxa.panel.p->inselect = select;
rxa.panel->inselect = select;
}
void PANEL::SetPanelGain1 (RXA& rxa, double gain)
{
rxa.panel.p->gain1 = gain;
rxa.panel->gain1 = gain;
}
void PANEL::SetPanelGain2 (RXA& rxa, double gainI, double gainQ)
{
rxa.panel.p->gain2I = gainI;
rxa.panel.p->gain2Q = gainQ;
rxa.panel->gain2I = gainI;
rxa.panel->gain2Q = gainQ;
}
void PANEL::SetPanelPan (RXA& rxa, double pan)
@ -173,18 +173,18 @@ void PANEL::SetPanelPan (RXA& rxa, double pan)
gain2 = 1.0;
}
rxa.panel.p->gain2I = gain1;
rxa.panel.p->gain2Q = gain2;
rxa.panel->gain2I = gain1;
rxa.panel->gain2Q = gain2;
}
void PANEL::SetPanelCopy (RXA& rxa, int copy)
{
rxa.panel.p->copy = copy;
rxa.panel->copy = copy;
}
void PANEL::SetPanelBinaural (RXA& rxa, int bin)
{
rxa.panel.p->copy = 1 - bin;
rxa.panel->copy = 1 - bin;
}
/********************************************************************************************************

View File

@ -94,7 +94,7 @@ void SENDER::setSize_sender (SENDER *a, int size)
void SENDER::SetSpectrum (RXA& rxa, int flag, BufferProbe *spectrumProbe)
{
SENDER *a;
a = rxa.sender.p;
a = rxa.sender;
a->flag = flag;
a->spectrumProbe = spectrumProbe;
}

View File

@ -123,13 +123,13 @@ void SHIFT::setSize_shift (SHIFT *a, int size)
void SHIFT::SetShiftRun (RXA& rxa, int run)
{
rxa.shift.p->run = run;
rxa.shift->run = run;
}
void SHIFT::SetShiftFreq (RXA& rxa, double fshift)
{
rxa.shift.p->shift = fshift;
calc_shift (rxa.shift.p);
rxa.shift->shift = fshift;
calc_shift (rxa.shift);
}
} // namespace WDSP

View File

@ -194,7 +194,7 @@ void SIPHON::sip_spectrum (SIPHON *a)
void SIPHON::GetaSipF (RXA& rxa, float* out, int size)
{ // return raw samples as floats
SIPHON *a=rxa.sip1.p;
SIPHON *a=rxa.sip1;
int i;
a->outsize = size;
suck (a);
@ -206,7 +206,7 @@ void SIPHON::GetaSipF (RXA& rxa, float* out, int size)
void SIPHON::GetaSipF1 (RXA& rxa, float* out, int size)
{ // return raw samples as floats
SIPHON *a=rxa.sip1.p;
SIPHON *a=rxa.sip1;
int i;
a->outsize = size;
suck (a);

View File

@ -719,18 +719,18 @@ void SNBA::xsnba (SNBA *d)
void SNBA::SetSNBARun (RXA& rxa, int run)
{
SNBA *a = rxa.snba.p;
SNBA *a = rxa.snba;
if (a->run != run)
{
RXA::bpsnbaCheck (rxa, rxa.mode, rxa.ndb.p->master_run);
RXA::bpsnbaCheck (rxa, rxa.mode, rxa.ndb->master_run);
RXA::bp1Check (
rxa,
rxa.amd.p->run,
rxa.amd->run,
run,
rxa.emnr.p->run,
rxa.anf.p->run,
rxa.anr.p->run
rxa.emnr->run,
rxa.anf->run,
rxa.anr->run
);
a->run = run;
RXA::bp1Set (rxa);
@ -740,54 +740,54 @@ void SNBA::SetSNBARun (RXA& rxa, int run)
void SNBA::SetSNBAovrlp (RXA& rxa, int ovrlp)
{
decalc_snba (rxa.snba.p);
rxa.snba.p->ovrlp = ovrlp;
calc_snba (rxa.snba.p);
decalc_snba (rxa.snba);
rxa.snba->ovrlp = ovrlp;
calc_snba (rxa.snba);
}
void SNBA::SetSNBAasize (RXA& rxa, int size)
{
rxa.snba.p->exec.asize = size;
rxa.snba->exec.asize = size;
}
void SNBA::SetSNBAnpasses (RXA& rxa, int npasses)
{
rxa.snba.p->exec.npasses = npasses;
rxa.snba->exec.npasses = npasses;
}
void SNBA::SetSNBAk1 (RXA& rxa, double k1)
{
rxa.snba.p->sdet.k1 = k1;
rxa.snba->sdet.k1 = k1;
}
void SNBA::SetSNBAk2 (RXA& rxa, double k2)
{
rxa.snba.p->sdet.k2 = k2;
rxa.snba->sdet.k2 = k2;
}
void SNBA::SetSNBAbridge (RXA& rxa, int bridge)
{
rxa.snba.p->sdet.b = bridge;
rxa.snba->sdet.b = bridge;
}
void SNBA::SetSNBApresamps (RXA& rxa, int presamps)
{
rxa.snba.p->sdet.pre = presamps;
rxa.snba->sdet.pre = presamps;
}
void SNBA::SetSNBApostsamps (RXA& rxa, int postsamps)
{
rxa.snba.p->sdet.post = postsamps;
rxa.snba->sdet.post = postsamps;
}
void SNBA::SetSNBApmultmin (RXA& rxa, double pmultmin)
{
rxa.snba.p->scan.pmultmin = pmultmin;
rxa.snba->scan.pmultmin = pmultmin;
}
void SNBA::SetSNBAOutputBandwidth (RXA& rxa, double flow, double fhigh)
{
SNBA *a = rxa.snba.p;
SNBA *a = rxa.snba;
RESAMPLE *d = a->outresamp;
double f_low, f_high;

View File

@ -350,21 +350,21 @@ void SSQL::setSize_ssql (SSQL *a, int size)
void SSQL::SetSSQLRun (RXA& rxa, int run)
{
rxa.ssql.p->run = run;
rxa.ssql->run = run;
}
void SSQL::SetSSQLThreshold (RXA& rxa, double threshold)
{
// 'threshold' should be between 0.0 and 1.0
// WU2O testing: 0.16 is a good default for 'threshold'; => 0.08 for 'wthresh'
rxa.ssql.p->wthresh = threshold / 2.0;
rxa.ssql->wthresh = threshold / 2.0;
}
void SSQL::SetSSQLTauMute (RXA& rxa, double tau_mute)
{
// reasonable (wide) range is 0.1 to 2.0
// WU2O testing: 0.1 is good default value
SSQL *a = rxa.ssql.p;
SSQL *a = rxa.ssql;
a->tr_tau_mute = tau_mute;
a->mute_mult = 1.0 - exp (-1.0 / (a->rate * a->tr_tau_mute));
}
@ -373,7 +373,7 @@ void SSQL::SetSSQLTauUnMute (RXA& rxa, double tau_unmute)
{
// reasonable (wide) range is 0.1 to 1.0
// WU2O testing: 0.1 is good default value
SSQL *a = rxa.ssql.p;
SSQL *a = rxa.ssql;
a->tr_tau_unmute = tau_unmute;
a->unmute_mult = 1.0 - exp (-1.0 / (a->rate * a->tr_tau_unmute));
}

View File

@ -390,63 +390,63 @@ void WCPAGC::SetAGCMode (RXA& rxa, int mode)
switch (mode)
{
case 0: //agcOFF
rxa.agc.p->mode = 0;
loadWcpAGC ( rxa.agc.p );
rxa.agc->mode = 0;
loadWcpAGC ( rxa.agc );
break;
case 1: //agcLONG
rxa.agc.p->mode = 1;
rxa.agc.p->hangtime = 2.000;
rxa.agc.p->tau_decay = 2.000;
loadWcpAGC ( rxa.agc.p );
rxa.agc->mode = 1;
rxa.agc->hangtime = 2.000;
rxa.agc->tau_decay = 2.000;
loadWcpAGC ( rxa.agc );
break;
case 2: //agcSLOW
rxa.agc.p->mode = 2;
rxa.agc.p->hangtime = 1.000;
rxa.agc.p->tau_decay = 0.500;
loadWcpAGC ( rxa.agc.p );
rxa.agc->mode = 2;
rxa.agc->hangtime = 1.000;
rxa.agc->tau_decay = 0.500;
loadWcpAGC ( rxa.agc );
break;
case 3: //agcMED
rxa.agc.p->mode = 3;
rxa.agc.p->hang_thresh = 1.0;
rxa.agc.p->hangtime = 0.000;
rxa.agc.p->tau_decay = 0.250;
loadWcpAGC ( rxa.agc.p );
rxa.agc->mode = 3;
rxa.agc->hang_thresh = 1.0;
rxa.agc->hangtime = 0.000;
rxa.agc->tau_decay = 0.250;
loadWcpAGC ( rxa.agc );
break;
case 4: //agcFAST
rxa.agc.p->mode = 4;
rxa.agc.p->hang_thresh = 1.0;
rxa.agc.p->hangtime = 0.000;
rxa.agc.p->tau_decay = 0.050;
loadWcpAGC ( rxa.agc.p );
rxa.agc->mode = 4;
rxa.agc->hang_thresh = 1.0;
rxa.agc->hangtime = 0.000;
rxa.agc->tau_decay = 0.050;
loadWcpAGC ( rxa.agc );
break;
default:
rxa.agc.p->mode = 5;
rxa.agc->mode = 5;
break;
}
}
void WCPAGC::SetAGCAttack (RXA& rxa, int attack)
{
rxa.agc.p->tau_attack = (float)attack / 1000.0;
loadWcpAGC ( rxa.agc.p );
rxa.agc->tau_attack = (float)attack / 1000.0;
loadWcpAGC ( rxa.agc );
}
void WCPAGC::SetAGCDecay (RXA& rxa, int decay)
{
rxa.agc.p->tau_decay = (float)decay / 1000.0;
loadWcpAGC ( rxa.agc.p );
rxa.agc->tau_decay = (float)decay / 1000.0;
loadWcpAGC ( rxa.agc );
}
void WCPAGC::SetAGCHang (RXA& rxa, int hang)
{
rxa.agc.p->hangtime = (float)hang / 1000.0;
loadWcpAGC ( rxa.agc.p );
rxa.agc->hangtime = (float)hang / 1000.0;
loadWcpAGC ( rxa.agc );
}
void WCPAGC::GetAGCHangLevel(RXA& rxa, double *hangLevel)
//for line on bandscope
{
*hangLevel = 20.0 * log10( rxa.agc.p->hang_level / 0.637 );
*hangLevel = 20.0 * log10( rxa.agc->hang_level / 0.637 );
}
void WCPAGC::SetAGCHangLevel(RXA& rxa, double hangLevel)
@ -454,77 +454,77 @@ void WCPAGC::SetAGCHangLevel(RXA& rxa, double hangLevel)
{
double convert, tmp;
if (rxa.agc.p->max_input > rxa.agc.p->min_volts)
if (rxa.agc->max_input > rxa.agc->min_volts)
{
convert = pow (10.0, hangLevel / 20.0);
tmp = std::max(1e-8, (convert - rxa.agc.p->min_volts) / (rxa.agc.p->max_input - rxa.agc.p->min_volts));
rxa.agc.p->hang_thresh = 1.0 + 0.125 * log10 (tmp);
tmp = std::max(1e-8, (convert - rxa.agc->min_volts) / (rxa.agc->max_input - rxa.agc->min_volts));
rxa.agc->hang_thresh = 1.0 + 0.125 * log10 (tmp);
}
else
rxa.agc.p->hang_thresh = 1.0;
rxa.agc->hang_thresh = 1.0;
loadWcpAGC ( rxa.agc.p );
loadWcpAGC ( rxa.agc );
}
void WCPAGC::GetAGCHangThreshold(RXA& rxa, int *hangthreshold)
//for slider in setup
{
*hangthreshold = (int) (100.0 * rxa.agc.p->hang_thresh);
*hangthreshold = (int) (100.0 * rxa.agc->hang_thresh);
}
void WCPAGC::SetAGCHangThreshold (RXA& rxa, int hangthreshold)
//For slider in setup
{
rxa.agc.p->hang_thresh = (double) hangthreshold / 100.0;
loadWcpAGC ( rxa.agc.p );
rxa.agc->hang_thresh = (double) hangthreshold / 100.0;
loadWcpAGC ( rxa.agc );
}
void WCPAGC::GetAGCThresh(RXA& rxa, double *thresh, double size, double rate)
//for line on bandscope.
{
double noise_offset;
noise_offset = 10.0 * log10((rxa.nbp0.p->fhigh - rxa.nbp0.p->flow) * size / rate);
*thresh = 20.0 * log10( rxa.agc.p->min_volts ) - noise_offset;
noise_offset = 10.0 * log10((rxa.nbp0->fhigh - rxa.nbp0->flow) * size / rate);
*thresh = 20.0 * log10( rxa.agc->min_volts ) - noise_offset;
}
void WCPAGC::SetAGCThresh(RXA& rxa, double thresh, double size, double rate)
//for line on bandscope
{
double noise_offset;
noise_offset = 10.0 * log10((rxa.nbp0.p->fhigh - rxa.nbp0.p->flow) * size / rate);
rxa.agc.p->max_gain = rxa.agc.p->out_target / (rxa.agc.p->var_gain * pow (10.0, (thresh + noise_offset) / 20.0));
loadWcpAGC ( rxa.agc.p );
noise_offset = 10.0 * log10((rxa.nbp0->fhigh - rxa.nbp0->flow) * size / rate);
rxa.agc->max_gain = rxa.agc->out_target / (rxa.agc->var_gain * pow (10.0, (thresh + noise_offset) / 20.0));
loadWcpAGC ( rxa.agc );
}
void WCPAGC::GetAGCTop(RXA& rxa, double *max_agc)
//for AGC Max Gain in setup
{
*max_agc = 20 * log10 (rxa.agc.p->max_gain);
*max_agc = 20 * log10 (rxa.agc->max_gain);
}
void WCPAGC::SetAGCTop (RXA& rxa, double max_agc)
//for AGC Max Gain in setup
{
rxa.agc.p->max_gain = pow (10.0, (double) max_agc / 20.0);
loadWcpAGC ( rxa.agc.p );
rxa.agc->max_gain = pow (10.0, (double) max_agc / 20.0);
loadWcpAGC ( rxa.agc );
}
void WCPAGC::SetAGCSlope (RXA& rxa, int slope)
{
rxa.agc.p->var_gain = pow (10.0, (double) slope / 20.0 / 10.0);
loadWcpAGC ( rxa.agc.p );
rxa.agc->var_gain = pow (10.0, (double) slope / 20.0 / 10.0);
loadWcpAGC ( rxa.agc );
}
void WCPAGC::SetAGCFixed (RXA& rxa, double fixed_agc)
{
rxa.agc.p->fixed_gain = pow (10.0, (double) fixed_agc / 20.0);
loadWcpAGC ( rxa.agc.p );
rxa.agc->fixed_gain = pow (10.0, (double) fixed_agc / 20.0);
loadWcpAGC ( rxa.agc );
}
void WCPAGC::SetAGCMaxInputLevel (RXA& rxa, double level)
{
rxa.agc.p->max_input = level;
loadWcpAGC ( rxa.agc.p );
rxa.agc->max_input = level;
loadWcpAGC ( rxa.agc );
}
/********************************************************************************************************