1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-10 18:43:28 -05:00

WDSP: some Sonar fixes

This commit is contained in:
f4exb 2024-07-23 23:12:10 +02:00
parent 808fe2c075
commit 71a5d7a1b4
4 changed files with 30 additions and 34 deletions

View File

@ -187,6 +187,8 @@ void ANB::execute()
state = 0; state = 0;
} }
break;
default:
break; break;
} }
@ -206,10 +208,10 @@ void ANB::execute()
} }
} }
void ANB::setBuffers(float* in, float* out) void ANB::setBuffers(float* _in, float* _out)
{ {
in = in; in = _in;
out = out; out = _out;
} }
void ANB::setSize(int size) void ANB::setSize(int size)
@ -258,9 +260,9 @@ void ANB::setAdvtime (double time)
initBlanker(); initBlanker();
} }
void ANB::setBacktau (double tau) void ANB::setBacktau (double _tau)
{ {
backtau = tau; backtau = _tau;
initBlanker(); initBlanker();
} }

View File

@ -245,7 +245,6 @@ void EMNR::interpM (double* res, double x, int nvals, double* xvals, double* yva
void EMNR::calc_emnr(EMNR *a) void EMNR::calc_emnr(EMNR *a)
{ {
int i;
double Dvals[18] = { 1.0, 2.0, 5.0, 8.0, 10.0, 15.0, 20.0, 30.0, 40.0, double Dvals[18] = { 1.0, 2.0, 5.0, 8.0, 10.0, 15.0, 20.0, 30.0, 40.0,
60.0, 80.0, 120.0, 140.0, 160.0, 180.0, 220.0, 260.0, 300.0 }; 60.0, 80.0, 120.0, 140.0, 160.0, 180.0, 220.0, 260.0, 300.0 };
double Mvals[18] = { 0.000, 0.260, 0.480, 0.580, 0.610, 0.668, 0.705, 0.762, 0.800, double Mvals[18] = { 0.000, 0.260, 0.480, 0.580, 0.610, 0.668, 0.705, 0.762, 0.800,
@ -291,7 +290,7 @@ void EMNR::calc_emnr(EMNR *a)
a->revfftout = new float[a->fsize]; // (float *)malloc0(a->fsize * sizeof(float)); a->revfftout = new float[a->fsize]; // (float *)malloc0(a->fsize * sizeof(float));
a->save = new float*[a->ovrlp]; // (float **)malloc0(a->ovrlp * sizeof(float *)); a->save = new float*[a->ovrlp]; // (float **)malloc0(a->ovrlp * sizeof(float *));
for (i = 0; i < a->ovrlp; i++) for (int i = 0; i < a->ovrlp; i++)
a->save[i] = new float[a->fsize]; // (float *)malloc0(a->fsize * sizeof(float)); a->save[i] = new float[a->fsize]; // (float *)malloc0(a->fsize * sizeof(float));
a->outaccum = new float[a->oasize]; // (float *)malloc0(a->oasize * sizeof(float)); a->outaccum = new float[a->oasize]; // (float *)malloc0(a->oasize * sizeof(float));
@ -329,11 +328,8 @@ void EMNR::calc_emnr(EMNR *a)
a->g.gamma_max = 1000.0; a->g.gamma_max = 1000.0;
a->g.q = 0.2; a->g.q = 0.2;
for (i = 0; i < a->g.msize; i++) std::fill(a->g.prev_mask, a->g.prev_mask + a->msize, 1.0);
{ std::fill(a->g.prev_gamma, a->g.prev_gamma + a->msize, 1.0);
a->g.prev_mask[i] = 1.0;
a->g.prev_gamma[i] = 1.0;
}
a->g.gmax = 10000.0; a->g.gmax = 10000.0;
// //
@ -433,7 +429,7 @@ void EMNR::calc_emnr(EMNR *a)
a->np.pmin_u = new double[a->np.msize]; // (float *)malloc0(a->np.msize * sizeof(float)); a->np.pmin_u = new double[a->np.msize]; // (float *)malloc0(a->np.msize * sizeof(float));
a->np.actminbuff = new double*[a->np.U]; // (float**)malloc0(a->np.U * sizeof(float*)); a->np.actminbuff = new double*[a->np.U]; // (float**)malloc0(a->np.U * sizeof(float*));
for (i = 0; i < a->np.U; i++) for (int i = 0; i < a->np.U; i++)
a->np.actminbuff[i] = new double[a->np.msize]; // (float *)malloc0(a->np.msize * sizeof(float)); a->np.actminbuff[i] = new double[a->np.msize]; // (float *)malloc0(a->np.msize * sizeof(float));
{ {
@ -486,7 +482,7 @@ void EMNR::calc_emnr(EMNR *a)
a->nps.Pbar = new double[a->nps.msize]; // (float *)malloc0(a->nps.msize * sizeof(float)); a->nps.Pbar = new double[a->nps.msize]; // (float *)malloc0(a->nps.msize * sizeof(float));
a->nps.EN2y = new double[a->nps.msize]; // (float *)malloc0(a->nps.msize * sizeof(float)); a->nps.EN2y = new double[a->nps.msize]; // (float *)malloc0(a->nps.msize * sizeof(float));
for (i = 0; i < a->nps.msize; i++) for (int i = 0; i < a->nps.msize; i++)
{ {
a->nps.sigma2N[i] = 0.5; a->nps.sigma2N[i] = 0.5;
a->nps.Pbar[i] = 0.5; a->nps.Pbar[i] = 0.5;
@ -881,7 +877,7 @@ void EMNR::calc_gain (EMNR *a)
{ {
int k; int k;
for (k = 0; k < a->g.msize; k++) for (k = 0; k < a->msize; k++)
{ {
double y0 = a->g.y[2 * k + 0]; double y0 = a->g.y[2 * k + 0];
double y1 = a->g.y[2 * k + 1]; double y1 = a->g.y[2 * k + 1];
@ -937,7 +933,7 @@ void EMNR::calc_gain (EMNR *a)
{ {
double gamma, eps_hat, v, ehr; double gamma, eps_hat, v, ehr;
for (k = 0; k < a->g.msize; k++) for (k = 0; k < a->msize; k++)
{ {
gamma = std::min (a->g.lambda_y[k] / a->g.lambda_d[k], a->g.gamma_max); gamma = std::min (a->g.lambda_y[k] / a->g.lambda_d[k], a->g.gamma_max);
eps_hat = a->g.alpha * a->g.prev_mask[k] * a->g.prev_mask[k] * a->g.prev_gamma[k] eps_hat = a->g.alpha * a->g.prev_mask[k] * a->g.prev_mask[k] * a->g.prev_gamma[k]

View File

@ -127,20 +127,17 @@ NOB::NOB (
fcoefs[9] = 0.012457989; fcoefs[9] = 0.012457989;
init_nob(); init_nob();
legacy = new double[2048 * 2]; /////////////// legacy interface - remove
} }
NOB::~NOB() NOB::~NOB()
{ {
delete[] (legacy); /////////////// remove delete[] fcoefs;
delete[] (fcoefs); delete[] ffbuff;
delete[] (ffbuff); delete[] bfbuff;
delete[] (bfbuff); delete[] hwave;
delete[] (hwave); delete[] awave;
delete[] (awave); delete[] imp;
delete[] (imp); delete[] dline;
delete[] (dline);
} }
void NOB::flush() void NOB::flush()
@ -568,6 +565,8 @@ void NOB::execute()
break; break;
} }
default:
break;
} }
if (++in_idx == dline_size) if (++in_idx == dline_size)
@ -586,10 +585,10 @@ void NOB::execute()
} }
} }
void NOB::setBuffers(float* in, float* out) void NOB::setBuffers(float* _in, float* _out)
{ {
in = in; in = _in;
out = out; out = _out;
} }
void NOB::setSize(int size) void NOB::setSize(int size)
@ -632,15 +631,15 @@ void NOB::setTau(double tau)
init_nob(); init_nob();
} }
void NOB::setHangtime(double time) void NOB::setHangtime(double _time)
{ {
hangtime = time; hangtime = _time;
init_nob(); init_nob();
} }
void NOB::setAdvtime(double time) void NOB::setAdvtime(double _time)
{ {
advtime = time; advtime = _time;
init_nob(); init_nob();
} }

View File

@ -82,7 +82,6 @@ public:
double deltaI, deltaQ; double deltaI, deltaQ;
double Inext, Qnext; double Inext, Qnext;
int overflow; int overflow;
double *legacy;
NOB( NOB(
int run, int run,