def welch(x, fs=1.0, window='hann', nperseg=256, noverlap=None, nfft=None,
          detrend='constant', return_onesided=True, scaling='density', axis=-1):

    freqs, Pxx = csd(x, x, fs, window, nperseg, noverlap, nfft, detrend,
                     return_onesided, scaling, axis)

    return freqs, Pxx.real
Estimate power spectral density using Welch's method.
dataset/ETHPy150Open scipy/scipy/scipy/signal/spectral.py/welch