# 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,
Jonas

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.

https://github.com/mne-tools/mne-python/blob/main/mne/io/pick.py#L1195

https://github.com/mne-tools/mne-python/blob/main/mne/io/pick.py#L1086

We could reconsider this. In the mean time you can fake them as some already considered
â€śdata channelâ€ť.

Alex

Hello,

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 mne.io 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.

Mathieu

1 Like