def compute_wiener_filter(speech_psd, noise_psd):
    """
    Compute Wiener filter in the frequency domain.

    Parameters
    ----------
    speech_psd : numpy array
        Speech power spectral density.
    noise_psd : float or numpy array
        Noise variance if white noise, numpy array otherwise.

    Returns
    -------
    numpy array
        Frequency domain filter, computed at the same frequency values as
        `speech_psd`.
    """

    return speech_psd / (speech_psd + noise_psd)