@staticmethod
    def filter(samples, coefficiences, zi=None):
        n_filters = coefficiences.shape[1]
        if zi is None:
            zi = np.zeros((4, n_filters, 1-coefficiences.shape[-1]))
        mtx = numpy.zeros((len(samples), n_filters))
        #
        for i in range(n_filters):
            b = coefficiences[0,i]
            a1, a2, a3, a4 = coefficiences[1:,i]
            s1, zi[0,i] = sig.lfilter(a1,b,samples,zi=zi[0,i])
            s2, zi[1,i] = sig.lfilter(a2,b,s1,zi=zi[1,i])
            s3, zi[2,i] = sig.lfilter(a3,b,s2,zi=zi[2,i])
            s4, zi[3,i] = sig.lfilter(a4,b,s3,zi=zi[3,i])
            #print s1,s2,s3,s4
            mtx[...,i] = s4
        return mtx, zi
dataset/ETHPy150Open dongying/dear/dear/spectrum/auditory.py/GammatoneSpectrum.filter/swapped operands of `-`