@cache
def dct(n_filters, n_input):

    basis = np.empty((n_filters, n_input))
    basis[0, :] = 1.0 / np.sqrt(n_input)

    samples = np.arange(1, 2*n_input, 2) * np.pi / (2.0 * n_input)

    for i in range(1, n_filters):
        basis[i, :] = np.cos(i*samples) * np.sqrt(2.0/n_input)

    return basis
Discrete cosine transform (DCT type-III) basis.
dataset/ETHPy150Open bmcfee/librosa/librosa/filters.py/dct