diff --git a/src/python/qdft/qdft.py b/src/python/qdft/qdft.py index 142d148..1db1806 100644 --- a/src/python/qdft/qdft.py +++ b/src/python/qdft/qdft.py @@ -62,11 +62,11 @@ def __init__(self, samplerate, bandwidth, resolution=24, latency=0, window=(+0.5 outputs = numpy.zeros((size, kernels.size), dtype=complex) dfts = numpy.zeros((0, size, kernels.size), dtype=complex) - dfts = QDFT.analyze(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, window) + dfts = self.__analyze__(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, window) assert dfts.shape == (0, size, ) samples = numpy.zeros((0), dtype=float) - samples = QDFT.synthesize(dfts, samples, twiddles) + samples = self.__synthesize__(dfts, samples, twiddles) assert samples.shape == (0, ) self.samplerate = samplerate @@ -120,7 +120,7 @@ def qdft(self, samples): dfts = numpy.zeros((samples.size, size, kernels.size), complex) - return QDFT.analyze(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, window) + return self.__analyze__(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, window) def iqdft(self, dfts): """ @@ -145,10 +145,11 @@ def iqdft(self, dfts): samples = numpy.zeros(len(dfts), float) - return QDFT.synthesize(dfts, samples, twiddles) + return self.__synthesize__(dfts, samples, twiddles) + @staticmethod @numba.jit(nopython=True, fastmath=True) - def analyze(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, window): + def __analyze__(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, window): if not dfts.size: return dfts[..., 0] @@ -199,8 +200,9 @@ def analyze(dfts, inputs, outputs, periods, offsets, weights, fiddles, twiddles, return dfts[..., 0] + @staticmethod @numba.jit(nopython=True, fastmath=True) - def synthesize(dfts, samples, twiddles): + def __synthesize__(dfts, samples, twiddles): if not dfts.size: return samples