def bias_term(in_table, n_range):
    """
    Compute the bias term to be subtracted off the cross spectrum to compute
    the covariance spectrum. Equation in Equation in footnote 4 (section 2.1.3,
    page 12) of Uttley et al. 2014.

    Assumes power spectra are raw (not at all normalized, and not Poisson-noise-
    subtracted).

    Parameters
    ----------
    power_ci : np.array of floats
        2-D array of the power in the channels of interest, raw (not normalized
        and not Poisson-noise-subtracted), of the frequencies to be averaged
        over. Size = detchans (if avg over freq) or n_bins/2+1 (if avg over energy).

    power_ref : np.array of floats
        1-D array of the power in the reference band, raw (not normalized and
        not Poisson-noise-subtracted), of the frequencies to be averaged over.
        Size = 1 (if avg over freq) or n_bins/2+1 (if avg over energy).

    mean_rate_ci : np.array of floats
        1-D array of the mean count rate in the channels of interest, in cts/s.
        Size = 1 (if avg over energy) or detchans (if avg over freq).

    mean_rate_ref : float
        Mean count rate in the reference band, in cts/s.

    meta_dict : dict
        Dictionary of meta-parameters needed for analysis.

    n_range : int
        Number of frequency bins averaged over per new frequency bin for lags.
        For energy lags, this is the number of frequency bins averaged over. For
        frequency lags not re-binned in frequency, this is 1. For frequency lags
        that have been re-binned, this is a 1-D array with ints of the number of
        old bins in each new bin. Same as K in equations in Section 2 of
        Uttley et al. 2014. Default=1

    Returns
    -------
    n_squared : float
        The bias term to be subtracted off the cross spectrum for computing the
        covariance spectrum. Equation in footnote 4 (section 2.1.3, page 12) of
        Uttley et al. 2014.

    """
    ## Compute the Poisson noise level in absolute rms units
    Pnoise_ref = in_table.meta['RATE_REF'] * 2.0
    Pnoise_ci = in_table.meta['RATE_CI'] * 2.0

    ## Normalizing power spectra to absolute rms normalization
    ## Not subtracting the noise (yet)!
    abs_ci = in_table['POWER_CI'] * (2.0 * in_table.meta['DT'] / n_range)
    abs_ref = in_table['POWER_REF'] * (2.0 * in_table.meta['DT'] / n_range)

    temp_a = (abs_ref - Pnoise_ref) * Pnoise_ci
    temp_b = (abs_ci - Pnoise_ci) * Pnoise_ref
    temp_c = Pnoise_ref * Pnoise_ci

    n_squared = (temp_a + temp_b + temp_c) / (n_range * in_table.meta['SEGMENTS'])
    return n_squared