def __init__(self, scale, fs, datalength, real=True, matrixform=1, reducedform=0, **kwargs): """Just a wrapper for the wonderful nsgt framework to be in adequation with the MinQT program (from Schorkhuber's framework) this wrapper is loaded from tft.py """ # getting the keyword arguments for nsgt nsgtkwargs = {} for k,v in kwargs.items(): if k in NSGT.__init__.func_code.co_varnames and \ k not in ('scale', 'fs', 'datalength', 'real', 'matrixform', 'reducedform', 'verbose'): nsgtkwargs[k] = v self.nsgt = NSGT(scale=scale, fs=fs, Ls=datalength, real=real, matrixform=matrixform, reducedform=reducedform, **nsgtkwargs) self.kwargs = kwargs self.kwargs['matrixform'] = matrixform self.kwargs['reducedform'] = reducedform self.kwargs['real'] = real self.fs = fs "TODO: check the following" self.freqbins = len(self.nsgt.scale.F())+2
class NonStatGaborT(object ): transformname = 'nsgt' def __init__(self, scale, fs, datalength, real=True, matrixform=1, reducedform=0, **kwargs): """Just a wrapper for the wonderful nsgt framework to be in adequation with the MinQT program (from Schorkhuber's framework) this wrapper is loaded from tft.py """ # getting the keyword arguments for nsgt nsgtkwargs = {} for k,v in kwargs.items(): if k in NSGT.__init__.func_code.co_varnames and \ k not in ('scale', 'fs', 'datalength', 'real', 'matrixform', 'reducedform', 'verbose'): nsgtkwargs[k] = v self.nsgt = NSGT(scale=scale, fs=fs, Ls=datalength, real=real, matrixform=matrixform, reducedform=reducedform, **nsgtkwargs) self.kwargs = kwargs self.kwargs['matrixform'] = matrixform self.kwargs['reducedform'] = reducedform self.kwargs['real'] = real self.fs = fs "TODO: check the following" self.freqbins = len(self.nsgt.scale.F())+2 def computeTransform(self, data): """compute the (forward) transform """ # assumes monohponic data self.checkDataLength(data.size) # TODO: is that the right dim... self._transfo = self.nsgt.forward(data) def invertTransform(self): """compute the inverse transform """ # assumes monohponic data self.checkDataLength(data.size) return self.nsgt.backward(self._transfo) def checkDataLength(self, datalength): """ """ if datalength!=self.nsgt.Ls: self.__init__(scale=self.nsgt.scale, fs=self.nsgt.fs, datalength=datalength, **self.kwargs) def _set_transfo(self, transfo): self._transfo = transfo def _get_transfo(self): return self._transfo def _del_transfo(self): del self._transfo transfo = property(fset=_set_transfo, fget=_get_transfo, fdel=_del_transfo)