def _time_frequency(X, Ws, use_fft, decim):
    n_epochs, n_times = X.shape
    n_times = n_times // decim + bool(n_times % decim)
    n_frequencies = len(Ws)
    psd = np.zeros((n_frequencies, n_times))  # PSD
    plf = np.zeros((n_frequencies, n_times), np.complex)  # phase lock

    mode = 'same'
    tfrs = _cwt(X, Ws, mode, decim=decim, use_fft=use_fft)

    for tfr in tfrs:
        tfr_abs = np.abs(tfr)
        psd += tfr_abs ** 2
        plf += tfr / tfr_abs
    psd /= n_epochs
    plf = np.abs(plf) / n_epochs
    return psd, plf
Add menu item to menu tree hierarchy.
dataset/ETHPy150Open mne-tools/mne-python/mne/time_frequency/tfr.py/_time_frequency--crossover with--dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/base.py/Admin.add_menu_item