mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-10 18:43:28 -05:00
WDSP: meter: replaced static methods
This commit is contained in:
parent
8842b56080
commit
42fa9f5eb2
@ -192,8 +192,8 @@ void WDSPRxSink::processOneSample(Complex &ci)
|
|||||||
WDSP::RXA::xrxa(m_rxa);
|
WDSP::RXA::xrxa(m_rxa);
|
||||||
|
|
||||||
m_sCount = m_wdspBufSize;
|
m_sCount = m_wdspBufSize;
|
||||||
m_sAvg = WDSP::METER::GetMeter(*m_rxa, WDSP::RXA::RXA_S_AV);
|
m_sAvg = m_rxa->smeter->getMeter(WDSP::RXA::RXA_S_AV);
|
||||||
m_sPeak = WDSP::METER::GetMeter(*m_rxa, WDSP::RXA::RXA_S_PK);
|
m_sPeak = m_rxa->smeter->getMeter(WDSP::RXA::RXA_S_PK);
|
||||||
|
|
||||||
for (int i = 0; i < m_rxa->get_outsize(); i++)
|
for (int i = 0; i < m_rxa->get_outsize(); i++)
|
||||||
{
|
{
|
||||||
|
42
wdsp/RXA.cpp
42
wdsp/RXA.cpp
@ -139,7 +139,7 @@ RXA* RXA::create_rxa (
|
|||||||
1.0); // gain
|
1.0); // gain
|
||||||
|
|
||||||
// Input meter - ADC
|
// Input meter - ADC
|
||||||
rxa->adcmeter = METER::create_meter (
|
rxa->adcmeter = new METER(
|
||||||
0, // run
|
0, // run
|
||||||
0, // optional pointer to another 'run'
|
0, // optional pointer to another 'run'
|
||||||
rxa->dsp_size, // size
|
rxa->dsp_size, // size
|
||||||
@ -212,7 +212,7 @@ RXA* RXA::create_rxa (
|
|||||||
// End notched bandpass section
|
// End notched bandpass section
|
||||||
|
|
||||||
// S-meter
|
// S-meter
|
||||||
rxa->smeter = METER::create_meter (
|
rxa->smeter = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
0, // optional pointer to another 'run'
|
0, // optional pointer to another 'run'
|
||||||
rxa->dsp_size, // size
|
rxa->dsp_size, // size
|
||||||
@ -429,7 +429,7 @@ RXA* RXA::create_rxa (
|
|||||||
0.100); // tau_hang_decay
|
0.100); // tau_hang_decay
|
||||||
|
|
||||||
// AGC meter
|
// AGC meter
|
||||||
rxa->agcmeter = METER::create_meter (
|
rxa->agcmeter = new METER(
|
||||||
0, // run
|
0, // run
|
||||||
0, // optional pointer to another 'run'
|
0, // optional pointer to another 'run'
|
||||||
rxa->dsp_size, // size
|
rxa->dsp_size, // size
|
||||||
@ -571,7 +571,7 @@ void RXA::destroy_rxa (RXA *rxa)
|
|||||||
CBL::destroy_cbl (rxa->cbl);
|
CBL::destroy_cbl (rxa->cbl);
|
||||||
SIPHON::destroy_siphon (rxa->sip1);
|
SIPHON::destroy_siphon (rxa->sip1);
|
||||||
BANDPASS::destroy_bandpass (rxa->bp1);
|
BANDPASS::destroy_bandpass (rxa->bp1);
|
||||||
METER::destroy_meter (rxa->agcmeter);
|
delete (rxa->agcmeter);
|
||||||
WCPAGC::destroy_wcpagc (rxa->agc);
|
WCPAGC::destroy_wcpagc (rxa->agc);
|
||||||
EMNR::destroy_emnr (rxa->emnr);
|
EMNR::destroy_emnr (rxa->emnr);
|
||||||
ANR::destroy_anr (rxa->anr);
|
ANR::destroy_anr (rxa->anr);
|
||||||
@ -582,12 +582,12 @@ void RXA::destroy_rxa (RXA *rxa)
|
|||||||
FMD::destroy_fmd (rxa->fmd);
|
FMD::destroy_fmd (rxa->fmd);
|
||||||
AMD::destroy_amd (rxa->amd);
|
AMD::destroy_amd (rxa->amd);
|
||||||
AMSQ::destroy_amsq (rxa->amsq);
|
AMSQ::destroy_amsq (rxa->amsq);
|
||||||
METER::destroy_meter (rxa->smeter);
|
delete (rxa->smeter);
|
||||||
SENDER::destroy_sender (rxa->sender);
|
SENDER::destroy_sender (rxa->sender);
|
||||||
BPSNBA::destroy_bpsnba (rxa->bpsnba);
|
BPSNBA::destroy_bpsnba (rxa->bpsnba);
|
||||||
NBP::destroy_nbp (rxa->nbp0);
|
NBP::destroy_nbp (rxa->nbp0);
|
||||||
NOTCHDB::destroy_notchdb (rxa->ndb);
|
NOTCHDB::destroy_notchdb (rxa->ndb);
|
||||||
METER::destroy_meter (rxa->adcmeter);
|
delete (rxa->adcmeter);
|
||||||
delete (rxa->rsmpin);
|
delete (rxa->rsmpin);
|
||||||
delete (rxa->shift);
|
delete (rxa->shift);
|
||||||
delete (rxa->nob);
|
delete (rxa->nob);
|
||||||
@ -607,11 +607,11 @@ void RXA::flush_rxa (RXA *rxa)
|
|||||||
rxa->nob->flush();
|
rxa->nob->flush();
|
||||||
rxa->shift->flush();
|
rxa->shift->flush();
|
||||||
rxa->rsmpin->flush();
|
rxa->rsmpin->flush();
|
||||||
METER::flush_meter (rxa->adcmeter);
|
rxa->adcmeter->flush();
|
||||||
NBP::flush_nbp (rxa->nbp0);
|
NBP::flush_nbp (rxa->nbp0);
|
||||||
BPSNBA::flush_bpsnba (rxa->bpsnba);
|
BPSNBA::flush_bpsnba (rxa->bpsnba);
|
||||||
SENDER::flush_sender (rxa->sender);
|
SENDER::flush_sender (rxa->sender);
|
||||||
METER::flush_meter (rxa->smeter);
|
rxa->smeter->flush();
|
||||||
AMSQ::flush_amsq (rxa->amsq);
|
AMSQ::flush_amsq (rxa->amsq);
|
||||||
AMD::flush_amd (rxa->amd);
|
AMD::flush_amd (rxa->amd);
|
||||||
FMD::flush_fmd (rxa->fmd);
|
FMD::flush_fmd (rxa->fmd);
|
||||||
@ -622,7 +622,7 @@ void RXA::flush_rxa (RXA *rxa)
|
|||||||
ANR::flush_anr (rxa->anr);
|
ANR::flush_anr (rxa->anr);
|
||||||
EMNR::flush_emnr (rxa->emnr);
|
EMNR::flush_emnr (rxa->emnr);
|
||||||
WCPAGC::flush_wcpagc (rxa->agc);
|
WCPAGC::flush_wcpagc (rxa->agc);
|
||||||
METER::flush_meter (rxa->agcmeter);
|
rxa->agcmeter->flush();
|
||||||
BANDPASS::flush_bandpass (rxa->bp1);
|
BANDPASS::flush_bandpass (rxa->bp1);
|
||||||
SIPHON::flush_siphon (rxa->sip1);
|
SIPHON::flush_siphon (rxa->sip1);
|
||||||
CBL::flush_cbl (rxa->cbl);
|
CBL::flush_cbl (rxa->cbl);
|
||||||
@ -639,10 +639,10 @@ void RXA::xrxa (RXA *rxa)
|
|||||||
rxa->nob->execute();
|
rxa->nob->execute();
|
||||||
rxa->shift->execute();
|
rxa->shift->execute();
|
||||||
rxa->rsmpin->execute();
|
rxa->rsmpin->execute();
|
||||||
METER::xmeter (rxa->adcmeter);
|
rxa->adcmeter->execute();
|
||||||
BPSNBA::xbpsnbain (rxa->bpsnba, 0);
|
BPSNBA::xbpsnbain (rxa->bpsnba, 0);
|
||||||
NBP::xnbp (rxa->nbp0, 0);
|
NBP::xnbp (rxa->nbp0, 0);
|
||||||
METER::xmeter (rxa->smeter);
|
rxa->smeter->execute();
|
||||||
SENDER::xsender (rxa->sender);
|
SENDER::xsender (rxa->sender);
|
||||||
AMSQ::xamsqcap (rxa->amsq);
|
AMSQ::xamsqcap (rxa->amsq);
|
||||||
BPSNBA::xbpsnbaout (rxa->bpsnba, 0);
|
BPSNBA::xbpsnbaout (rxa->bpsnba, 0);
|
||||||
@ -662,7 +662,7 @@ void RXA::xrxa (RXA *rxa)
|
|||||||
ANR::xanr (rxa->anr, 1);
|
ANR::xanr (rxa->anr, 1);
|
||||||
EMNR::xemnr (rxa->emnr, 1);
|
EMNR::xemnr (rxa->emnr, 1);
|
||||||
BANDPASS::xbandpass (rxa->bp1, 1);
|
BANDPASS::xbandpass (rxa->bp1, 1);
|
||||||
METER::xmeter (rxa->agcmeter);
|
rxa->agcmeter->execute();
|
||||||
SIPHON::xsiphon (rxa->sip1, 0);
|
SIPHON::xsiphon (rxa->sip1, 0);
|
||||||
CBL::xcbl (rxa->cbl);
|
CBL::xcbl (rxa->cbl);
|
||||||
SPEAK::xspeak (rxa->speak);
|
SPEAK::xspeak (rxa->speak);
|
||||||
@ -752,10 +752,10 @@ void RXA::setDSPSamplerate (RXA *rxa, int dsp_rate)
|
|||||||
rxa->rsmpin->setSize(rxa->dsp_insize);
|
rxa->rsmpin->setSize(rxa->dsp_insize);
|
||||||
rxa->rsmpin->setOutRate(rxa->dsp_rate);
|
rxa->rsmpin->setOutRate(rxa->dsp_rate);
|
||||||
// dsp_rate blocks
|
// dsp_rate blocks
|
||||||
METER::setSamplerate_meter (rxa->adcmeter, rxa->dsp_rate);
|
rxa->adcmeter->setSamplerate(rxa->dsp_rate);
|
||||||
NBP::setSamplerate_nbp (rxa->nbp0, rxa->dsp_rate);
|
NBP::setSamplerate_nbp (rxa->nbp0, rxa->dsp_rate);
|
||||||
BPSNBA::setSamplerate_bpsnba (rxa->bpsnba, rxa->dsp_rate);
|
BPSNBA::setSamplerate_bpsnba (rxa->bpsnba, rxa->dsp_rate);
|
||||||
METER::setSamplerate_meter (rxa->smeter, rxa->dsp_rate);
|
rxa->smeter->setSamplerate(rxa->dsp_rate);
|
||||||
SENDER::setSamplerate_sender (rxa->sender, rxa->dsp_rate);
|
SENDER::setSamplerate_sender (rxa->sender, rxa->dsp_rate);
|
||||||
AMSQ::setSamplerate_amsq (rxa->amsq, rxa->dsp_rate);
|
AMSQ::setSamplerate_amsq (rxa->amsq, rxa->dsp_rate);
|
||||||
AMD::setSamplerate_amd (rxa->amd, rxa->dsp_rate);
|
AMD::setSamplerate_amd (rxa->amd, rxa->dsp_rate);
|
||||||
@ -769,7 +769,7 @@ void RXA::setDSPSamplerate (RXA *rxa, int dsp_rate)
|
|||||||
EMNR::setSamplerate_emnr (rxa->emnr, rxa->dsp_rate);
|
EMNR::setSamplerate_emnr (rxa->emnr, rxa->dsp_rate);
|
||||||
BANDPASS::setSamplerate_bandpass (rxa->bp1, rxa->dsp_rate);
|
BANDPASS::setSamplerate_bandpass (rxa->bp1, rxa->dsp_rate);
|
||||||
WCPAGC::setSamplerate_wcpagc (rxa->agc, rxa->dsp_rate);
|
WCPAGC::setSamplerate_wcpagc (rxa->agc, rxa->dsp_rate);
|
||||||
METER::setSamplerate_meter (rxa->agcmeter, rxa->dsp_rate);
|
rxa->agcmeter->setSamplerate(rxa->dsp_rate);
|
||||||
SIPHON::setSamplerate_siphon (rxa->sip1, rxa->dsp_rate);
|
SIPHON::setSamplerate_siphon (rxa->sip1, rxa->dsp_rate);
|
||||||
CBL::setSamplerate_cbl (rxa->cbl, rxa->dsp_rate);
|
CBL::setSamplerate_cbl (rxa->cbl, rxa->dsp_rate);
|
||||||
SPEAK::setSamplerate_speak (rxa->speak, rxa->dsp_rate);
|
SPEAK::setSamplerate_speak (rxa->speak, rxa->dsp_rate);
|
||||||
@ -815,14 +815,14 @@ void RXA::setDSPBuffsize (RXA *rxa, int dsp_size)
|
|||||||
rxa->rsmpin->setBuffers(rxa->inbuff, rxa->midbuff);
|
rxa->rsmpin->setBuffers(rxa->inbuff, rxa->midbuff);
|
||||||
rxa->rsmpin->setSize(rxa->dsp_insize);
|
rxa->rsmpin->setSize(rxa->dsp_insize);
|
||||||
// dsp_size blocks
|
// dsp_size blocks
|
||||||
METER::setBuffers_meter (rxa->adcmeter, rxa->midbuff);
|
rxa->adcmeter->setBuffers(rxa->midbuff);
|
||||||
METER::setSize_meter (rxa->adcmeter, rxa->dsp_size);
|
rxa->adcmeter->setSize(rxa->dsp_size);
|
||||||
NBP::setBuffers_nbp (rxa->nbp0, rxa->midbuff, rxa->midbuff);
|
NBP::setBuffers_nbp (rxa->nbp0, rxa->midbuff, rxa->midbuff);
|
||||||
NBP::setSize_nbp (rxa->nbp0, rxa->dsp_size);
|
NBP::setSize_nbp (rxa->nbp0, rxa->dsp_size);
|
||||||
BPSNBA::setBuffers_bpsnba (rxa->bpsnba, rxa->midbuff, rxa->midbuff);
|
BPSNBA::setBuffers_bpsnba (rxa->bpsnba, rxa->midbuff, rxa->midbuff);
|
||||||
BPSNBA::setSize_bpsnba (rxa->bpsnba, rxa->dsp_size);
|
BPSNBA::setSize_bpsnba (rxa->bpsnba, rxa->dsp_size);
|
||||||
METER::setBuffers_meter (rxa->smeter, rxa->midbuff);
|
rxa->smeter->setBuffers(rxa->midbuff);
|
||||||
METER::setSize_meter (rxa->smeter, rxa->dsp_size);
|
rxa->smeter->METER::setSize(rxa->dsp_size);
|
||||||
SENDER::setBuffers_sender (rxa->sender, rxa->midbuff);
|
SENDER::setBuffers_sender (rxa->sender, rxa->midbuff);
|
||||||
SENDER::setSize_sender (rxa->sender, rxa->dsp_size);
|
SENDER::setSize_sender (rxa->sender, rxa->dsp_size);
|
||||||
AMSQ::setBuffers_amsq (rxa->amsq, rxa->midbuff, rxa->midbuff, rxa->midbuff);
|
AMSQ::setBuffers_amsq (rxa->amsq, rxa->midbuff, rxa->midbuff, rxa->midbuff);
|
||||||
@ -847,8 +847,8 @@ void RXA::setDSPBuffsize (RXA *rxa, int dsp_size)
|
|||||||
BANDPASS::setSize_bandpass (rxa->bp1, rxa->dsp_size);
|
BANDPASS::setSize_bandpass (rxa->bp1, rxa->dsp_size);
|
||||||
WCPAGC::setBuffers_wcpagc (rxa->agc, rxa->midbuff, rxa->midbuff);
|
WCPAGC::setBuffers_wcpagc (rxa->agc, rxa->midbuff, rxa->midbuff);
|
||||||
WCPAGC::setSize_wcpagc (rxa->agc, rxa->dsp_size);
|
WCPAGC::setSize_wcpagc (rxa->agc, rxa->dsp_size);
|
||||||
METER::setBuffers_meter (rxa->agcmeter, rxa->midbuff);
|
rxa->agcmeter->METER::setBuffers(rxa->midbuff);
|
||||||
METER::setSize_meter (rxa->agcmeter, rxa->dsp_size);
|
rxa->agcmeter->METER::setSize(rxa->dsp_size);
|
||||||
SIPHON::setBuffers_siphon (rxa->sip1, rxa->midbuff);
|
SIPHON::setBuffers_siphon (rxa->sip1, rxa->midbuff);
|
||||||
SIPHON::setSize_siphon (rxa->sip1, rxa->dsp_size);
|
SIPHON::setSize_siphon (rxa->sip1, rxa->dsp_size);
|
||||||
CBL::setBuffers_cbl (rxa->cbl, rxa->midbuff, rxa->midbuff);
|
CBL::setBuffers_cbl (rxa->cbl, rxa->midbuff, rxa->midbuff);
|
||||||
|
106
wdsp/TXA.cpp
106
wdsp/TXA.cpp
@ -121,7 +121,7 @@ TXA* TXA::create_txa (
|
|||||||
338.0, // 1/2 of phase frequency
|
338.0, // 1/2 of phase frequency
|
||||||
8); // number of stages
|
8); // number of stages
|
||||||
|
|
||||||
txa->micmeter.p = METER::create_meter (
|
txa->micmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
0, // optional pointer to another 'run'
|
0, // optional pointer to another 'run'
|
||||||
txa->dsp_size, // size
|
txa->dsp_size, // size
|
||||||
@ -170,7 +170,7 @@ TXA* TXA::create_txa (
|
|||||||
txa->dsp_rate); // samplerate
|
txa->dsp_rate); // samplerate
|
||||||
}
|
}
|
||||||
|
|
||||||
txa->eqmeter.p = METER::create_meter (
|
txa->eqmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
&(txa->eqp.p->run), // pointer to eqp 'run'
|
&(txa->eqp.p->run), // pointer to eqp 'run'
|
||||||
txa->dsp_size, // size
|
txa->dsp_size, // size
|
||||||
@ -222,7 +222,7 @@ TXA* TXA::create_txa (
|
|||||||
2.000, // hang_thresh
|
2.000, // hang_thresh
|
||||||
0.100); // tau_hang_decay
|
0.100); // tau_hang_decay
|
||||||
|
|
||||||
txa->lvlrmeter.p = METER::create_meter (
|
txa->lvlrmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
&(txa->leveler.p->run), // pointer to leveler 'run'
|
&(txa->leveler.p->run), // pointer to leveler 'run'
|
||||||
txa->dsp_size, // size
|
txa->dsp_size, // size
|
||||||
@ -262,7 +262,7 @@ TXA* TXA::create_txa (
|
|||||||
0.50); // display time constant
|
0.50); // display time constant
|
||||||
}
|
}
|
||||||
|
|
||||||
txa->cfcmeter.p = METER::create_meter (
|
txa->cfcmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
&(txa->cfcomp.p->run), // pointer to eqp 'run'
|
&(txa->cfcomp.p->run), // pointer to eqp 'run'
|
||||||
txa->dsp_size, // size
|
txa->dsp_size, // size
|
||||||
@ -333,7 +333,7 @@ TXA* TXA::create_txa (
|
|||||||
1, // wintype
|
1, // wintype
|
||||||
1.0); // gain
|
1.0); // gain
|
||||||
|
|
||||||
txa->compmeter.p = METER::create_meter (
|
txa->compmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
&(txa->compressor.p->run), // pointer to compressor 'run'
|
&(txa->compressor.p->run), // pointer to compressor 'run'
|
||||||
txa->dsp_size, // size
|
txa->dsp_size, // size
|
||||||
@ -415,7 +415,7 @@ TXA* TXA::create_txa (
|
|||||||
0.000, // delay time
|
0.000, // delay time
|
||||||
0.005); // upslew time
|
0.005); // upslew time
|
||||||
|
|
||||||
txa->alcmeter.p = METER::create_meter (
|
txa->alcmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
0, // optional pointer to a 'run'
|
0, // optional pointer to a 'run'
|
||||||
txa->dsp_size, // size
|
txa->dsp_size, // size
|
||||||
@ -497,7 +497,7 @@ TXA* TXA::create_txa (
|
|||||||
0, // select ncoef automatically
|
0, // select ncoef automatically
|
||||||
0.980); // gain
|
0.980); // gain
|
||||||
|
|
||||||
txa->outmeter.p = METER::create_meter (
|
txa->outmeter.p = new METER(
|
||||||
1, // run
|
1, // run
|
||||||
0, // optional pointer to another 'run'
|
0, // optional pointer to another 'run'
|
||||||
txa->dsp_outsize, // size
|
txa->dsp_outsize, // size
|
||||||
@ -519,33 +519,33 @@ TXA* TXA::create_txa (
|
|||||||
void TXA::destroy_txa (TXA *txa)
|
void TXA::destroy_txa (TXA *txa)
|
||||||
{
|
{
|
||||||
// in reverse order, free each item we created
|
// in reverse order, free each item we created
|
||||||
METER::destroy_meter (txa->outmeter.p);
|
delete (txa->outmeter.p);
|
||||||
delete (txa->rsmpout.p);
|
delete (txa->rsmpout.p);
|
||||||
CFIR::destroy_cfir(txa->cfir.p);
|
CFIR::destroy_cfir(txa->cfir.p);
|
||||||
// destroy_calcc (txa->calcc.p);
|
// destroy_calcc (txa->calcc.p);
|
||||||
IQC::destroy_iqc (txa->iqc.p0);
|
IQC::destroy_iqc (txa->iqc.p0);
|
||||||
SIPHON::destroy_siphon (txa->sip1.p);
|
SIPHON::destroy_siphon (txa->sip1.p);
|
||||||
METER::destroy_meter (txa->alcmeter.p);
|
delete (txa->alcmeter.p);
|
||||||
USLEW::destroy_uslew (txa->uslew.p);
|
USLEW::destroy_uslew (txa->uslew.p);
|
||||||
delete (txa->gen1.p);
|
delete (txa->gen1.p);
|
||||||
FMMOD::destroy_fmmod (txa->fmmod.p);
|
FMMOD::destroy_fmmod (txa->fmmod.p);
|
||||||
AMMOD::destroy_ammod (txa->ammod.p);
|
AMMOD::destroy_ammod (txa->ammod.p);
|
||||||
WCPAGC::destroy_wcpagc (txa->alc.p);
|
WCPAGC::destroy_wcpagc (txa->alc.p);
|
||||||
METER::destroy_meter (txa->compmeter.p);
|
delete (txa->compmeter.p);
|
||||||
BANDPASS::destroy_bandpass (txa->bp2.p);
|
BANDPASS::destroy_bandpass (txa->bp2.p);
|
||||||
OSCTRL::destroy_osctrl (txa->osctrl.p);
|
OSCTRL::destroy_osctrl (txa->osctrl.p);
|
||||||
BANDPASS::destroy_bandpass (txa->bp1.p);
|
BANDPASS::destroy_bandpass (txa->bp1.p);
|
||||||
COMPRESSOR::destroy_compressor (txa->compressor.p);
|
COMPRESSOR::destroy_compressor (txa->compressor.p);
|
||||||
BANDPASS::destroy_bandpass (txa->bp0.p);
|
BANDPASS::destroy_bandpass (txa->bp0.p);
|
||||||
METER::destroy_meter (txa->cfcmeter.p);
|
delete (txa->cfcmeter.p);
|
||||||
CFCOMP::destroy_cfcomp (txa->cfcomp.p);
|
CFCOMP::destroy_cfcomp (txa->cfcomp.p);
|
||||||
METER::destroy_meter (txa->lvlrmeter.p);
|
delete (txa->lvlrmeter.p);
|
||||||
WCPAGC::destroy_wcpagc (txa->leveler.p);
|
WCPAGC::destroy_wcpagc (txa->leveler.p);
|
||||||
EMPHP::destroy_emphp (txa->preemph.p);
|
EMPHP::destroy_emphp (txa->preemph.p);
|
||||||
METER::destroy_meter (txa->eqmeter.p);
|
delete (txa->eqmeter.p);
|
||||||
EQP::destroy_eqp (txa->eqp.p);
|
EQP::destroy_eqp (txa->eqp.p);
|
||||||
AMSQ::destroy_amsq (txa->amsq.p);
|
AMSQ::destroy_amsq (txa->amsq.p);
|
||||||
METER::destroy_meter (txa->micmeter.p);
|
delete (txa->micmeter.p);
|
||||||
PHROT::destroy_phrot (txa->phrot.p);
|
PHROT::destroy_phrot (txa->phrot.p);
|
||||||
PANEL::destroy_panel (txa->panel.p);
|
PANEL::destroy_panel (txa->panel.p);
|
||||||
delete (txa->gen0.p);
|
delete (txa->gen0.p);
|
||||||
@ -565,32 +565,32 @@ void TXA::flush_txa (TXA* txa)
|
|||||||
txa->gen0.p->flush();
|
txa->gen0.p->flush();
|
||||||
PANEL::flush_panel (txa->panel.p);
|
PANEL::flush_panel (txa->panel.p);
|
||||||
PHROT::flush_phrot (txa->phrot.p);
|
PHROT::flush_phrot (txa->phrot.p);
|
||||||
METER::flush_meter (txa->micmeter.p);
|
txa->micmeter.p->flush ();
|
||||||
AMSQ::flush_amsq (txa->amsq.p);
|
AMSQ::flush_amsq (txa->amsq.p);
|
||||||
EQP::flush_eqp (txa->eqp.p);
|
EQP::flush_eqp (txa->eqp.p);
|
||||||
METER::flush_meter (txa->eqmeter.p);
|
txa->eqmeter.p->flush ();
|
||||||
EMPHP::flush_emphp (txa->preemph.p);
|
EMPHP::flush_emphp (txa->preemph.p);
|
||||||
WCPAGC::flush_wcpagc (txa->leveler.p);
|
WCPAGC::flush_wcpagc (txa->leveler.p);
|
||||||
METER::flush_meter (txa->lvlrmeter.p);
|
txa->lvlrmeter.p->flush ();
|
||||||
CFCOMP::flush_cfcomp (txa->cfcomp.p);
|
CFCOMP::flush_cfcomp (txa->cfcomp.p);
|
||||||
METER::flush_meter (txa->cfcmeter.p);
|
txa->cfcmeter.p->flush ();
|
||||||
BANDPASS::flush_bandpass (txa->bp0.p);
|
BANDPASS::flush_bandpass (txa->bp0.p);
|
||||||
COMPRESSOR::flush_compressor (txa->compressor.p);
|
COMPRESSOR::flush_compressor (txa->compressor.p);
|
||||||
BANDPASS::flush_bandpass (txa->bp1.p);
|
BANDPASS::flush_bandpass (txa->bp1.p);
|
||||||
OSCTRL::flush_osctrl (txa->osctrl.p);
|
OSCTRL::flush_osctrl (txa->osctrl.p);
|
||||||
BANDPASS::flush_bandpass (txa->bp2.p);
|
BANDPASS::flush_bandpass (txa->bp2.p);
|
||||||
METER::flush_meter (txa->compmeter.p);
|
txa->compmeter.p->flush ();
|
||||||
WCPAGC::flush_wcpagc (txa->alc.p);
|
WCPAGC::flush_wcpagc (txa->alc.p);
|
||||||
AMMOD::flush_ammod (txa->ammod.p);
|
AMMOD::flush_ammod (txa->ammod.p);
|
||||||
FMMOD::flush_fmmod (txa->fmmod.p);
|
FMMOD::flush_fmmod (txa->fmmod.p);
|
||||||
txa->gen1.p->flush();
|
txa->gen1.p->flush();
|
||||||
USLEW::flush_uslew (txa->uslew.p);
|
USLEW::flush_uslew (txa->uslew.p);
|
||||||
METER::flush_meter (txa->alcmeter.p);
|
txa->alcmeter.p->flush ();
|
||||||
SIPHON::flush_siphon (txa->sip1.p);
|
SIPHON::flush_siphon (txa->sip1.p);
|
||||||
IQC::flush_iqc (txa->iqc.p0);
|
IQC::flush_iqc (txa->iqc.p0);
|
||||||
CFIR::flush_cfir(txa->cfir.p);
|
CFIR::flush_cfir(txa->cfir.p);
|
||||||
txa->rsmpout.p->flush();
|
txa->rsmpout.p->flush();
|
||||||
METER::flush_meter (txa->outmeter.p);
|
txa->outmeter.p->flush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtxa (TXA* txa)
|
void xtxa (TXA* txa)
|
||||||
@ -599,34 +599,34 @@ void xtxa (TXA* txa)
|
|||||||
txa->gen0.p->execute(); // input signal generator
|
txa->gen0.p->execute(); // input signal generator
|
||||||
PANEL::xpanel (txa->panel.p); // includes MIC gain
|
PANEL::xpanel (txa->panel.p); // includes MIC gain
|
||||||
PHROT::xphrot (txa->phrot.p); // phase rotator
|
PHROT::xphrot (txa->phrot.p); // phase rotator
|
||||||
METER::xmeter (txa->micmeter.p); // MIC meter
|
txa->micmeter.p->execute (); // MIC meter
|
||||||
AMSQ::xamsqcap (txa->amsq.p); // downward expander capture
|
AMSQ::xamsqcap (txa->amsq.p); // downward expander capture
|
||||||
AMSQ::xamsq (txa->amsq.p); // downward expander action
|
AMSQ::xamsq (txa->amsq.p); // downward expander action
|
||||||
EQP::xeqp (txa->eqp.p); // pre-EQ
|
EQP::xeqp (txa->eqp.p); // pre-EQ
|
||||||
METER::xmeter (txa->eqmeter.p); // EQ meter
|
txa->eqmeter.p->execute (); // EQ meter
|
||||||
EMPHP::xemphp (txa->preemph.p, 0); // FM pre-emphasis (first option)
|
EMPHP::xemphp (txa->preemph.p, 0); // FM pre-emphasis (first option)
|
||||||
WCPAGC::xwcpagc (txa->leveler.p); // Leveler
|
WCPAGC::xwcpagc (txa->leveler.p); // Leveler
|
||||||
METER::xmeter (txa->lvlrmeter.p); // Leveler Meter
|
txa->lvlrmeter.p->execute (); // Leveler Meter
|
||||||
CFCOMP::xcfcomp (txa->cfcomp.p, 0); // Continuous Frequency Compressor with post-EQ
|
CFCOMP::xcfcomp (txa->cfcomp.p, 0); // Continuous Frequency Compressor with post-EQ
|
||||||
METER::xmeter (txa->cfcmeter.p); // CFC+PostEQ Meter
|
txa->cfcmeter.p->execute (); // CFC+PostEQ Meter
|
||||||
BANDPASS::xbandpass (txa->bp0.p, 0); // primary bandpass filter
|
BANDPASS::xbandpass (txa->bp0.p, 0); // primary bandpass filter
|
||||||
COMPRESSOR::xcompressor (txa->compressor.p); // COMP compressor
|
COMPRESSOR::xcompressor (txa->compressor.p); // COMP compressor
|
||||||
BANDPASS::xbandpass (txa->bp1.p, 0); // aux bandpass (runs if COMP)
|
BANDPASS::xbandpass (txa->bp1.p, 0); // aux bandpass (runs if COMP)
|
||||||
OSCTRL::xosctrl (txa->osctrl.p); // CESSB Overshoot Control
|
OSCTRL::xosctrl (txa->osctrl.p); // CESSB Overshoot Control
|
||||||
BANDPASS::xbandpass (txa->bp2.p, 0); // aux bandpass (runs if CESSB)
|
BANDPASS::xbandpass (txa->bp2.p, 0); // aux bandpass (runs if CESSB)
|
||||||
METER::xmeter (txa->compmeter.p); // COMP meter
|
txa->compmeter.p->execute (); // COMP meter
|
||||||
WCPAGC::xwcpagc (txa->alc.p); // ALC
|
WCPAGC::xwcpagc (txa->alc.p); // ALC
|
||||||
AMMOD::xammod (txa->ammod.p); // AM Modulator
|
AMMOD::xammod (txa->ammod.p); // AM Modulator
|
||||||
EMPHP::xemphp (txa->preemph.p, 1); // FM pre-emphasis (second option)
|
EMPHP::xemphp (txa->preemph.p, 1); // FM pre-emphasis (second option)
|
||||||
FMMOD::xfmmod (txa->fmmod.p); // FM Modulator
|
FMMOD::xfmmod (txa->fmmod.p); // FM Modulator
|
||||||
txa->gen1.p->execute(); // output signal generator (TUN and Two-tone)
|
txa->gen1.p->execute(); // output signal generator (TUN and Two-tone)
|
||||||
USLEW::xuslew (txa->uslew.p); // up-slew for AM, FM, and gens
|
USLEW::xuslew (txa->uslew.p); // up-slew for AM, FM, and gens
|
||||||
METER::xmeter (txa->alcmeter.p); // ALC Meter
|
txa->alcmeter.p->execute (); // ALC Meter
|
||||||
SIPHON::xsiphon (txa->sip1.p, 0); // siphon data for display
|
SIPHON::xsiphon (txa->sip1.p, 0); // siphon data for display
|
||||||
IQC::xiqc (txa->iqc.p0); // PureSignal correction
|
IQC::xiqc (txa->iqc.p0); // PureSignal correction
|
||||||
CFIR::xcfir(txa->cfir.p); // compensating FIR filter (used Protocol_2 only)
|
CFIR::xcfir(txa->cfir.p); // compensating FIR filter (used Protocol_2 only)
|
||||||
txa->rsmpout.p->execute(); // output resampler
|
txa->rsmpout.p->execute(); // output resampler
|
||||||
METER::xmeter (txa->outmeter.p); // output meter
|
txa->outmeter.p->execute (); // output meter
|
||||||
// print_peak_env ("env_exception.txt", txa->dsp_outsize, txa->outbuff, 0.7);
|
// print_peak_env ("env_exception.txt", txa->dsp_outsize, txa->outbuff, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,9 +666,9 @@ void TXA::setOutputSamplerate (TXA* txa, int out_rate)
|
|||||||
txa->rsmpout.p->setOutRate(txa->out_rate);
|
txa->rsmpout.p->setOutRate(txa->out_rate);
|
||||||
ResCheck (*txa);
|
ResCheck (*txa);
|
||||||
// output meter
|
// output meter
|
||||||
METER::setBuffers_meter (txa->outmeter.p, txa->outbuff);
|
txa->outmeter.p->setBuffers(txa->outbuff);
|
||||||
METER::setSize_meter (txa->outmeter.p, txa->dsp_outsize);
|
txa->outmeter.p->setSize(txa->dsp_outsize);
|
||||||
METER::setSamplerate_meter (txa->outmeter.p, txa->out_rate);
|
txa->outmeter.p->setSamplerate (txa->out_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TXA::setDSPSamplerate (TXA *txa, int dsp_rate)
|
void TXA::setDSPSamplerate (TXA *txa, int dsp_rate)
|
||||||
@ -697,27 +697,27 @@ void TXA::setDSPSamplerate (TXA *txa, int dsp_rate)
|
|||||||
txa->gen0.p->setSamplerate(txa->dsp_rate);
|
txa->gen0.p->setSamplerate(txa->dsp_rate);
|
||||||
PANEL::setSamplerate_panel (txa->panel.p, txa->dsp_rate);
|
PANEL::setSamplerate_panel (txa->panel.p, txa->dsp_rate);
|
||||||
PHROT::setSamplerate_phrot (txa->phrot.p, txa->dsp_rate);
|
PHROT::setSamplerate_phrot (txa->phrot.p, txa->dsp_rate);
|
||||||
METER::setSamplerate_meter (txa->micmeter.p, txa->dsp_rate);
|
txa->micmeter.p->setSamplerate (txa->dsp_rate);
|
||||||
AMSQ::setSamplerate_amsq (txa->amsq.p, txa->dsp_rate);
|
AMSQ::setSamplerate_amsq (txa->amsq.p, txa->dsp_rate);
|
||||||
EQP::setSamplerate_eqp (txa->eqp.p, txa->dsp_rate);
|
EQP::setSamplerate_eqp (txa->eqp.p, txa->dsp_rate);
|
||||||
METER::setSamplerate_meter (txa->eqmeter.p, txa->dsp_rate);
|
txa->eqmeter.p->setSamplerate (txa->dsp_rate);
|
||||||
EMPHP::setSamplerate_emphp (txa->preemph.p, txa->dsp_rate);
|
EMPHP::setSamplerate_emphp (txa->preemph.p, txa->dsp_rate);
|
||||||
WCPAGC::setSamplerate_wcpagc (txa->leveler.p, txa->dsp_rate);
|
WCPAGC::setSamplerate_wcpagc (txa->leveler.p, txa->dsp_rate);
|
||||||
METER::setSamplerate_meter (txa->lvlrmeter.p, txa->dsp_rate);
|
txa->lvlrmeter.p->setSamplerate (txa->dsp_rate);
|
||||||
CFCOMP::setSamplerate_cfcomp (txa->cfcomp.p, txa->dsp_rate);
|
CFCOMP::setSamplerate_cfcomp (txa->cfcomp.p, txa->dsp_rate);
|
||||||
METER::setSamplerate_meter (txa->cfcmeter.p, txa->dsp_rate);
|
txa->cfcmeter.p->setSamplerate (txa->dsp_rate);
|
||||||
BANDPASS::setSamplerate_bandpass (txa->bp0.p, txa->dsp_rate);
|
BANDPASS::setSamplerate_bandpass (txa->bp0.p, txa->dsp_rate);
|
||||||
COMPRESSOR::setSamplerate_compressor (txa->compressor.p, txa->dsp_rate);
|
COMPRESSOR::setSamplerate_compressor (txa->compressor.p, txa->dsp_rate);
|
||||||
BANDPASS::setSamplerate_bandpass (txa->bp1.p, txa->dsp_rate);
|
BANDPASS::setSamplerate_bandpass (txa->bp1.p, txa->dsp_rate);
|
||||||
OSCTRL::setSamplerate_osctrl (txa->osctrl.p, txa->dsp_rate);
|
OSCTRL::setSamplerate_osctrl (txa->osctrl.p, txa->dsp_rate);
|
||||||
BANDPASS::setSamplerate_bandpass (txa->bp2.p, txa->dsp_rate);
|
BANDPASS::setSamplerate_bandpass (txa->bp2.p, txa->dsp_rate);
|
||||||
METER::setSamplerate_meter (txa->compmeter.p, txa->dsp_rate);
|
txa->compmeter.p->setSamplerate (txa->dsp_rate);
|
||||||
WCPAGC::setSamplerate_wcpagc (txa->alc.p, txa->dsp_rate);
|
WCPAGC::setSamplerate_wcpagc (txa->alc.p, txa->dsp_rate);
|
||||||
AMMOD::setSamplerate_ammod (txa->ammod.p, txa->dsp_rate);
|
AMMOD::setSamplerate_ammod (txa->ammod.p, txa->dsp_rate);
|
||||||
FMMOD::setSamplerate_fmmod (txa->fmmod.p, txa->dsp_rate);
|
FMMOD::setSamplerate_fmmod (txa->fmmod.p, txa->dsp_rate);
|
||||||
txa->gen1.p->setSamplerate(txa->dsp_rate);
|
txa->gen1.p->setSamplerate(txa->dsp_rate);
|
||||||
USLEW::setSamplerate_uslew (txa->uslew.p, txa->dsp_rate);
|
USLEW::setSamplerate_uslew (txa->uslew.p, txa->dsp_rate);
|
||||||
METER::setSamplerate_meter (txa->alcmeter.p, txa->dsp_rate);
|
txa->alcmeter.p->setSamplerate (txa->dsp_rate);
|
||||||
SIPHON::setSamplerate_siphon (txa->sip1.p, txa->dsp_rate);
|
SIPHON::setSamplerate_siphon (txa->sip1.p, txa->dsp_rate);
|
||||||
IQC::setSamplerate_iqc (txa->iqc.p0, txa->dsp_rate);
|
IQC::setSamplerate_iqc (txa->iqc.p0, txa->dsp_rate);
|
||||||
CFIR::setSamplerate_cfir (txa->cfir.p, txa->dsp_rate);
|
CFIR::setSamplerate_cfir (txa->cfir.p, txa->dsp_rate);
|
||||||
@ -726,8 +726,8 @@ void TXA::setDSPSamplerate (TXA *txa, int dsp_rate)
|
|||||||
txa->rsmpout.p->setInRate(txa->dsp_rate);
|
txa->rsmpout.p->setInRate(txa->dsp_rate);
|
||||||
ResCheck (*txa);
|
ResCheck (*txa);
|
||||||
// output meter
|
// output meter
|
||||||
METER::setBuffers_meter (txa->outmeter.p, txa->outbuff);
|
txa->outmeter.p->setBuffers(txa->outbuff);
|
||||||
METER::setSize_meter (txa->outmeter.p, txa->dsp_outsize);
|
txa->outmeter.p->setSize (txa->dsp_outsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TXA::setDSPBuffsize (TXA *txa, int dsp_size)
|
void TXA::setDSPBuffsize (TXA *txa, int dsp_size)
|
||||||
@ -760,24 +760,24 @@ void TXA::setDSPBuffsize (TXA *txa, int dsp_size)
|
|||||||
PANEL::setSize_panel (txa->panel.p, txa->dsp_size);
|
PANEL::setSize_panel (txa->panel.p, txa->dsp_size);
|
||||||
PHROT::setBuffers_phrot (txa->phrot.p, txa->midbuff, txa->midbuff);
|
PHROT::setBuffers_phrot (txa->phrot.p, txa->midbuff, txa->midbuff);
|
||||||
PHROT::setSize_phrot (txa->phrot.p, txa->dsp_size);
|
PHROT::setSize_phrot (txa->phrot.p, txa->dsp_size);
|
||||||
METER::setBuffers_meter (txa->micmeter.p, txa->midbuff);
|
txa->micmeter.p->setBuffers (txa->midbuff);
|
||||||
METER::setSize_meter (txa->micmeter.p, txa->dsp_size);
|
txa->micmeter.p->setSize (txa->dsp_size);
|
||||||
AMSQ::setBuffers_amsq (txa->amsq.p, txa->midbuff, txa->midbuff, txa->midbuff);
|
AMSQ::setBuffers_amsq (txa->amsq.p, txa->midbuff, txa->midbuff, txa->midbuff);
|
||||||
AMSQ::setSize_amsq (txa->amsq.p, txa->dsp_size);
|
AMSQ::setSize_amsq (txa->amsq.p, txa->dsp_size);
|
||||||
EQP::setBuffers_eqp (txa->eqp.p, txa->midbuff, txa->midbuff);
|
EQP::setBuffers_eqp (txa->eqp.p, txa->midbuff, txa->midbuff);
|
||||||
EQP::setSize_eqp (txa->eqp.p, txa->dsp_size);
|
EQP::setSize_eqp (txa->eqp.p, txa->dsp_size);
|
||||||
METER::setBuffers_meter (txa->eqmeter.p, txa->midbuff);
|
txa->eqmeter.p->setBuffers (txa->midbuff);
|
||||||
METER::setSize_meter (txa->eqmeter.p, txa->dsp_size);
|
txa->eqmeter.p->setSize (txa->dsp_size);
|
||||||
EMPHP::setBuffers_emphp (txa->preemph.p, txa->midbuff, txa->midbuff);
|
EMPHP::setBuffers_emphp (txa->preemph.p, txa->midbuff, txa->midbuff);
|
||||||
EMPHP::setSize_emphp (txa->preemph.p, txa->dsp_size);
|
EMPHP::setSize_emphp (txa->preemph.p, txa->dsp_size);
|
||||||
WCPAGC::setBuffers_wcpagc (txa->leveler.p, txa->midbuff, txa->midbuff);
|
WCPAGC::setBuffers_wcpagc (txa->leveler.p, txa->midbuff, txa->midbuff);
|
||||||
WCPAGC::setSize_wcpagc (txa->leveler.p, txa->dsp_size);
|
WCPAGC::setSize_wcpagc (txa->leveler.p, txa->dsp_size);
|
||||||
METER::setBuffers_meter (txa->lvlrmeter.p, txa->midbuff);
|
txa->lvlrmeter.p->setBuffers(txa->midbuff);
|
||||||
METER::setSize_meter (txa->lvlrmeter.p, txa->dsp_size);
|
txa->lvlrmeter.p->setSize(txa->dsp_size);
|
||||||
CFCOMP::setBuffers_cfcomp (txa->cfcomp.p, txa->midbuff, txa->midbuff);
|
CFCOMP::setBuffers_cfcomp (txa->cfcomp.p, txa->midbuff, txa->midbuff);
|
||||||
CFCOMP::setSize_cfcomp (txa->cfcomp.p, txa->dsp_size);
|
CFCOMP::setSize_cfcomp (txa->cfcomp.p, txa->dsp_size);
|
||||||
METER::setBuffers_meter (txa->cfcmeter.p, txa->midbuff);
|
txa->cfcmeter.p->setBuffers(txa->midbuff);
|
||||||
METER::setSize_meter (txa->cfcmeter.p, txa->dsp_size);
|
txa->cfcmeter.p->setSize(txa->dsp_size);
|
||||||
BANDPASS::setBuffers_bandpass (txa->bp0.p, txa->midbuff, txa->midbuff);
|
BANDPASS::setBuffers_bandpass (txa->bp0.p, txa->midbuff, txa->midbuff);
|
||||||
BANDPASS::setSize_bandpass (txa->bp0.p, txa->dsp_size);
|
BANDPASS::setSize_bandpass (txa->bp0.p, txa->dsp_size);
|
||||||
COMPRESSOR::setBuffers_compressor (txa->compressor.p, txa->midbuff, txa->midbuff);
|
COMPRESSOR::setBuffers_compressor (txa->compressor.p, txa->midbuff, txa->midbuff);
|
||||||
@ -788,8 +788,8 @@ void TXA::setDSPBuffsize (TXA *txa, int dsp_size)
|
|||||||
OSCTRL::setSize_osctrl (txa->osctrl.p, txa->dsp_size);
|
OSCTRL::setSize_osctrl (txa->osctrl.p, txa->dsp_size);
|
||||||
BANDPASS::setBuffers_bandpass (txa->bp2.p, txa->midbuff, txa->midbuff);
|
BANDPASS::setBuffers_bandpass (txa->bp2.p, txa->midbuff, txa->midbuff);
|
||||||
BANDPASS::setSize_bandpass (txa->bp2.p, txa->dsp_size);
|
BANDPASS::setSize_bandpass (txa->bp2.p, txa->dsp_size);
|
||||||
METER::setBuffers_meter (txa->compmeter.p, txa->midbuff);
|
txa->compmeter.p->setBuffers(txa->midbuff);
|
||||||
METER::setSize_meter (txa->compmeter.p, txa->dsp_size);
|
txa->compmeter.p->setSize(txa->dsp_size);
|
||||||
WCPAGC::setBuffers_wcpagc (txa->alc.p, txa->midbuff, txa->midbuff);
|
WCPAGC::setBuffers_wcpagc (txa->alc.p, txa->midbuff, txa->midbuff);
|
||||||
WCPAGC::setSize_wcpagc (txa->alc.p, txa->dsp_size);
|
WCPAGC::setSize_wcpagc (txa->alc.p, txa->dsp_size);
|
||||||
AMMOD::setBuffers_ammod (txa->ammod.p, txa->midbuff, txa->midbuff);
|
AMMOD::setBuffers_ammod (txa->ammod.p, txa->midbuff, txa->midbuff);
|
||||||
@ -800,8 +800,8 @@ void TXA::setDSPBuffsize (TXA *txa, int dsp_size)
|
|||||||
txa->gen1.p->setSize(txa->dsp_size);
|
txa->gen1.p->setSize(txa->dsp_size);
|
||||||
USLEW::setBuffers_uslew (txa->uslew.p, txa->midbuff, txa->midbuff);
|
USLEW::setBuffers_uslew (txa->uslew.p, txa->midbuff, txa->midbuff);
|
||||||
USLEW::setSize_uslew (txa->uslew.p, txa->dsp_size);
|
USLEW::setSize_uslew (txa->uslew.p, txa->dsp_size);
|
||||||
METER::setBuffers_meter (txa->alcmeter.p, txa->midbuff);
|
txa->alcmeter.p->setBuffers (txa->midbuff);
|
||||||
METER::setSize_meter (txa->alcmeter.p, txa->dsp_size);
|
txa->alcmeter.p->setSize(txa->dsp_size);
|
||||||
SIPHON::setBuffers_siphon (txa->sip1.p, txa->midbuff);
|
SIPHON::setBuffers_siphon (txa->sip1.p, txa->midbuff);
|
||||||
SIPHON::setSize_siphon (txa->sip1.p, txa->dsp_size);
|
SIPHON::setSize_siphon (txa->sip1.p, txa->dsp_size);
|
||||||
IQC::setBuffers_iqc (txa->iqc.p0, txa->midbuff, txa->midbuff);
|
IQC::setBuffers_iqc (txa->iqc.p0, txa->midbuff, txa->midbuff);
|
||||||
@ -812,8 +812,8 @@ void TXA::setDSPBuffsize (TXA *txa, int dsp_size)
|
|||||||
txa->rsmpout.p->setBuffers(txa->midbuff, txa->outbuff);
|
txa->rsmpout.p->setBuffers(txa->midbuff, txa->outbuff);
|
||||||
txa->rsmpout.p->setSize(txa->dsp_size);
|
txa->rsmpout.p->setSize(txa->dsp_size);
|
||||||
// output meter
|
// output meter
|
||||||
METER::setBuffers_meter (txa->outmeter.p, txa->outbuff);
|
txa->outmeter.p->setBuffers(txa->outbuff);
|
||||||
METER::setSize_meter (txa->outmeter.p, txa->dsp_outsize);
|
txa->outmeter.p->setSize(txa->dsp_outsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************************************************
|
/********************************************************************************************************
|
||||||
|
162
wdsp/meter.cpp
162
wdsp/meter.cpp
@ -28,152 +28,130 @@ warren@wpratt.com
|
|||||||
#include "comm.hpp"
|
#include "comm.hpp"
|
||||||
#include "meterlog10.hpp"
|
#include "meterlog10.hpp"
|
||||||
#include "meter.hpp"
|
#include "meter.hpp"
|
||||||
#include "RXA.hpp"
|
|
||||||
#include "TXA.hpp"
|
|
||||||
|
|
||||||
namespace WDSP {
|
namespace WDSP {
|
||||||
|
|
||||||
void METER::calc_meter (METER *a)
|
void METER::calc()
|
||||||
{
|
{
|
||||||
a->mult_average = exp(-1.0 / (a->rate * a->tau_average));
|
mult_average = exp(-1.0 / (rate * tau_average));
|
||||||
a->mult_peak = exp(-1.0 / (a->rate * a->tau_peak_decay));
|
mult_peak = exp(-1.0 / (rate * tau_peak_decay));
|
||||||
flush_meter(a);
|
flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
METER* METER::create_meter (
|
METER::METER(
|
||||||
int run,
|
int _run,
|
||||||
int* prun,
|
int* _prun,
|
||||||
int size,
|
int _size,
|
||||||
float* buff,
|
float* _buff,
|
||||||
int rate,
|
int _rate,
|
||||||
double tau_av,
|
double _tau_av,
|
||||||
double tau_decay,
|
double _tau_decay,
|
||||||
double* result,
|
double* _result,
|
||||||
int enum_av,
|
int _enum_av,
|
||||||
int enum_pk,
|
int _enum_pk,
|
||||||
int enum_gain,
|
int _enum_gain,
|
||||||
double* pgain
|
double* _pgain
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
METER *a = new METER;
|
run = _run;
|
||||||
a->run = run;
|
prun = _prun;
|
||||||
a->prun = prun;
|
size = _size;
|
||||||
a->size = size;
|
buff = _buff;
|
||||||
a->buff = buff;
|
rate = (double) _rate;
|
||||||
a->rate = (double) rate;
|
tau_average = _tau_av;
|
||||||
a->tau_average = tau_av;
|
tau_peak_decay = _tau_decay;
|
||||||
a->tau_peak_decay = tau_decay;
|
result = _result;
|
||||||
a->result = result;
|
enum_av = _enum_av;
|
||||||
a->enum_av = enum_av;
|
enum_pk = _enum_pk;
|
||||||
a->enum_pk = enum_pk;
|
enum_gain = _enum_gain;
|
||||||
a->enum_gain = enum_gain;
|
pgain = _pgain;
|
||||||
a->pgain = pgain;
|
calc();
|
||||||
calc_meter(a);
|
|
||||||
return a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void METER::destroy_meter (METER *a)
|
void METER::flush()
|
||||||
{
|
{
|
||||||
delete a;
|
avg = 0.0;
|
||||||
|
peak = 0.0;
|
||||||
|
result[enum_av] = -100.0;
|
||||||
|
result[enum_pk] = -100.0;
|
||||||
|
|
||||||
|
if ((pgain != 0) && (enum_gain >= 0))
|
||||||
|
result[enum_gain] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void METER::flush_meter (METER *a)
|
void METER::execute()
|
||||||
{
|
|
||||||
a->avg = 0.0;
|
|
||||||
a->peak = 0.0;
|
|
||||||
a->result[a->enum_av] = -100.0;
|
|
||||||
a->result[a->enum_pk] = -100.0;
|
|
||||||
|
|
||||||
if ((a->pgain != 0) && (a->enum_gain >= 0))
|
|
||||||
a->result[a->enum_gain] = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void METER::xmeter (METER *a)
|
|
||||||
{
|
{
|
||||||
int srun;
|
int srun;
|
||||||
|
|
||||||
if (a->prun != 0)
|
if (prun != 0)
|
||||||
srun = *(a->prun);
|
srun = *(prun);
|
||||||
else
|
else
|
||||||
srun = 1;
|
srun = 1;
|
||||||
|
|
||||||
if (a->run && srun)
|
if (run && srun)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
double smag;
|
double smag;
|
||||||
double np = 0.0;
|
double np = 0.0;
|
||||||
|
|
||||||
for (i = 0; i < a->size; i++)
|
for (i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
double xr = a->buff[2 * i + 0];
|
double xr = buff[2 * i + 0];
|
||||||
double xi = a->buff[2 * i + 1];
|
double xi = buff[2 * i + 1];
|
||||||
smag = xr*xr + xi*xi;
|
smag = xr*xr + xi*xi;
|
||||||
a->avg = a->avg * a->mult_average + (1.0 - a->mult_average) * smag;
|
avg = avg * mult_average + (1.0 - mult_average) * smag;
|
||||||
a->peak *= a->mult_peak;
|
peak *= mult_peak;
|
||||||
|
|
||||||
if (smag > np)
|
if (smag > np)
|
||||||
np = smag;
|
np = smag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (np > a->peak)
|
if (np > peak)
|
||||||
a->peak = np;
|
peak = np;
|
||||||
|
|
||||||
a->result[a->enum_av] = 10.0 * MemLog::mlog10 (a->avg + 1.0e-40);
|
result[enum_av] = 10.0 * MemLog::mlog10 (avg + 1.0e-40);
|
||||||
a->result[a->enum_pk] = 10.0 * MemLog::mlog10 (a->peak + 1.0e-40);
|
result[enum_pk] = 10.0 * MemLog::mlog10 (peak + 1.0e-40);
|
||||||
|
|
||||||
if ((a->pgain != 0) && (a->enum_gain >= 0))
|
if ((pgain != 0) && (enum_gain >= 0))
|
||||||
a->result[a->enum_gain] = 20.0 * MemLog::mlog10 (*a->pgain + 1.0e-40);
|
result[enum_gain] = 20.0 * MemLog::mlog10 (*pgain + 1.0e-40);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (a->enum_av >= 0)
|
if (enum_av >= 0)
|
||||||
a->result[a->enum_av] = -100.0;
|
result[enum_av] = -100.0;
|
||||||
if (a->enum_pk >= 0)
|
if (enum_pk >= 0)
|
||||||
a->result[a->enum_pk] = -100.0;
|
result[enum_pk] = -100.0;
|
||||||
if (a->enum_gain >= 0)
|
if (enum_gain >= 0)
|
||||||
a->result[a->enum_gain] = 0.0;
|
result[enum_gain] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void METER::setBuffers_meter (METER *a, float* in)
|
void METER::setBuffers(float* in)
|
||||||
{
|
{
|
||||||
a->buff = in;
|
buff = in;
|
||||||
}
|
}
|
||||||
|
|
||||||
void METER::setSamplerate_meter (METER *a, int rate)
|
void METER::setSamplerate(int _rate)
|
||||||
{
|
{
|
||||||
a->rate = (double) rate;
|
rate = (double) _rate;
|
||||||
calc_meter(a);
|
calc();
|
||||||
}
|
}
|
||||||
|
|
||||||
void METER::setSize_meter (METER *a, int size)
|
void METER::setSize(int _size)
|
||||||
{
|
{
|
||||||
a->size = size;
|
size = _size;
|
||||||
flush_meter (a);
|
flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************************************************
|
/********************************************************************************************************
|
||||||
* *
|
* *
|
||||||
* RXA Properties *
|
* Public Properties *
|
||||||
* *
|
* *
|
||||||
********************************************************************************************************/
|
********************************************************************************************************/
|
||||||
|
|
||||||
double METER::GetMeter (RXA& rxa, int mt)
|
double METER::getMeter(int mt)
|
||||||
{
|
{
|
||||||
double val = rxa.meter[mt];
|
return result[mt];
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************************************************
|
|
||||||
* *
|
|
||||||
* TXA Properties *
|
|
||||||
* *
|
|
||||||
********************************************************************************************************/
|
|
||||||
|
|
||||||
double METER::GetMeter (TXA& txa, int mt)
|
|
||||||
{
|
|
||||||
double val = txa.meter[mt];
|
|
||||||
return val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace WDSP
|
} // namespace WDSP
|
||||||
|
@ -32,9 +32,6 @@ warren@wpratt.com
|
|||||||
|
|
||||||
namespace WDSP {
|
namespace WDSP {
|
||||||
|
|
||||||
class RXA;
|
|
||||||
class TXA;
|
|
||||||
|
|
||||||
class WDSP_API METER
|
class WDSP_API METER
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -55,7 +52,7 @@ public:
|
|||||||
double avg;
|
double avg;
|
||||||
double peak;
|
double peak;
|
||||||
|
|
||||||
static METER* create_meter (
|
METER(
|
||||||
int run,
|
int run,
|
||||||
int* prun,
|
int* prun,
|
||||||
int size,
|
int size,
|
||||||
@ -69,19 +66,17 @@ public:
|
|||||||
int enum_gain,
|
int enum_gain,
|
||||||
double* pgain
|
double* pgain
|
||||||
);
|
);
|
||||||
static void destroy_meter (METER *a);
|
~METER() = default;
|
||||||
static void flush_meter (METER *a);
|
|
||||||
static void xmeter (METER *a);
|
void flush();
|
||||||
static void setBuffers_meter (METER *a, float* in);
|
void execute();
|
||||||
static void setSamplerate_meter (METER *a, int rate);
|
void setBuffers(float* in);
|
||||||
static void setSize_meter (METER *a, int size);
|
void setSamplerate(int rate);
|
||||||
// RXA Properties
|
void setSize(int size);
|
||||||
static double GetMeter (RXA& rxa, int mt);
|
double getMeter(int mt);
|
||||||
// TXA Properties
|
|
||||||
static double GetMeter (TXA& txa, int mt);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void calc_meter (METER *a);
|
void calc();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user