def phase_structure(phase_a, phase_b, axis=-1):
    """Structure function for phase fluctuations.

    See Daigle, equation 18.

    The last term accounts for the fact that the mean phase difference of the signals may be nonzero.
    """
    return ((phase_a-phase_b)**2.0).mean(axis=axis) - ((phase_a-phase_b).mean(axis=axis))**2.0