<div dir="ltr">Hi Mats,<div><br></div><div>Thanks a lot, you're right, now it works.</div><div>Yeah, I didn't apply any kind of transformation, I just used the ft_freqanalysis and applied it to the data.</div><div><br></div><div>Thanks again.</div><div><br></div><div>Best,</div><div>Alessandro Orticoni</div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno mar 4 set 2018 alle ore 15:35 Es, M.W.J. van (Mats) <<a href="mailto:M.vanEs@donders.ru.nl">M.vanEs@donders.ru.nl</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Alessandro,<br>
<br>
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 <br>
freq_EEG_append.label{i,1}       = freq_EEG{1}{i}.label; <br>
with normal brackets (): <br>
freq_EEG_append.label(i,1)       = freq_EEG{1}{i}.label;<br>
<br>
Hope that helps.<br>
<br>
Best,<br>
Mats van Es<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 3 Sep 2018 22:16:23 +0200<br>
From: Alessandro Orticoni <<a href="mailto:alessandro.orticoni@gmail.com" target="_blank">alessandro.orticoni@gmail.com</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] [Fieldtrip] Power spectrum units and Error in<br>
        ft_topoplotER<br>
Message-ID:<br>
        <<a href="mailto:CACwO6W8rSrzq3Vsp8sZNNvcPQ3np9cMw-tPiEBgbePPVqD5zPw@mail.gmail.com" target="_blank">CACwO6W8rSrzq3Vsp8sZNNvcPQ3np9cMw-tPiEBgbePPVqD5zPw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear all,<br>
<br>
I would have two questions.<br>
<br>
*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?<br>
<br>
*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<br>
file):<br>
<br>
1 -0.186808 0.232745  0.125128 0.093849 F3<br>
2 0.186808  0.232745  0.125128 0.093849 F4<br>
3 -0.225000 0.000046  0.125128 0.093849 C3<br>
4 0.225000  0.000046  0.125128 0.093849 C4<br>
5 -0.139045 -0.427979 0.125128 0.093849 O1<br>
6 0.139045  -0.427979 0.125128 0.093849 O2<br>
<br>
This is the code I wrote to try to plot it:<br>
<br>
freq_EEG_append = freq_EEG{1}{1};   % Just one sleep stage<br>
<br>
for i=2:6   % Length(selchan)<br>
    freq_EEG_append.label{i,1}       = freq_EEG{1}{i}.label;<br>
    freq_EEG_append.powspctrmft_sin(i,:)   = freq_EEG{1}{i}.powspctrm;<br>
    freq_EEG_append.cfg.channel{i,1} = freq_EEG{1}{i}.cfg.channel; end<br>
<br>
cfg = [];<br>
% cfg.xlim = [0.3 0.5];<br>
% cfg.zlim = [0 6e-14];<br>
cfg.layout = 'EEGCap.lay';<br>
cfg.parameter = 'individual';<br>
figure;<br>
ft_topoplotER(cfg,freq_EEG_append);<br>
colorbar;<br>
<br>
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.<br>
<br>
freq_EEG_append =<br>
<br>
   struct with fields:<br>
   label: {6×1 cell}<br>
   dimord: 'chan_freq'<br>
   freq: [1×1121 double]<br>
   powspctrm: [6×1121 double]<br>
   cfg: [1×1 struct]<br>
<br>
But I'm getting the following error:<br>
<br>
Error using cell/unique (line 85)<br>
Input A must be a cell array of character vectors.<br>
<br>
Error in ft_channelselection (line 107)<br>
if length(datachannel)~=length(unique(datachannel))<br>
<br>
Error in ft_prepare_layout (line 234)<br>
  cfg.channel = ft_channelselection(cfg.channel, data.label);<br>
<br>
Error in ft_topoplotER (line 209)<br>
cfg.layout = ft_prepare_layout(tmpcfg, varargin{1});<br>
<br>
<br>
Thanks in advance for your help.<br>
<br>
<br>
Best,<br>
Alessandro Orticoni<br>
<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>