From f23164b7435a31c34142491594f927895bee3b84 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong" Date: Tue, 13 Feb 2018 07:57:50 +0100 Subject: [PATCH] API change of PS --- beamforming/c/aps.c | 8 +------- beamforming/c/aps.h | 5 +++-- beamforming/c/ps.c | 1 - beamforming/c/ps.h | 1 - beamforming/wrappers.pyx | 5 ++--- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/beamforming/c/aps.c b/beamforming/c/aps.c index 375cf7b..a7e2804 100644 --- a/beamforming/c/aps.c +++ b/beamforming/c/aps.c @@ -70,7 +70,7 @@ AvPowerSpectra* AvPowerSpectra_alloc(const us nfft, iVARTRACE(15,oo); if(oo == 0) {oo++;} - PowerSpectra* ps = PowerSpectra_alloc(nfft,nchannels,wt); + PowerSpectra* ps = PowerSpectra_alloc(nfft,wt); if(!ps) { WARN(ALLOCFAILED "ps"); feTRACE(15); @@ -78,12 +78,6 @@ AvPowerSpectra* AvPowerSpectra_alloc(const us nfft, } AvPowerSpectra* aps = a_malloc(sizeof(AvPowerSpectra)); - if(!aps) { - WARN("Allocation of AvPowerSpectra memory failed"); - PowerSpectra_free(ps); - feTRACE(15); - return NULL; - } aps->nchannels = nchannels; aps->nfft = nfft; diff --git a/beamforming/c/aps.h b/beamforming/c/aps.h index 1ca1874..7eb026c 100644 --- a/beamforming/c/aps.h +++ b/beamforming/c/aps.h @@ -39,11 +39,12 @@ AvPowerSpectra* AvPowerSpectra_alloc(const us nfft, /** - * Computes the real overlap offset + * Computes the real overlap percentage, from the integer overlap + * offset. * * @param aps */ -d AvPowerSpectra_realoverlappct(const AvPowerSpectra* aps); +d AvPowerSpectra_realoverlap_pct(const AvPowerSpectra* aps); /** * Return the current number of averages taken to obtain the result. diff --git a/beamforming/c/ps.c b/beamforming/c/ps.c index 21c5d4c..cf89060 100644 --- a/beamforming/c/ps.c +++ b/beamforming/c/ps.c @@ -20,7 +20,6 @@ typedef struct PowerSpectra_s { } PowerSpectra; PowerSpectra* PowerSpectra_alloc(const us nfft, - const us nchannels, const WindowType wt) { fsTRACE(15); diff --git a/beamforming/c/ps.h b/beamforming/c/ps.h index ced8eee..94e6b53 100644 --- a/beamforming/c/ps.h +++ b/beamforming/c/ps.h @@ -22,7 +22,6 @@ typedef struct PowerSpectra_s PowerSpectra; * @return PowerSpectra handle, NULL on error */ PowerSpectra* PowerSpectra_alloc(const us nfft, - const us nchannels, const WindowType wt); /** diff --git a/beamforming/wrappers.pyx b/beamforming/wrappers.pyx index 5250cc4..f6eedf6 100644 --- a/beamforming/wrappers.pyx +++ b/beamforming/wrappers.pyx @@ -83,7 +83,6 @@ blackman = Blackman cdef extern from "ps.h": ctypedef struct c_PowerSpectra "PowerSpectra" c_PowerSpectra* PowerSpectra_alloc(const us nfft, - const us nchannels, const WindowType wt) void PowerSpectra_compute(const c_PowerSpectra* ps, @@ -97,8 +96,8 @@ cdef class PowerSpectra: cdef: c_PowerSpectra* _ps - def __cinit__(self, us nfft,us nchannels,us window=rectangular): - self._ps = PowerSpectra_alloc(nfft,nchannels, window) + def __cinit__(self, us nfft,us window=rectangular): + self._ps = PowerSpectra_alloc(nfft, window) if self._ps == NULL: raise RuntimeError('PowerSpectra allocation failed')