def train(signal, expected, order, lookahead=0):
    padding = np.zeros(lookahead)
    assert len(signal) == len(expected)
    x = np.concatenate([signal, padding])
    y = np.concatenate([padding, expected])

    N = order + lookahead  # filter length
    Rxx = np.zeros(N)
    Rxy = np.zeros(N)
    for i in range(N):
        Rxx[i] = np.dot(x[i:], x[:len(x)-i])
        Rxy[i] = np.dot(y[i:], x[:i-len(x)])
    return levinson.solver(t=Rxx, y=Rxy)
dataset/ETHPy150Open romanz/amodem/amodem/equalizer.py/train/swapped operands of `-`