@staticmethod
    def make_erb_filter_coeffiences(samplerate, N=64, freq_base=A2, freq_max=C8):
        fc = GammatoneSpectrum.erb_space(N, freq_base, freq_max)
        #
        pi = np.pi
        sin = np.sin
        cos = np.cos
        exp = np.exp
        sqrt = np.sqrt
        #
        EarQ = 9.26449
        minBW = 24.7
        order = 1.
        #ERB = ((fc/EarQ)**order + minBW**order) ** (1./order)
        ERB = 0.108*fc + minBW
        BW = 1.019*2*pi*ERB
        #
        T = 1./samplerate
        fct = np.flipud(fc*T)
        bwt = np.flipud(BW*T)
        a0 = T
        a2 = 0
        b0 = 1
        b1 = -2*cos(2*pi*fct) / exp(bwt)
        b2 = exp(-2*bwt)
        a11 = -(2*T*cos(2*pi*fct)/exp(bwt)+2*T*sqrt(3+2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2
        a12 = -(2*T*cos(2*pi*fct)/exp(bwt)-2*T*sqrt(3+2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2
        a13 = -(2*T*cos(2*pi*fct)/exp(bwt)+2*T*sqrt(3-2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2
        a14 = -(2*T*cos(2*pi*fct)/exp(bwt)-2*T*sqrt(3-2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2
        gain = np.abs(
              (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) - sqrt(3-2**1.5)*sin(2*pi*fct)))\
            * (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) + sqrt(3-2**1.5)*sin(2*pi*fct)))\
            * (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) - sqrt(3+2**1.5)*sin(2*pi*fct)))\
            * (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) + sqrt(3+2**1.5)*sin(2*pi*fct)))\
            / (-2/exp(2*bwt) - 2*exp(4j*pi*fct) + 2*(1+exp(4j*pi*fct))/exp(bwt)) ** 4)
        #
        #return a0,a11,a12,a13,a14,a2,b0,b1,b2,gain
        coeffies = np.zeros((5, N, 3))
        coeffies[0][...,0], coeffies[0][...,1], coeffies[0][...,2] = b0, b1, b2
        coeffies[1:,:,0], coeffies[1:,:,2] = a0, a2
        for i,p1 in enumerate([a11,a12,a13,a14]):
            coeffies[i+1,:,1] = p1
        coeffies[1,:,[0,1,2]] /= gain
        return coeffies
dataset/ETHPy150Open dongying/dear/dear/spectrum/auditory.py/GammatoneSpectrum.make_erb_filter_coeffiences/original