def slice_freqs(data, low, high):
    """Find indices for desired range of freqs in FFT output."""
    if low > high:
        low, high = high, low

    it = (x[0] for x in enumerate(data) if (x[1] > low and x[1] < high))
    a = next(it)
    b = a
    for b in it:
        pass
    return a, b