def pre_emph(x, coeff=0.95):
    '\n  Apply pre_emph on 2d data (batch_size x window_length)\n  '
    x0 = x[:, 0]
    x0 = np.expand_dims(x0, axis=1)
    diff = (x[:, 1:] - (coeff * x[:, :(- 1)]))
    x_preemph = np.concatenate((x0, diff), axis=1)
    if (not (x.shape == x_preemph.shape)):
        print('ERROR: Pre-emphasis is wrong')
    return x_preemph
Apply pre_emph on 2d data (batch_size x window_length)
def pre_emph(x, coeff=0.95):
    '\n  \n  '
    x0 = x[:, 0]
    x0 = np.expand_dims(x0, axis=1)
    diff = (x[:, 1:] - (coeff * x[:, :(- 1)]))
    x_preemph = np.concatenate((x0, diff), axis=1)
    if (not (x.shape == x_preemph.shape)):
        print('ERROR: Pre-emphasis is wrong')
    return x_preemph