def psd_matrix(S, sample_rate):
    """Function for computing the power spectral density matrix with units matched
    to scipy.signal.welch(X, axis=1, scaling='spectrum')

    Parameters
    ----------
    S :
        The spectral matrix [nchannels x nchannels x nfreqs x nepochs]
    sample_rate :
        The sampling rate of the system

    Returns
    -------


    """
    return S / sample_rate
