API change of PS
This commit is contained in:
parent
54e9eeca37
commit
f23164b743
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -20,7 +20,6 @@ typedef struct PowerSpectra_s {
|
||||
} PowerSpectra;
|
||||
|
||||
PowerSpectra* PowerSpectra_alloc(const us nfft,
|
||||
const us nchannels,
|
||||
const WindowType wt) {
|
||||
|
||||
fsTRACE(15);
|
||||
|
@ -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);
|
||||
|
||||
/**
|
||||
|
@ -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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user