def gammatone_matrix(b, fc, resolution, step, fs=16000, l=4, threshold=1e-2):
    centers = np.arange(0, resolution - step, step)
    D = []
    for i, center in enumerate(centers):
        t = np.linspace(0, resolution-(center+1), resolution-center)/fs
        env = t**(l-1) * np.exp(-2*np.pi*b*erb(fc)*t)
        if env[-1]/max(env) < threshold:
            D.append(gammatone_function(resolution, fc, center, b=b, l=l))
    D = np.asarray(D)
    D /= np.sqrt(np.sum(D ** 2, axis=1))[:, np.newaxis]
    return D
Dictionary of gammatone functions
dataset/ETHPy150Open jfsantos/ift6266h14/sparse_coding/sparse_coding_gammatone.py/gammatone_matrix