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

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
*/
d AvPowerSpectra_realoverlappct(const AvPowerSpectra* aps);
d AvPowerSpectra_realoverlap_pct(const AvPowerSpectra* aps);
/**
* Return the current number of averages taken to obtain the result.

View File

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

View File

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

View File

@ -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,<WindowType> window)
def __cinit__(self, us nfft,us window=rectangular):
self._ps = PowerSpectra_alloc(nfft,<WindowType> window)
if self._ps == NULL:
raise RuntimeError('PowerSpectra allocation failed')