WDSP: use double precision for meter results

pull/2212/head
f4exb 2024-07-13 03:53:57 +02:00
rodzic fb08489f5a
commit c99f2e1914
5 zmienionych plików z 17 dodań i 17 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

@ -98,7 +98,7 @@ public:
};
int mode;
float meter[RXA_METERTYPE_LAST];
double meter[RXA_METERTYPE_LAST];
QRecursiveMutex *pmtupdate[RXA_METERTYPE_LAST];
struct
{

Wyświetl plik

@ -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<long> upslew;
struct

Wyświetl plik

@ -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();

Wyświetl plik

@ -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);