I am attempting to calculate relative band power for EEG channels in an EDF file following this paper:
which defines the formula for relative power (RP) as:
so far as I can tell P(f1,f2) could be calculated different ways depending on the definition of power in a band:
- power calculated from an
epochsobject calculated using
compute_psdbetween f1 and f2
totalPower = epochs.compute_psd(picks=picks, fmin=FMIN, fmax=MAX) bandPower = epochs.compute_psd(picks=picks, fmin=f1 fmax=f2) # pad bandPower to same dimensions as totalPower and divide
- power calculated between 1 and 45Hz filtered by f1 and f2
totalPower = epochs.compute_psd(picks=picks, fmin=FMIN, fmax=FMAX) totalPsds, totalFreqs = totalPower.get_data(return_freqs=True) bandPsds = totalPsds[:,:,(totalFreqs >= f1) & (totalFreqs < f2)].mean(axis=-1)
I am likely showing my naivety here but both are possible in code but only one or neither method is likely conventionally correct.
Please could the group let me know what they think.