API change of PS

This commit is contained in:
Anne de Jong 2018-02-13 07:57:50 +01:00 committed by Anne de Jong
parent 54e9eeca37
commit f23164b743
5 changed files with 6 additions and 14 deletions

View File

@ -70,7 +70,7 @@ AvPowerSpectra* AvPowerSpectra_alloc(const us nfft,
iVARTRACE(15,oo); iVARTRACE(15,oo);
if(oo == 0) {oo++;} if(oo == 0) {oo++;}
PowerSpectra* ps = PowerSpectra_alloc(nfft,nchannels,wt); PowerSpectra* ps = PowerSpectra_alloc(nfft,wt);
if(!ps) { if(!ps) {
WARN(ALLOCFAILED "ps"); WARN(ALLOCFAILED "ps");
feTRACE(15); feTRACE(15);
@ -78,12 +78,6 @@ AvPowerSpectra* AvPowerSpectra_alloc(const us nfft,
} }
AvPowerSpectra* aps = a_malloc(sizeof(AvPowerSpectra)); 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->nchannels = nchannels;
aps->nfft = nfft; aps->nfft = nfft;

View File

@ -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 * @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. * Return the current number of averages taken to obtain the result.

View File

@ -20,7 +20,6 @@ typedef struct PowerSpectra_s {
} PowerSpectra; } PowerSpectra;
PowerSpectra* PowerSpectra_alloc(const us nfft, PowerSpectra* PowerSpectra_alloc(const us nfft,
const us nchannels,
const WindowType wt) { const WindowType wt) {
fsTRACE(15); fsTRACE(15);

View File

@ -22,7 +22,6 @@ typedef struct PowerSpectra_s PowerSpectra;
* @return PowerSpectra handle, NULL on error * @return PowerSpectra handle, NULL on error
*/ */
PowerSpectra* PowerSpectra_alloc(const us nfft, PowerSpectra* PowerSpectra_alloc(const us nfft,
const us nchannels,
const WindowType wt); const WindowType wt);
/** /**

View File

@ -83,7 +83,6 @@ blackman = Blackman
cdef extern from "ps.h": cdef extern from "ps.h":
ctypedef struct c_PowerSpectra "PowerSpectra" ctypedef struct c_PowerSpectra "PowerSpectra"
c_PowerSpectra* PowerSpectra_alloc(const us nfft, c_PowerSpectra* PowerSpectra_alloc(const us nfft,
const us nchannels,
const WindowType wt) const WindowType wt)
void PowerSpectra_compute(const c_PowerSpectra* ps, void PowerSpectra_compute(const c_PowerSpectra* ps,
@ -97,8 +96,8 @@ cdef class PowerSpectra:
cdef: cdef:
c_PowerSpectra* _ps c_PowerSpectra* _ps
def __cinit__(self, us nfft,us nchannels,us window=rectangular): def __cinit__(self, us nfft,us window=rectangular):
self._ps = PowerSpectra_alloc(nfft,nchannels,<WindowType> window) self._ps = PowerSpectra_alloc(nfft,<WindowType> window)
if self._ps == NULL: if self._ps == NULL:
raise RuntimeError('PowerSpectra allocation failed') raise RuntimeError('PowerSpectra allocation failed')