Example #1
0
def quintic(x, n, offset=0):
    # can't just convolve, need to set boundary conditions
    xbc = quintic_pad(x)
    xup = filtering.upsample(xbc, n)
    h = quintic_filter(n, offset)

    y = filtering.filter(h, xup)

    # delay of filter is 3*n - 1, so with b.c. padding of 2*n, start at 5*n - 1
    start = 5 * n - 1
    # stop at the last 'valid' (no implicit zero padding in conv) value
    stop = -len(h) + 1

    return y[start:stop]