[FieldTrip] [Fieldtrip] Power spectrum units and Error in ft_topoplotER
Es, M.W.J. van (Mats)
M.vanEs at donders.ru.nl
Tue Sep 4 15:06:52 CEST 2018
Hi Alessandro,
Power is the square of the magnitude of your signal. Since your signal is in uV, the units of power would be (uV)^2. Note that this only holds if you have not applied any transformations (like normalizations) to your raw data or power values. Relating to your second question, I think your specification of the label structure is wrong. Try replacing the first {} brackets in
freq_EEG_append.label{i,1} = freq_EEG{1}{i}.label;
with normal brackets ():
freq_EEG_append.label(i,1) = freq_EEG{1}{i}.label;
Hope that helps.
Best,
Mats van Es
----------------------------------------------------------------------
Message: 1
Date: Mon, 3 Sep 2018 22:16:23 +0200
From: Alessandro Orticoni <alessandro.orticoni at gmail.com>
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] [Fieldtrip] Power spectrum units and Error in
ft_topoplotER
Message-ID:
<CACwO6W8rSrzq3Vsp8sZNNvcPQ3np9cMw-tPiEBgbePPVqD5zPw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Dear all,
I would have two questions.
*1)* First one is about ft_freqanalysis: which are the units of the output, given the cfg.output='pow' and the EEG data in uV?
*2)* The second one is about the topoplot. I'm trying to plot the power spectrum over the following six channels (I created the following .lay
file):
1 -0.186808 0.232745 0.125128 0.093849 F3
2 0.186808 0.232745 0.125128 0.093849 F4
3 -0.225000 0.000046 0.125128 0.093849 C3
4 0.225000 0.000046 0.125128 0.093849 C4
5 -0.139045 -0.427979 0.125128 0.093849 O1
6 0.139045 -0.427979 0.125128 0.093849 O2
This is the code I wrote to try to plot it:
freq_EEG_append = freq_EEG{1}{1}; % Just one sleep stage
for i=2:6 % Length(selchan)
freq_EEG_append.label{i,1} = freq_EEG{1}{i}.label;
freq_EEG_append.powspctrmft_sin(i,:) = freq_EEG{1}{i}.powspctrm;
freq_EEG_append.cfg.channel{i,1} = freq_EEG{1}{i}.cfg.channel; end
cfg = [];
% cfg.xlim = [0.3 0.5];
% cfg.zlim = [0 6e-14];
cfg.layout = 'EEGCap.lay';
cfg.parameter = 'individual';
figure;
ft_topoplotER(cfg,freq_EEG_append);
colorbar;
In the first part of the code, I created the struct freq_EEG_append collecting the data from freq_EEG, a 1x4 cell (four sleep stages) array whose elements (still cell array) contains six structures (six channels), each resulting from the application of the ft_freqanalysis.
freq_EEG_append =
struct with fields:
label: {6×1 cell}
dimord: 'chan_freq'
freq: [1×1121 double]
powspctrm: [6×1121 double]
cfg: [1×1 struct]
But I'm getting the following error:
Error using cell/unique (line 85)
Input A must be a cell array of character vectors.
Error in ft_channelselection (line 107)
if length(datachannel)~=length(unique(datachannel))
Error in ft_prepare_layout (line 234)
cfg.channel = ft_channelselection(cfg.channel, data.label);
Error in ft_topoplotER (line 209)
cfg.layout = ft_prepare_layout(tmpcfg, varargin{1});
Thanks in advance for your help.
Best,
Alessandro Orticoni
More information about the fieldtrip
mailing list