compute_psd for resp, gsr, and temperature channels

Hey there,

I am working with an MNE raw object that has 32 eeg channels and a few additional channel types: eog, ecg, resp, gsr, and temperature.
I am interested in computing the PSD for these channels. For the EEG, eog, and ecg channels this works fine without any problems. However, for the resp, gsr, and temperature channels it just doesn’t work.

Are these channel types handled differently? And if so, is there a way to compute the psd for chose channels?

As a work around I could just label these channels ecg or eog, but if possible I would much rather keep the correct labels.

Furthermore, can someone recommend a good tutorial for working with these other peripheral physiological measures within MNE python or is it recommended to use other packages to analyse those?

All the best,

What is the actual outcome when you compute the PSD for these channel types? Do you get an error? If not, what does the produced figure look like?

hi Jonas,

There is a notion of “data channels” in mne and it’s possible that channels you are
interested in are not considered “data channels” so they are excluded from certain
computations like PSD.

We could reconsider this. In the mean time you can fake them as some already considered
“data channel”.



It should work, but you have to explicitly provide these channels in the picks argument of compute_psd.

import numpy as np
from mne import create_info
from import RawArray

data = np.random.randn(1, 1000)
info = create_info(["GSR 1"], 1000, "gsr")
raw = RawArray(data, info)
spectrum = raw.compute_psd()  # fails
spectrum = raw.compute_psd(picks="gsr")  # works

This is due to gsr, temperature, … not being considered as data channels.


1 Like