def Compute_electrode_welch(single_electrode): all_psd = [] global FREQS for epoch in single_electrode: all_psd.append(my_welch(epoch, fs = 500)[1][0,:]) freqs = my_welch(epoch, fs = 500)[0] all_psd = np.array(all_psd) FREQS = freqs return all_psd
def Compute_electrode_welch(single_electrode): all_psd = [] global FREQS for epoch in single_electrode: all_psd.append(my_welch(epoch, fs=500)[1][0, :]) freqs = my_welch(epoch, fs=500)[0] all_psd = np.array(all_psd) FREQS = freqs return all_psd
def Compute_electrode_welch(single_electrode): """ Take the average from a single electrode from all trials. Changed from independent analysis version where the average was taken only before plotting in a downstream function Plot_electrode_welch """ all_psd = [] global FREQS for epoch in single_electrode: freqs, power = my_welch(epoch, fs = 500, nperseg =256, nfft = 256, noverlap = 128) #power[0,:], changes a shape so then the np.array easilly converts it so that each row is a single trial fft all_psd.append(power[0,:]) all_psd = np.array(all_psd) FREQS = freqs return np.mean(all_psd, axis = 0)
def Compute_electrode_welch(single_electrode): """ Take the average from a single electrode from all trials. Changed from independent analysis version where the average was taken only before plotting in a downstream function Plot_electrode_welch """ all_psd = [] global FREQS for epoch in single_electrode: freqs, power = my_welch(epoch, fs = 500, nperseg =256, nfft = 256, noverlap = 128) #why is it [0,:]?, to change the shape? all_psd.append(power[0,:]) all_psd = np.array(all_psd) FREQS = freqs[3:36] return np.mean(all_psd, axis = 0)[3:36]
def Compute_electrode_welch(single_electrode): """ Take the average from a single electrode from all trials. Changed from independent analysis version where the average was taken only before plotting in a downstream function Plot_electrode_welch """ all_psd = [] global FREQS for epoch in single_electrode: freqs, power = my_welch(epoch, fs=500, nperseg=256, nfft=256, noverlap=128) #why is it [0,:]?, to change the shape? all_psd.append(power[0, :]) all_psd = np.array(all_psd) FREQS = freqs[3:36] return np.mean(all_psd, axis=0)[3:36]