Plot a piecewise-defined function
There are two ways to solve this problem. The first one is numpy.where, which can take two arrays and it will choose from one wherever a condition is true and from the other wherever it is false. This only works if your piecewise function has only two possible states (as is the case here):

def waf_delay(delays):
    return np.where(np.abs(delays) &lt;= delay_chip*(1+delay_chip/integration_time),
                    1 - np.abs(delays)/delay_chip,
                    -delay_chip/integration_time)


Another more general possibility is to use numpy.piecewise, but that is probably overkill here:

def f1(x):
    return 1 - np.abs(x)/delay_chip

def f2(x):
    return -delay_chip/integration_time

cut_off = delay_chip*(1+delay_chip/integration_time)
y = np.piecewise(x, [np.abs(x) &lt;= cut_off, np.abs(x) &gt; cut_off], [f1, f2])


Note that in both cases no for d in delays is needed, because all functions used are vecotorized (the basic arithmetic operations for numpy arrays are and so is numpy.abs).