def get_range(xf, yf, low, high):
    """Gets the values in a range of frequencies.

    Arguments:
        xf: A list of frequencies, generated by rfftfreq
        yf: The amplitudes of frequencies, generated by rfft
        low: Lower bound of frequency to capture
        high: Upper bound of frequency to capture

    returns: Array of values within frquencies.
    """
    x1 = -1
    for i in range(len(xf)):
        if xf[i] >= low:
            x1 = i
            break
    if x1 == -1:
        raise ValueError

    x2 = -1
    for i in range(len(xf) - x1):
        if xf[i + x1] >= high:
            x2 = i + x1
            break
    if x2 == -1:
        raise ValueError

    return [abs(x) for x in yf[x1:x2]]