diff --git a/wdsp/RXA.cpp b/wdsp/RXA.cpp index 405be0a73..a0db6e1ea 100644 --- a/wdsp/RXA.cpp +++ b/wdsp/RXA.cpp @@ -86,7 +86,7 @@ RXA* RXA::create_rxa ( rxa->inbuff = new float[1 * rxa->dsp_insize * 2]; // (float *) malloc0 (1 * ch.dsp_insize * sizeof (complex)); rxa->outbuff = new float[1 * rxa->dsp_outsize * 2]; // (float *) malloc0 (1 * ch.dsp_outsize * sizeof (complex)); rxa->midbuff = new float[2 * rxa->dsp_size * 2]; // (float *) malloc0 (2 * ch.dsp_size * sizeof (complex)); - memset(rxa->meter, 0, sizeof(float)*RXA_METERTYPE_LAST); + std::fill(rxa->meter, rxa->meter + RXA_METERTYPE_LAST, 0); // Noise blanker (ANB or "NB") rxa->anb.p = ANB::create_anb( @@ -161,7 +161,7 @@ RXA* RXA::create_rxa ( rxa->pmtupdate, // locks for meter access RXA_ADC_AV, // index for average value RXA_ADC_PK, // index for peak value - -1, // index for gain value + -1, // index for gain value - disabled 0); // pointer for gain computation // Notched bandpass section @@ -235,7 +235,7 @@ RXA* RXA::create_rxa ( rxa->pmtupdate, // locks for meter access RXA_S_AV, // index for average value RXA_S_PK, // index for peak value - -1, // index for gain value + -1, // index for gain value - disabled 0); // pointer for gain computation // AM squelch capture (for other modes than FM) diff --git a/wdsp/RXA.hpp b/wdsp/RXA.hpp index e1279041e..90cb88193 100644 --- a/wdsp/RXA.hpp +++ b/wdsp/RXA.hpp @@ -98,7 +98,7 @@ public: }; int mode; - float meter[RXA_METERTYPE_LAST]; + double meter[RXA_METERTYPE_LAST]; QRecursiveMutex *pmtupdate[RXA_METERTYPE_LAST]; struct { diff --git a/wdsp/TXA.hpp b/wdsp/TXA.hpp index bb1464473..cc8c08c7b 100644 --- a/wdsp/TXA.hpp +++ b/wdsp/TXA.hpp @@ -127,7 +127,7 @@ public: int mode; float f_low; float f_high; - float meter[TXA_METERTYPE_LAST]; + double meter[TXA_METERTYPE_LAST]; QRecursiveMutex *pmtupdate[TXA_METERTYPE_LAST]; std::atomic upslew; struct diff --git a/wdsp/meter.cpp b/wdsp/meter.cpp index 0107b786e..92b47b8d0 100644 --- a/wdsp/meter.cpp +++ b/wdsp/meter.cpp @@ -48,7 +48,7 @@ METER* METER::create_meter ( int rate, double tau_av, double tau_decay, - float* result, + double* result, QRecursiveMutex** pmtupdate, int enum_av, int enum_pk, @@ -119,9 +119,9 @@ void METER::xmeter (METER *a) } else { - if (a->enum_av >= 0) a->result[a->enum_av] = - 400.0; - if (a->enum_pk >= 0) a->result[a->enum_pk] = - 400.0; - if (a->enum_gain >= 0) a->result[a->enum_gain] = + 0.0; + if (a->enum_av >= 0) a->result[a->enum_av] = -400.0; + if (a->enum_pk >= 0) a->result[a->enum_pk] = -400.0; + if (a->enum_gain >= 0) a->result[a->enum_gain] = 0.0; } a->mtupdate.unlock(); } @@ -149,9 +149,9 @@ void METER::setSize_meter (METER *a, int size) * * ********************************************************************************************************/ -float METER::GetMeter (RXA& rxa, int mt) +double METER::GetMeter (RXA& rxa, int mt) { - float val; + double val; rxa.pmtupdate[mt]->lock(); val = rxa.meter[mt]; rxa.pmtupdate[mt]->unlock(); @@ -164,9 +164,9 @@ float METER::GetMeter (RXA& rxa, int mt) * * ********************************************************************************************************/ -float METER::GetMeter (TXA& txa, int mt) +double METER::GetMeter (TXA& txa, int mt) { - float val; + double val; txa.pmtupdate[mt]->lock(); val = txa.meter[mt]; txa.pmtupdate[mt]->unlock(); diff --git a/wdsp/meter.hpp b/wdsp/meter.hpp index 2802684c3..449d304ab 100644 --- a/wdsp/meter.hpp +++ b/wdsp/meter.hpp @@ -49,7 +49,7 @@ public: double tau_peak_decay; double mult_average; double mult_peak; - float* result; + double* result; int enum_av; int enum_pk; int enum_gain; @@ -66,7 +66,7 @@ public: int rate, double tau_av, double tau_decay, - float* result, + double* result, QRecursiveMutex** pmtupdate, int enum_av, int enum_pk, @@ -80,9 +80,9 @@ public: static void setSamplerate_meter (METER *a, int rate); static void setSize_meter (METER *a, int size); // RXA Properties - static float GetMeter (RXA& rxa, int mt); + static double GetMeter (RXA& rxa, int mt); // TXA Properties - static float GetMeter (TXA& txa, int mt); + static double GetMeter (TXA& txa, int mt); private: static void calc_meter (METER *a);