def one_on_f_weight(f, normalize=True):
    """ Literally 1/f weight. Useful for fitting linspace data in logspace.

    Parameters
    ----------
    f: array
        Frequency
    normalize: boolean, optional
        Normalized the weight to [0, 1].
        Defaults to True.

    Returns
    -------
    weight: array
        The 1/f weight.
    """
    weight = 1/f
    if normalize:
        weight /= max(weight)
    return(weight)