From 8d9dc3b5ed7c2a7dd403a8d7f991a8387e30a069 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 24 Jun 2024 22:23:10 +0200 Subject: [PATCH] WDSP corrections --- wdsp/RXA.cpp | 6 +++--- wdsp/TXA.cpp | 6 +++--- wdsp/amd.cpp | 2 +- wdsp/ammod.cpp | 2 +- wdsp/amsq.cpp | 8 ++++---- wdsp/anf.cpp | 2 +- wdsp/anr.cpp | 2 +- wdsp/bandpass.cpp | 2 +- wdsp/bps.cpp | 12 ++++++------ wdsp/calculus.cpp | 4 ++-- wdsp/cblock.cpp | 2 +- wdsp/cfcomp.cpp | 2 +- wdsp/cfir.cpp | 2 +- wdsp/comm.hpp | 9 ++++++++- wdsp/compress.cpp | 2 +- wdsp/delay.cpp | 4 ++-- wdsp/emnr.cpp | 2 +- wdsp/emph.cpp | 10 +++++----- wdsp/eq.cpp | 10 +++++----- wdsp/fir.cpp | 18 +++++++++--------- wdsp/firmin.cpp | 38 +++++++++++++++++++------------------- wdsp/fmd.cpp | 4 ++-- wdsp/fmmod.cpp | 2 +- wdsp/fmsq.cpp | 2 +- wdsp/gain.cpp | 2 +- wdsp/gen.cpp | 4 ++-- wdsp/icfir.cpp | 2 +- wdsp/iir.cpp | 26 +++++++++++++------------- wdsp/iqc.cpp | 2 +- wdsp/nbp.cpp | 2 +- wdsp/osctrl.cpp | 4 ++-- wdsp/resample.cpp | 4 ++-- wdsp/rmatch.cpp | 16 ++++++++-------- wdsp/shift.cpp | 2 +- wdsp/siphon.cpp | 18 +++++++++--------- wdsp/slew.cpp | 2 +- wdsp/snb.cpp | 10 +++++----- wdsp/ssql.cpp | 4 ++-- wdsp/varsamp.cpp | 6 +++--- wdsp/wcpAGC.cpp | 2 +- 40 files changed, 133 insertions(+), 126 deletions(-) diff --git a/wdsp/RXA.cpp b/wdsp/RXA.cpp index 2a8478e6d..8d324ffd2 100644 --- a/wdsp/RXA.cpp +++ b/wdsp/RXA.cpp @@ -578,9 +578,9 @@ void RXA::destroy_rxa (RXA *rxa) void RXA::flush_rxa (RXA *rxa) { - memset (rxa->inbuff, 0, 1 * rxa->dsp_insize * sizeof (dcomplex)); - memset (rxa->outbuff, 0, 1 * rxa->dsp_outsize * sizeof (dcomplex)); - memset (rxa->midbuff, 0, 2 * rxa->dsp_size * sizeof (dcomplex)); + memset (rxa->inbuff, 0, 1 * rxa->dsp_insize * sizeof (wcomplex)); + memset (rxa->outbuff, 0, 1 * rxa->dsp_outsize * sizeof (wcomplex)); + memset (rxa->midbuff, 0, 2 * rxa->dsp_size * sizeof (wcomplex)); SHIFT::flush_shift (rxa->shift.p); RESAMPLE::flush_resample (rxa->rsmpin.p); GEN::flush_gen (rxa->gen0.p); diff --git a/wdsp/TXA.cpp b/wdsp/TXA.cpp index 6a414db4b..f330013d1 100644 --- a/wdsp/TXA.cpp +++ b/wdsp/TXA.cpp @@ -565,9 +565,9 @@ void TXA::destroy_txa (TXA *txa) void TXA::flush_txa (TXA* txa) { - memset (txa->inbuff, 0, 1 * txa->dsp_insize * sizeof (dcomplex)); - memset (txa->outbuff, 0, 1 * txa->dsp_outsize * sizeof (dcomplex)); - memset (txa->midbuff, 0, 2 * txa->dsp_size * sizeof (dcomplex)); + memset (txa->inbuff, 0, 1 * txa->dsp_insize * sizeof (wcomplex)); + memset (txa->outbuff, 0, 1 * txa->dsp_outsize * sizeof (wcomplex)); + memset (txa->midbuff, 0, 2 * txa->dsp_size * sizeof (wcomplex)); RESAMPLE::flush_resample (txa->rsmpin.p); GEN::flush_gen (txa->gen0.p); PANEL::flush_panel (txa->panel.p); diff --git a/wdsp/amd.cpp b/wdsp/amd.cpp index 1f6449643..f8d79f5bc 100644 --- a/wdsp/amd.cpp +++ b/wdsp/amd.cpp @@ -247,7 +247,7 @@ void AMD::xamd (AMD *a) } else if (a->in_buff != a->out_buff) { - memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof(dcomplex)); + memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof(wcomplex)); } } diff --git a/wdsp/ammod.cpp b/wdsp/ammod.cpp index baa989f95..7e4916870 100644 --- a/wdsp/ammod.cpp +++ b/wdsp/ammod.cpp @@ -83,7 +83,7 @@ void AMMOD::xammod(AMMOD *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void AMMOD::setBuffers_ammod(AMMOD *a, double* in, double* out) diff --git a/wdsp/amsq.cpp b/wdsp/amsq.cpp index 1814a18c5..b2e67fb01 100644 --- a/wdsp/amsq.cpp +++ b/wdsp/amsq.cpp @@ -57,7 +57,7 @@ void AMSQ::compute_slews(AMSQ *a) void AMSQ::calc_amsq(AMSQ *a) { // signal averaging - a->trigsig = new double[a->size * 2]; // (double *)malloc0(a->size * sizeof(dcomplex)); + a->trigsig = new double[a->size * 2]; // (double *)malloc0(a->size * sizeof(wcomplex)); a->avm = exp(-1.0 / (a->rate * a->avtau)); a->onem_avm = 1.0 - a->avm; a->avsig = 0.0; @@ -108,7 +108,7 @@ void AMSQ::destroy_amsq (AMSQ *a) void AMSQ::flush_amsq (AMSQ*a) { - memset (a->trigsig, 0, a->size * sizeof (dcomplex)); + memset (a->trigsig, 0, a->size * sizeof (wcomplex)); a->avsig = 0.0; a->state = 0; } @@ -180,12 +180,12 @@ void AMSQ::xamsq (AMSQ *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void AMSQ::xamsqcap (AMSQ *a) { - memcpy (a->trigsig, a->trigger, a->size * sizeof (dcomplex)); + memcpy (a->trigsig, a->trigger, a->size * sizeof (wcomplex)); } void AMSQ::setBuffers_amsq (AMSQ *a, double* in, double* out, double* trigger) diff --git a/wdsp/anf.cpp b/wdsp/anf.cpp index ff04770a7..f7689cb63 100644 --- a/wdsp/anf.cpp +++ b/wdsp/anf.cpp @@ -139,7 +139,7 @@ void ANF::xanf(ANF *a, int position) } } else if (a->in_buff != a->out_buff) - memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof (dcomplex)); + memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof (wcomplex)); } void ANF::flush_anf (ANF *a) diff --git a/wdsp/anr.cpp b/wdsp/anr.cpp index cff999064..fe15196a6 100644 --- a/wdsp/anr.cpp +++ b/wdsp/anr.cpp @@ -142,7 +142,7 @@ void ANR::xanr (ANR *a, int position) } } else if (a->in_buff != a->out_buff) - memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof (dcomplex)); + memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof (wcomplex)); } void ANR::flush_anr (ANR *a) diff --git a/wdsp/bandpass.cpp b/wdsp/bandpass.cpp index 8c3a78640..ff902069f 100644 --- a/wdsp/bandpass.cpp +++ b/wdsp/bandpass.cpp @@ -80,7 +80,7 @@ void BANDPASS::xbandpass (BANDPASS *a, int pos) if (a->run && a->position == pos) FIRCORE::xfircore (a->p); else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void BANDPASS::setBuffers_bandpass (BANDPASS *a, double* in, double* out) diff --git a/wdsp/bps.cpp b/wdsp/bps.cpp index 80285506c..d8a6e1bb9 100644 --- a/wdsp/bps.cpp +++ b/wdsp/bps.cpp @@ -45,8 +45,8 @@ namespace WDSP { void BPS::calc_bps (BPS *a) { double* impulse; - a->infilt = new double[2 * a->size * 2]; // (double *)malloc0(2 * a->size * sizeof(dcomplex)); - a->product = new double[2 * a->size * 2]; // (double *)malloc0(2 * a->size * sizeof(dcomplex)); + a->infilt = new double[2 * a->size * 2]; // (double *)malloc0(2 * a->size * sizeof(wcomplex)); + a->product = new double[2 * a->size * 2]; // (double *)malloc0(2 * a->size * sizeof(wcomplex)); impulse = FIR::fir_bandpass(a->size + 1, a->f_low, a->f_high, a->samplerate, a->wintype, 1, 1.0 / (double)(2 * a->size)); a->mults = FIR::fftcv_mults(2 * a->size, impulse); a->CFor = fftw_plan_dft_1d(2 * a->size, (fftw_complex *)a->infilt, (fftw_complex *)a->product, FFTW_FORWARD, FFTW_PATIENT); @@ -89,7 +89,7 @@ void BPS::destroy_bps (BPS *a) void BPS::flush_bps (BPS *a) { - memset (a->infilt, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->infilt, 0, 2 * a->size * sizeof (wcomplex)); } void BPS::xbps (BPS *a, int pos) @@ -98,7 +98,7 @@ void BPS::xbps (BPS *a, int pos) double I, Q; if (a->run && pos == a->position) { - memcpy (&(a->infilt[2 * a->size]), a->in, a->size * sizeof (dcomplex)); + memcpy (&(a->infilt[2 * a->size]), a->in, a->size * sizeof (wcomplex)); fftw_execute (a->CFor); for (i = 0; i < 2 * a->size; i++) { @@ -108,10 +108,10 @@ void BPS::xbps (BPS *a, int pos) a->product[2 * i + 1] = I * a->mults[2 * i + 1] + Q * a->mults[2 * i + 0]; } fftw_execute (a->CRev); - memcpy (a->infilt, &(a->infilt[2 * a->size]), a->size * sizeof(dcomplex)); + memcpy (a->infilt, &(a->infilt[2 * a->size]), a->size * sizeof(wcomplex)); } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void BPS::setBuffers_bps (BPS *a, double* in, double* out) diff --git a/wdsp/calculus.cpp b/wdsp/calculus.cpp index d5f234da7..1a08b51e8 100644 --- a/wdsp/calculus.cpp +++ b/wdsp/calculus.cpp @@ -29,7 +29,7 @@ warren@wpratt.com namespace WDSP { -const double GG[241 * 241] = { +const double Calculus::GG[241 * 241] = { 7.25654181154076983e-01, 7.05038822098223439e-01, 6.85008217584843870e-01, 6.65545775927326222e-01, 6.46635376294157682e-01, 6.28261355371665386e-01, 6.10408494407843394e-01, 5.93062006626410732e-01, 5.76207525000389742e-01, 5.59831090374464435e-01, 5.43919139925240769e-01, 5.28458495948192608e-01, @@ -14552,7 +14552,7 @@ const double GG[241 * 241] = { 1.00000000000000000e+00, 1.00000000000000000e+00, 1.00000000000000000e+00, 1.00000000000000000e+00, 1.00000000000000000e+00 }; -const double GGS[241 * 241] = { +const double Calculus::GGS[241 * 241] = { 8.00014908335353492e-01, 8.00020707540703313e-01, 8.00026700706648830e-01, 8.00032894400760863e-01, 8.00039295417528384e-01, 8.00045910786425396e-01, 8.00052747780268358e-01, 8.00059813923879481e-01, 8.00067117003061101e-01, 8.00074665073896907e-01, 8.00082466472385456e-01, 8.00090529824419749e-01, diff --git a/wdsp/cblock.cpp b/wdsp/cblock.cpp index 91c1f7366..6de2c445f 100644 --- a/wdsp/cblock.cpp +++ b/wdsp/cblock.cpp @@ -95,7 +95,7 @@ void CBL::xcbl (CBL *a) } } else if (a->in_buff != a->out_buff) - memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof (dcomplex)); + memcpy (a->out_buff, a->in_buff, a->buff_size * sizeof (wcomplex)); } void CBL::setBuffers_cbl (CBL *a, double* in, double* out) diff --git a/wdsp/cfcomp.cpp b/wdsp/cfcomp.cpp index e9bdc3988..bb32e647c 100644 --- a/wdsp/cfcomp.cpp +++ b/wdsp/cfcomp.cpp @@ -387,7 +387,7 @@ void CFCOMP::xcfcomp (CFCOMP *a, int pos) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->bsize * sizeof (dcomplex)); + memcpy (a->out, a->in, a->bsize * sizeof (wcomplex)); } void CFCOMP::setBuffers_cfcomp (CFCOMP *a, double* in, double* out) diff --git a/wdsp/cfir.cpp b/wdsp/cfir.cpp index 66b12fb2e..e65a28376 100644 --- a/wdsp/cfir.cpp +++ b/wdsp/cfir.cpp @@ -98,7 +98,7 @@ void CFIR::xcfir (CFIR *a) if (a->run) FIRCORE::xfircore (a->p); else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void CFIR::setBuffers_cfir (CFIR *a, double* in, double* out) diff --git a/wdsp/comm.hpp b/wdsp/comm.hpp index 03aca443a..53abaffa2 100644 --- a/wdsp/comm.hpp +++ b/wdsp/comm.hpp @@ -25,6 +25,9 @@ warren@wpratt.com */ +#ifndef wdsp_comm_h +#define wdsp_comm_h + #ifdef ANDROID #include #define APPNAME "WDSP" @@ -71,10 +74,14 @@ warren@wpratt.com #define PI 3.1415926535897932 #define TWOPI 6.2831853071795864 +namespace WDSP { // miscellaneous -typedef double dcomplex[2]; +typedef double wcomplex[2]; +} #include #include #include #include + +#endif diff --git a/wdsp/compress.cpp b/wdsp/compress.cpp index a0f71a400..10edeecdc 100644 --- a/wdsp/compress.cpp +++ b/wdsp/compress.cpp @@ -74,7 +74,7 @@ void COMPRESSOR::xcompressor (COMPRESSOR *a) a->outbuff[2 * i + 1] = 0.0; } else if (a->inbuff != a->outbuff) - memcpy(a->outbuff, a->inbuff, a->buffsize * sizeof (dcomplex)); + memcpy(a->outbuff, a->inbuff, a->buffsize * sizeof (wcomplex)); } void COMPRESSOR::setBuffers_compressor (COMPRESSOR *a, double* in, double* out) diff --git a/wdsp/delay.cpp b/wdsp/delay.cpp index 149f3b177..cec652879 100644 --- a/wdsp/delay.cpp +++ b/wdsp/delay.cpp @@ -67,7 +67,7 @@ void DELAY::destroy_delay (DELAY *a) void DELAY::flush_delay (DELAY *a) { - memset (a->ring, 0, a->cpp * sizeof (dcomplex)); + memset (a->ring, 0, a->cpp * sizeof (wcomplex)); a->idx_in = 0; } @@ -97,7 +97,7 @@ void DELAY::xdelay (DELAY *a) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); a->cs_update.unlock(); } diff --git a/wdsp/emnr.cpp b/wdsp/emnr.cpp index 290ec7332..93e310836 100644 --- a/wdsp/emnr.cpp +++ b/wdsp/emnr.cpp @@ -874,7 +874,7 @@ void EMNR::xemnr (EMNR *a, int pos) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->bsize * sizeof (dcomplex)); + memcpy (a->out, a->in, a->bsize * sizeof (wcomplex)); } void EMNR::setBuffers_emnr (EMNR *a, double* in, double* out) diff --git a/wdsp/emph.cpp b/wdsp/emph.cpp index de7e52eb4..f110a65d1 100644 --- a/wdsp/emph.cpp +++ b/wdsp/emph.cpp @@ -76,7 +76,7 @@ void EMPHP::xemphp (EMPHP *a, int position) if (a->run && a->position == position) FIRCORE::xfircore (a->p); else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void EMPHP::setBuffers_emphp (EMPHP *a, double* in, double* out) @@ -210,7 +210,7 @@ void EMPH::destroy_emph (EMPH *a) void EMPH::flush_emph (EMPH *a) { - memset (a->infilt, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->infilt, 0, 2 * a->size * sizeof (wcomplex)); } void EMPH::xemph (EMPH *a, int position) @@ -219,7 +219,7 @@ void EMPH::xemph (EMPH *a, int position) double I, Q; if (a->run && a->position == position) { - memcpy (&(a->infilt[2 * a->size]), a->in, a->size * sizeof (dcomplex)); + memcpy (&(a->infilt[2 * a->size]), a->in, a->size * sizeof (wcomplex)); fftw_execute (a->CFor); for (i = 0; i < 2 * a->size; i++) { @@ -229,10 +229,10 @@ void EMPH::xemph (EMPH *a, int position) a->product[2 * i + 1] = I * a->mults[2 * i + 1] + Q * a->mults[2 * i + 0]; } fftw_execute (a->CRev); - memcpy (a->infilt, &(a->infilt[2 * a->size]), a->size * sizeof(dcomplex)); + memcpy (a->infilt, &(a->infilt[2 * a->size]), a->size * sizeof(wcomplex)); } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void EMPH::setBuffers_emph (EMPH *a, double* in, double* out) diff --git a/wdsp/eq.cpp b/wdsp/eq.cpp index d162a74a8..50ca5a09a 100644 --- a/wdsp/eq.cpp +++ b/wdsp/eq.cpp @@ -225,7 +225,7 @@ void EQP::xeqp (EQP *a) if (a->run) FIRCORE::xfircore (a->p); else - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void EQP::setBuffers_eqp (EQP *a, double* in, double* out) @@ -585,7 +585,7 @@ void EQ::destroy_eq (EQ *a) void EQ::flush_eq (EQ *a) { - memset (a->infilt, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->infilt, 0, 2 * a->size * sizeof (wcomplex)); } void EQ::xeq (EQ *a) @@ -594,7 +594,7 @@ void EQ::xeq (EQ *a) double I, Q; if (a->run) { - memcpy (&(a->infilt[2 * a->size]), a->in, a->size * sizeof (dcomplex)); + memcpy (&(a->infilt[2 * a->size]), a->in, a->size * sizeof (wcomplex)); fftw_execute (a->CFor); for (i = 0; i < 2 * a->size; i++) { @@ -604,10 +604,10 @@ void EQ::xeq (EQ *a) a->product[2 * i + 1] = I * a->mults[2 * i + 1] + Q * a->mults[2 * i + 0]; } fftw_execute (a->CRev); - memcpy (a->infilt, &(a->infilt[2 * a->size]), a->size * sizeof(dcomplex)); + memcpy (a->infilt, &(a->infilt[2 * a->size]), a->size * sizeof(wcomplex)); } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void EQ::setBuffers_eq (EQ *a, double* in, double* out) diff --git a/wdsp/fir.cpp b/wdsp/fir.cpp index c3662d218..dec18857a 100644 --- a/wdsp/fir.cpp +++ b/wdsp/fir.cpp @@ -33,13 +33,13 @@ namespace WDSP { double* FIR::fftcv_mults (int NM, double* c_impulse) { - double* mults = new double[NM * 2]; // (double *) malloc0 (NM * sizeof (dcomplex)); - double* cfft_impulse = new double[NM * 2]; // (double *) malloc0 (NM * sizeof (dcomplex)); + double* mults = new double[NM * 2]; // (double *) malloc0 (NM * sizeof (wcomplex)); + double* cfft_impulse = new double[NM * 2]; // (double *) malloc0 (NM * sizeof (wcomplex)); fftw_plan ptmp = fftw_plan_dft_1d(NM, (fftw_complex *) cfft_impulse, (fftw_complex *) mults, FFTW_FORWARD, FFTW_PATIENT); - memset (cfft_impulse, 0, NM * sizeof (dcomplex)); + memset (cfft_impulse, 0, NM * sizeof (wcomplex)); // store complex coefs right-justified in the buffer - memcpy (&(cfft_impulse[NM - 2]), c_impulse, (NM / 2 + 1) * sizeof(dcomplex)); + memcpy (&(cfft_impulse[NM - 2]), c_impulse, (NM / 2 + 1) * sizeof(wcomplex)); fftw_execute (ptmp); fftw_destroy_plan (ptmp); delete[] cfft_impulse; @@ -91,8 +91,8 @@ double* FIR::fir_fsamp_odd (int N, double* A, int rtype, double scale, int winty int mid = (N - 1) / 2; double mag, phs; double* window; - double *fcoef = new double[N * 2]; // (double *) malloc0 (N * sizeof (dcomplex)); - double *c_impulse = new double[N * 2]; // (double *) malloc0 (N * sizeof (dcomplex)); + double *fcoef = new double[N * 2]; // (double *) malloc0 (N * sizeof (wcomplex)); + double *c_impulse = new double[N * 2]; // (double *) malloc0 (N * sizeof (wcomplex)); fftw_plan ptmp = fftw_plan_dft_1d(N, (fftw_complex *)fcoef, (fftw_complex *)c_impulse, FFTW_BACKWARD, FFTW_PATIENT); double local_scale = 1.0 / (double)N; for (i = 0; i <= mid; i++) @@ -339,7 +339,7 @@ void FIR::mp_imp (int N, double* fir, double* mpfir, int pfactor, int polarity) double* ana = new double[size * 2]; // (double *) malloc0 (size * sizeof (complex)); double* impulse = new double[size * 2]; // (double *) malloc0 (size * sizeof (complex)); double* newfreq = new double[size * 2]; // (double *) malloc0 (size * sizeof (complex)); - memcpy (firpad, fir, N * sizeof (dcomplex)); + memcpy (firpad, fir, N * sizeof (wcomplex)); fftw_plan pfor = fftw_plan_dft_1d (size, (fftw_complex *) firpad, (fftw_complex *) firfreq, FFTW_FORWARD, FFTW_PATIENT); fftw_plan prev = fftw_plan_dft_1d (size, (fftw_complex *) newfreq, @@ -365,9 +365,9 @@ void FIR::mp_imp (int N, double* fir, double* mpfir, int pfactor, int polarity) } fftw_execute (prev); if (polarity) - memcpy (mpfir, &impulse[2 * (pfactor - 1) * N], N * sizeof (dcomplex)); + memcpy (mpfir, &impulse[2 * (pfactor - 1) * N], N * sizeof (wcomplex)); else - memcpy (mpfir, impulse, N * sizeof (dcomplex)); + memcpy (mpfir, impulse, N * sizeof (wcomplex)); // print_impulse("min_imp.txt", N, mpfir, 1, 0); fftw_destroy_plan (prev); fftw_destroy_plan (pfor); diff --git a/wdsp/firmin.cpp b/wdsp/firmin.cpp index 6f84781aa..757045833 100644 --- a/wdsp/firmin.cpp +++ b/wdsp/firmin.cpp @@ -74,7 +74,7 @@ void FIRMIN::destroy_firmin (FIRMIN *a) void FIRMIN::flush_firmin (FIRMIN *a) { - memset (a->ring, 0, a->rsize * sizeof (dcomplex)); + memset (a->ring, 0, a->rsize * sizeof (wcomplex)); a->idx = 0; } @@ -100,7 +100,7 @@ void FIRMIN::xfirmin (FIRMIN *a, int pos) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void FIRMIN::setBuffers_firmin (FIRMIN *a, double* in, double* out) @@ -168,7 +168,7 @@ void FIROPT::calc_firopt (FIROPT *a) { // I right-justified the impulse response => take output from left side of output buff, discard right side // Be careful about flipping an asymmetrical impulse response. - memcpy (&(a->maskgen[2 * a->size]), &(impulse[2 * a->size * i]), a->size * sizeof(dcomplex)); + memcpy (&(a->maskgen[2 * a->size]), &(impulse[2 * a->size * i]), a->size * sizeof(wcomplex)); fftw_execute (a->maskplan[i]); } delete[] (impulse); @@ -223,9 +223,9 @@ void FIROPT::destroy_firopt (FIROPT *a) void FIROPT::flush_firopt (FIROPT *a) { int i; - memset (a->fftin, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->fftin, 0, 2 * a->size * sizeof (wcomplex)); for (i = 0; i < a->nfor; i++) - memset (a->fftout[i], 0, 2 * a->size * sizeof (dcomplex)); + memset (a->fftout[i], 0, 2 * a->size * sizeof (wcomplex)); a->buffidx = 0; } @@ -234,10 +234,10 @@ void FIROPT::xfiropt (FIROPT *a, int pos) if (a->run && (a->position == pos)) { int i, j, k; - memcpy (&(a->fftin[2 * a->size]), a->in, a->size * sizeof (dcomplex)); + memcpy (&(a->fftin[2 * a->size]), a->in, a->size * sizeof (wcomplex)); fftw_execute (a->pcfor[a->buffidx]); k = a->buffidx; - memset (a->accum, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->accum, 0, 2 * a->size * sizeof (wcomplex)); for (j = 0; j < a->nfor; j++) { for (i = 0; i < 2 * a->size; i++) @@ -249,10 +249,10 @@ void FIROPT::xfiropt (FIROPT *a, int pos) } a->buffidx = (a->buffidx + 1) & a->idxmask; fftw_execute (a->crev); - memcpy (a->fftin, &(a->fftin[2 * a->size]), a->size * sizeof(dcomplex)); + memcpy (a->fftin, &(a->fftin[2 * a->size]), a->size * sizeof(wcomplex)); } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void FIROPT::setBuffers_firopt (FIROPT *a, double* in, double* out) @@ -332,12 +332,12 @@ void FIRCORE::calc_fircore (FIRCORE *a, int flip) if (a->mp) FIR::mp_imp (a->nc, a->impulse, a->imp, 16, 0); else - memcpy (a->imp, a->impulse, a->nc * sizeof (dcomplex)); + memcpy (a->imp, a->impulse, a->nc * sizeof (wcomplex)); for (i = 0; i < a->nfor; i++) { // I right-justified the impulse response => take output from left side of output buff, discard right side // Be careful about flipping an asymmetrical impulse response. - memcpy (&(a->maskgen[2 * a->size]), &(a->imp[2 * a->size * i]), a->size * sizeof(dcomplex)); + memcpy (&(a->maskgen[2 * a->size]), &(a->imp[2 * a->size * i]), a->size * sizeof(wcomplex)); fftw_execute (a->maskplan[1 - a->cset][i]); } a->masks_ready = 1; @@ -362,7 +362,7 @@ FIRCORE* FIRCORE::create_fircore (int size, double* in, double* out, int nc, int plan_fircore (a); a->impulse = new double[a->nc * 2]; // (double *) malloc0 (a->nc * sizeof (complex)); a->imp = new double[a->nc * 2]; // (double *) malloc0 (a->nc * sizeof (complex)); - memcpy (a->impulse, impulse, a->nc * sizeof (dcomplex)); + memcpy (a->impulse, impulse, a->nc * sizeof (wcomplex)); calc_fircore (a, 1); return a; } @@ -404,19 +404,19 @@ void FIRCORE::destroy_fircore (FIRCORE *a) void FIRCORE::flush_fircore (FIRCORE *a) { int i; - memset (a->fftin, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->fftin, 0, 2 * a->size * sizeof (wcomplex)); for (i = 0; i < a->nfor; i++) - memset (a->fftout[i], 0, 2 * a->size * sizeof (dcomplex)); + memset (a->fftout[i], 0, 2 * a->size * sizeof (wcomplex)); a->buffidx = 0; } void FIRCORE::xfircore (FIRCORE *a) { int i, j, k; - memcpy (&(a->fftin[2 * a->size]), a->in, a->size * sizeof (dcomplex)); + memcpy (&(a->fftin[2 * a->size]), a->in, a->size * sizeof (wcomplex)); fftw_execute (a->pcfor[a->buffidx]); k = a->buffidx; - memset (a->accum, 0, 2 * a->size * sizeof (dcomplex)); + memset (a->accum, 0, 2 * a->size * sizeof (wcomplex)); a->update.lock(); for (j = 0; j < a->nfor; j++) { @@ -430,7 +430,7 @@ void FIRCORE::xfircore (FIRCORE *a) a->update.unlock(); a->buffidx = (a->buffidx + 1) & a->idxmask; fftw_execute (a->crev); - memcpy (a->fftin, &(a->fftin[2 * a->size]), a->size * sizeof(dcomplex)); + memcpy (a->fftin, &(a->fftin[2 * a->size]), a->size * sizeof(wcomplex)); } void FIRCORE::setBuffers_fircore (FIRCORE *a, double* in, double* out) @@ -452,7 +452,7 @@ void FIRCORE::setSize_fircore (FIRCORE *a, int size) void FIRCORE::setImpulse_fircore (FIRCORE *a, double* impulse, int update) { - memcpy (a->impulse, impulse, a->nc * sizeof (dcomplex)); + memcpy (a->impulse, impulse, a->nc * sizeof (wcomplex)); calc_fircore (a, update); } @@ -466,7 +466,7 @@ void FIRCORE::setNc_fircore (FIRCORE *a, int nc, double* impulse) plan_fircore (a); a->imp = new double[a->nc * 2]; // (double *) malloc0 (a->nc * sizeof (complex)); a->impulse = new double[a->nc * 2]; // (double *) malloc0 (a->nc * sizeof (complex)); - memcpy (a->impulse, impulse, a->nc * sizeof (dcomplex)); + memcpy (a->impulse, impulse, a->nc * sizeof (wcomplex)); calc_fircore (a, 1); } diff --git a/wdsp/fmd.cpp b/wdsp/fmd.cpp index 692e2b508..49882efa1 100644 --- a/wdsp/fmd.cpp +++ b/wdsp/fmd.cpp @@ -160,7 +160,7 @@ void FMD::destroy_fmd (FMD *a) void FMD::flush_fmd (FMD *a) { - memset (a->audio, 0, a->size * sizeof (dcomplex)); + memset (a->audio, 0, a->size * sizeof (wcomplex)); FIRCORE::flush_fircore (a->pde); FIRCORE::flush_fircore (a->paud); a->phs = 0.0; @@ -214,7 +214,7 @@ void FMD::xfmd (FMD *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void FMD::setBuffers_fmd (FMD *a, double* in, double* out) diff --git a/wdsp/fmmod.cpp b/wdsp/fmmod.cpp index ae42bf31c..5025a2aae 100644 --- a/wdsp/fmmod.cpp +++ b/wdsp/fmmod.cpp @@ -127,7 +127,7 @@ void FMMOD::xfmmod (FMMOD *a) FIRCORE::xfircore (a->p); } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void FMMOD::setBuffers_fmmod (FMMOD *a, double* in, double* out) diff --git a/wdsp/fmsq.cpp b/wdsp/fmsq.cpp index 92c3fd8ab..480c6ee00 100644 --- a/wdsp/fmsq.cpp +++ b/wdsp/fmsq.cpp @@ -226,7 +226,7 @@ void FMSQ::xfmsq (FMSQ *a) } } else if (a->insig != a->outsig) - memcpy (a->outsig, a->insig, a->size * sizeof (dcomplex)); + memcpy (a->outsig, a->insig, a->size * sizeof (wcomplex)); } void FMSQ::setBuffers_fmsq (FMSQ *a, double* in, double* out, double* trig) diff --git a/wdsp/gain.cpp b/wdsp/gain.cpp index 74dbb664f..08c532385 100644 --- a/wdsp/gain.cpp +++ b/wdsp/gain.cpp @@ -71,7 +71,7 @@ void GAIN::xgain (GAIN *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); a->cs_update.unlock(); } diff --git a/wdsp/gen.cpp b/wdsp/gen.cpp index 3cb4bedcc..83fda7cb1 100644 --- a/wdsp/gen.cpp +++ b/wdsp/gen.cpp @@ -350,13 +350,13 @@ void GEN::xgen (GEN *a) break; default: // silence { - memset (a->out, 0, a->size * sizeof (dcomplex)); + memset (a->out, 0, a->size * sizeof (wcomplex)); break; } } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void GEN::setBuffers_gen (GEN *a, double* in, double* out) diff --git a/wdsp/icfir.cpp b/wdsp/icfir.cpp index b72d5dc29..0446f27ea 100644 --- a/wdsp/icfir.cpp +++ b/wdsp/icfir.cpp @@ -113,7 +113,7 @@ void ICFIR::xicfir (ICFIR *a) if (a->run) FIRCORE::xfircore (a->p); else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void ICFIR::setBuffers_icfir (ICFIR *a, double* in, double* out) diff --git a/wdsp/iir.cpp b/wdsp/iir.cpp index ad12a51eb..e169ecc99 100644 --- a/wdsp/iir.cpp +++ b/wdsp/iir.cpp @@ -94,7 +94,7 @@ void SNOTCH::xsnotch (SNOTCH *a) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); a->cs_update.unlock(); } @@ -293,7 +293,7 @@ void SPEAK::xspeak (SPEAK *a) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); a->cs_update.unlock(); } @@ -440,7 +440,7 @@ void MPEAK::xmpeak (MPEAK *a) if (a->run) { int i, j; - memset (a->mix, 0, a->size * sizeof (dcomplex)); + memset (a->mix, 0, a->size * sizeof (wcomplex)); for (i = 0; i < a->npeaks; i++) { if (a->enable[i]) @@ -450,10 +450,10 @@ void MPEAK::xmpeak (MPEAK *a) a->mix[j] += a->tmp[j]; } } - memcpy (a->out, a->mix, a->size * sizeof (dcomplex)); + memcpy (a->out, a->mix, a->size * sizeof (wcomplex)); } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); a->cs_update.unlock(); } @@ -623,7 +623,7 @@ void PHROT::xphrot (PHROT *a) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); a->cs_update.unlock(); } @@ -782,7 +782,7 @@ void BQLP::xbqlp(BQLP *a) } } else if (a->out != a->in) - memcpy(a->out, a->in, a->size * sizeof(dcomplex)); + memcpy(a->out, a->in, a->size * sizeof(wcomplex)); a->cs_update.unlock(); } @@ -1013,7 +1013,7 @@ void BQBP::xbqbp(BQBP *a) } } else if (a->out != a->in) - memcpy(a->out, a->in, a->size * sizeof(dcomplex)); + memcpy(a->out, a->in, a->size * sizeof(wcomplex)); a->cs_update.unlock(); } @@ -1199,10 +1199,10 @@ void SPHP::destroy_sphp(SPHP *a) void SPHP::flush_sphp(SPHP *a) { - memset(a->x0, 0, a->nstages * sizeof(dcomplex)); - memset(a->x1, 0, a->nstages * sizeof(dcomplex)); - memset(a->y0, 0, a->nstages * sizeof(dcomplex)); - memset(a->y1, 0, a->nstages * sizeof(dcomplex)); + memset(a->x0, 0, a->nstages * sizeof(wcomplex)); + memset(a->x1, 0, a->nstages * sizeof(wcomplex)); + memset(a->y0, 0, a->nstages * sizeof(wcomplex)); + memset(a->y1, 0, a->nstages * sizeof(wcomplex)); } void SPHP::xsphp(SPHP *a) @@ -1230,7 +1230,7 @@ void SPHP::xsphp(SPHP *a) } } else if (a->out != a->in) - memcpy(a->out, a->in, a->size * sizeof(dcomplex)); + memcpy(a->out, a->in, a->size * sizeof(wcomplex)); a->cs_update.unlock(); } diff --git a/wdsp/iqc.cpp b/wdsp/iqc.cpp index 6e2e7fe07..265a09474 100644 --- a/wdsp/iqc.cpp +++ b/wdsp/iqc.cpp @@ -205,7 +205,7 @@ void IQC::xiqc (IQC *a) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void IQC::setBuffers_iqc (IQC *a, double* in, double* out) diff --git a/wdsp/nbp.cpp b/wdsp/nbp.cpp index 46d57e7c1..478aa6d4a 100644 --- a/wdsp/nbp.cpp +++ b/wdsp/nbp.cpp @@ -363,7 +363,7 @@ void NBP::xnbp (NBP *a, int pos) if (a->run && pos == a->position) FIRCORE::xfircore (a->p); else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void NBP::setBuffers_nbp (NBP *a, double* in, double* out) diff --git a/wdsp/osctrl.cpp b/wdsp/osctrl.cpp index b8bf2f220..c19639a1e 100644 --- a/wdsp/osctrl.cpp +++ b/wdsp/osctrl.cpp @@ -83,7 +83,7 @@ void OSCTRL::destroy_osctrl (OSCTRL *a) void OSCTRL::flush_osctrl (OSCTRL *a) { - memset (a->dl, 0, a->dl_len * sizeof (dcomplex)); + memset (a->dl, 0, a->dl_len * sizeof (wcomplex)); memset (a->dlenv, 0, a->pn * sizeof (double)); } @@ -116,7 +116,7 @@ void OSCTRL::xosctrl (OSCTRL *a) } } else if (a->inbuff != a->outbuff) - memcpy (a->outbuff, a->inbuff, a->size * sizeof (dcomplex)); + memcpy (a->outbuff, a->inbuff, a->size * sizeof (wcomplex)); } void OSCTRL::setBuffers_osctrl (OSCTRL *a, double* in, double* out) diff --git a/wdsp/resample.cpp b/wdsp/resample.cpp index 5d97344e0..efd4a65b9 100644 --- a/wdsp/resample.cpp +++ b/wdsp/resample.cpp @@ -116,7 +116,7 @@ void RESAMPLE::destroy_resample (RESAMPLE *a) void RESAMPLE::flush_resample (RESAMPLE *a) { - memset (a->ring, 0, a->ringsize * sizeof (dcomplex)); + memset (a->ring, 0, a->ringsize * sizeof (wcomplex)); a->idx_in = a->ringsize - 1; a->phnum = 0; } @@ -156,7 +156,7 @@ int RESAMPLE::xresample (RESAMPLE *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); return outsamps; } diff --git a/wdsp/rmatch.cpp b/wdsp/rmatch.cpp index 91d111951..78ffdd094 100644 --- a/wdsp/rmatch.cpp +++ b/wdsp/rmatch.cpp @@ -334,8 +334,8 @@ void RMATCH::xrmatchIN (void* b, double* in) first = a->ntslew + 1; second = 0; } - memcpy (a->baux, a->ring + 2 * a->iout, first * sizeof (dcomplex)); - memcpy (a->baux + 2 * first, a->ring, second * sizeof (dcomplex)); + memcpy (a->baux, a->ring + 2 * a->iout, first * sizeof (wcomplex)); + memcpy (a->baux + 2 * first, a->ring, second * sizeof (wcomplex)); // a->iout = (a->iout + ovfl + a->rsize / 2) % a->rsize; a->iout = (a->iout + ovfl) % a->rsize; // } @@ -349,8 +349,8 @@ void RMATCH::xrmatchIN (void* b, double* in) first = newsamps; second = 0; } - memcpy (a->ring + 2 * a->iin, a->resout, first * sizeof (dcomplex)); - memcpy (a->ring, a->resout + 2 * first, second * sizeof (dcomplex)); + memcpy (a->ring + 2 * a->iin, a->resout, first * sizeof (wcomplex)); + memcpy (a->ring, a->resout + 2 * first, second * sizeof (wcomplex)); if (a->ucnt >= 0) upslew(a, newsamps); a->iin = (a->iin + newsamps) % a->rsize; if (ovfl > 0) blend (a); @@ -418,8 +418,8 @@ void RMATCH::dslew (RMATCH *a) first = zeros; second = 0; } - memset (a->ring + 2 * i, 0, first * sizeof (dcomplex)); - memset (a->ring, 0, second * sizeof (dcomplex)); + memset (a->ring + 2 * i, 0, first * sizeof (wcomplex)); + memset (a->ring, 0, second * sizeof (wcomplex)); n += zeros; // } // // a->n_ring = a->outsize + a->rsize / 2; @@ -453,8 +453,8 @@ void RMATCH::xrmatchOUT (void* b, double* out) first = a->outsize; second = 0; } - memcpy (a->out, a->ring + 2 * a->iout, first * sizeof (dcomplex)); - memcpy (a->out + 2 * first, a->ring, second * sizeof (dcomplex)); + memcpy (a->out, a->ring + 2 * a->iout, first * sizeof (wcomplex)); + memcpy (a->out + 2 * first, a->ring, second * sizeof (wcomplex)); a->iout = (a->iout + a->outsize) % a->rsize; a->n_ring -= a->outsize; a->dlast[0] = a->out[2 * (a->outsize - 1) + 0]; diff --git a/wdsp/shift.cpp b/wdsp/shift.cpp index a8ebdefc8..ad7122a12 100644 --- a/wdsp/shift.cpp +++ b/wdsp/shift.cpp @@ -86,7 +86,7 @@ void SHIFT::xshift (SHIFT *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void SHIFT::setBuffers_shift(SHIFT *a, double* in, double* out) diff --git a/wdsp/siphon.cpp b/wdsp/siphon.cpp index 4c867192c..8d4336756 100644 --- a/wdsp/siphon.cpp +++ b/wdsp/siphon.cpp @@ -101,9 +101,9 @@ void SIPHON::destroy_siphon (SIPHON *a) void SIPHON::flush_siphon (SIPHON *a) { - memset (a->sipbuff, 0, a->sipsize * sizeof (dcomplex)); - memset (a->sipout , 0, a->sipsize * sizeof (dcomplex)); - memset (a->specout, 0, a->fftsize * sizeof (dcomplex)); + memset (a->sipbuff, 0, a->sipsize * sizeof (wcomplex)); + memset (a->sipout , 0, a->sipsize * sizeof (wcomplex)); + memset (a->specout, 0, a->fftsize * sizeof (wcomplex)); a->idx = 0; } @@ -117,7 +117,7 @@ void SIPHON::xsiphon (SIPHON *a, int pos) { case 0: if (a->insize >= a->sipsize) - memcpy (a->sipbuff, &(a->in[2 * (a->insize - a->sipsize)]), a->sipsize * sizeof (dcomplex)); + memcpy (a->sipbuff, &(a->in[2 * (a->insize - a->sipsize)]), a->sipsize * sizeof (wcomplex)); else { if (a->insize > (a->sipsize - a->idx)) @@ -130,8 +130,8 @@ void SIPHON::xsiphon (SIPHON *a, int pos) first = a->insize; second = 0; } - memcpy (a->sipbuff + 2 * a->idx, a->in, first * sizeof (dcomplex)); - memcpy (a->sipbuff, a->in + 2 * first, second * sizeof (dcomplex)); + memcpy (a->sipbuff + 2 * a->idx, a->in, first * sizeof (wcomplex)); + memcpy (a->sipbuff, a->in + 2 * first, second * sizeof (wcomplex)); if ((a->idx += a->insize) >= a->sipsize) a->idx -= a->sipsize; } break; @@ -167,11 +167,11 @@ void SIPHON::suck (SIPHON *a) int j = (a->idx - a->outsize) & mask; int size = a->sipsize - j; if (size >= a->outsize) - memcpy (a->sipout, &(a->sipbuff[2 * j]), a->outsize * sizeof (dcomplex)); + memcpy (a->sipout, &(a->sipbuff[2 * j]), a->outsize * sizeof (wcomplex)); else { - memcpy (a->sipout, &(a->sipbuff[2 * j]), size * sizeof (dcomplex)); - memcpy (&(a->sipout[2 * size]), a->sipbuff, (a->outsize - size) * sizeof (dcomplex)); + memcpy (a->sipout, &(a->sipbuff[2 * j]), size * sizeof (wcomplex)); + memcpy (&(a->sipout[2 * size]), a->sipbuff, (a->outsize - size) * sizeof (wcomplex)); } } } diff --git a/wdsp/slew.cpp b/wdsp/slew.cpp index ff0a2660d..f32bba0c8 100644 --- a/wdsp/slew.cpp +++ b/wdsp/slew.cpp @@ -158,7 +158,7 @@ void USLEW::xuslew (USLEW *a) } } else if (a->out != a->in) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); } void USLEW::setBuffers_uslew (USLEW *a, double* in, double* out) diff --git a/wdsp/snb.cpp b/wdsp/snb.cpp index 2370e2035..cd22186f9 100644 --- a/wdsp/snb.cpp +++ b/wdsp/snb.cpp @@ -214,8 +214,8 @@ void SNBA::flush_snba (SNBA *d) memset (d->sdet.vp, 0, d->xsize * sizeof (double)); memset (d->sdet.vpwr, 0, d->xsize * sizeof (double)); - memset (d->inbuff, 0, d->isize * sizeof (dcomplex)); - memset (d->outbuff, 0, d->isize * sizeof (dcomplex)); + memset (d->inbuff, 0, d->isize * sizeof (wcomplex)); + memset (d->outbuff, 0, d->isize * sizeof (wcomplex)); RESAMPLE::flush_resample (d->inresamp); RESAMPLE::flush_resample (d->outresamp); } @@ -626,7 +626,7 @@ void SNBA::xsnba (SNBA *d) RESAMPLE::xresample (d->outresamp); } else if (d->out != d->in) - memcpy (d->out, d->in, d->bsize * sizeof (dcomplex)); + memcpy (d->out, d->in, d->bsize * sizeof (wcomplex)); } /******************************************************************************************************** @@ -842,7 +842,7 @@ void BPSNBA::destroy_bpsnba (BPSNBA *a) void BPSNBA::flush_bpsnba (BPSNBA *a) { - memset (a->buff, 0, a->size * sizeof (dcomplex)); + memset (a->buff, 0, a->size * sizeof (wcomplex)); NBP::flush_nbp (a->bpsnba); } @@ -871,7 +871,7 @@ void BPSNBA::setSize_bpsnba (BPSNBA *a, int size) void BPSNBA::xbpsnbain (BPSNBA *a, int position) { if (a->run && a->position == position) - memcpy (a->buff, a->in, a->size * sizeof (dcomplex)); + memcpy (a->buff, a->in, a->size * sizeof (wcomplex)); } void BPSNBA::xbpsnbaout (BPSNBA *a, int position) diff --git a/wdsp/ssql.cpp b/wdsp/ssql.cpp index 6c38dd8a1..f27ad89fb 100644 --- a/wdsp/ssql.cpp +++ b/wdsp/ssql.cpp @@ -229,7 +229,7 @@ void SSQL::destroy_ssql (SSQL *a) void SSQL::flush_ssql (SSQL *a) { - memset (a->b1, 0, a->size * sizeof (dcomplex)); + memset (a->b1, 0, a->size * sizeof (wcomplex)); CBL::flush_cbl (a->dcbl); memset (a->ibuff, 0, a->size * sizeof (double)); memset (a->ftovbuff, 0, a->size * sizeof (double)); @@ -317,7 +317,7 @@ void SSQL::xssql (SSQL *a) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof(dcomplex)); + memcpy (a->out, a->in, a->size * sizeof(wcomplex)); } void SSQL::setBuffers_ssql (SSQL *a, double* in, double* out) diff --git a/wdsp/varsamp.cpp b/wdsp/varsamp.cpp index ccbf381b1..e2aeb22a8 100644 --- a/wdsp/varsamp.cpp +++ b/wdsp/varsamp.cpp @@ -120,7 +120,7 @@ void VARSAMP::destroy_varsamp (VARSAMP *a) void VARSAMP::flush_varsamp (VARSAMP *a) { - memset (a->ring, 0, a->rsize * sizeof (dcomplex)); + memset (a->ring, 0, a->rsize * sizeof (wcomplex)); a->idx_in = a->rsize - 1; a->h_offset = 0.0; a->isamps = 0.0; @@ -165,7 +165,7 @@ int VARSAMP::xvarsamp (VARSAMP *a, double var) a->inv_cvar += a->dicvar; picvar = (uint64_t*)(&a->inv_cvar); N = *picvar & 0xffffffffffff0000; - a->inv_cvar = *((double *)&N); + a->inv_cvar = static_cast(N); a->delta = 1.0 - a->inv_cvar; while (a->isamps < 1.0) { @@ -191,7 +191,7 @@ int VARSAMP::xvarsamp (VARSAMP *a, double var) } } else if (a->in != a->out) - memcpy (a->out, a->in, a->size * sizeof (dcomplex)); + memcpy (a->out, a->in, a->size * sizeof (wcomplex)); return outsamps; } diff --git a/wdsp/wcpAGC.cpp b/wdsp/wcpAGC.cpp index b10fd5c48..9e31f2afe 100644 --- a/wdsp/wcpAGC.cpp +++ b/wdsp/wcpAGC.cpp @@ -345,7 +345,7 @@ void WCPAGC::xwcpagc (WCPAGC *a) } } else if (a->out != a->in) - memcpy(a->out, a->in, a->io_buffsize * sizeof (dcomplex)); + memcpy(a->out, a->in, a->io_buffsize * sizeof (wcomplex)); } void WCPAGC::setBuffers_wcpagc (WCPAGC *a, double* in, double* out)