def is_close(fa, m, n, ratio=2):
    """
    Is the percent harmonic distortion at m close to the percent harmonic distortion
    at harmonic n?
    Close is defined as (larger / smaller) < ratio
    """
    if m not in fa.distortion or n not in fa.distortion:
        return False
    if fa.distortion[m] == fa.distortion[n]:
        return True
    if fa.distortion[m] == 0 or fa.distortion[n] == 0:
        return False
    biggest = fa.distortion[m] / fa.distortion[n] if fa.distortion[m] > fa.distortion[n] else fa.distortion[n] / fa.distortion[m]
    return biggest < ratio