<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi <span style="color: rgb(34, 34, 34); background-color: rgb(255, 255, 255);" class="">Jörn</span>,<div class=""><br class=""></div><div class="">Thanks for the advice - I've just tried to add cfg.sens = sens but still the same error.</div><div class=""><div class=""><br class=""></div><div class="">Any other suggestions?</div><div class=""><br class=""></div><div class="">thanks,<br class=""><div apple-content-edited="true" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="font-family: JaneAusten; font-size: 14px;" class="">~ grazia</span></div></div></div></div><div apple-content-edited="true" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div></div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 21Oct, 2015, at 12:00, <a href="mailto:fieldtrip-request@science.ru.nl" class="">fieldtrip-request@science.ru.nl</a> wrote:</div><br class="Apple-interchange-newline"><div class="">Send fieldtrip mailing list submissions to<br class=""><span class="Apple-tab-span" style="white-space:pre">   </span><a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a><br class=""><br class="">To subscribe or unsubscribe via the World Wide Web, visit<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br class="">or, via email, send a message with subject or body 'help' to<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>fieldtrip-request@science.ru.nl<br class=""><br class="">You can reach the person managing the list at<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>fieldtrip-owner@science.ru.nl<br class=""><br class="">When replying, please edit your Subject line so it is more specific<br class="">than "Re: Contents of fieldtrip digest..."<br class=""><br class=""><br class="">Today's Topics:<br class=""><br class="">   1. Call for new post docs in the Obleser lab | Auditory<br class="">      Cognition (Jonas Obleser)<br class="">   2. Spectrum normalization (Wunderle, Thomas)<br class="">   3. Interpolation and ft_channelrepair (Grazia Di Pisa)<br class="">   4. Re: Interpolation and ft_channelrepair<br class="">      (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=)<br class=""><br class=""><br class="">----------------------------------------------------------------------<br class=""><br class="">Message: 1<br class="">Date: Tue, 20 Oct 2015 06:07:51 -0500<br class="">From: Jonas Obleser <jonas@obleser.de><br class="">To: fieldtrip@science.ru.nl, AUDITORY@LISTS.MCGILL.CA<br class="">Subject: [FieldTrip] Call for new post docs in the Obleser lab |<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Auditory<span class="Apple-tab-span" style="white-space:pre">    </span>Cognition<br class="">Message-ID: <71625964-4C4D-41CA-BEDB-171CEFBC87F8@obleser.de><br class="">Content-Type: text/plain; charset=utf-8<br class=""><br class="">The research group ?Auditory Cognition? (headed by Jonas Obleser; auditorycognition.com), now at the University of L?beck, is seeking to hire two Postdoctoral researchers, initially for 3 years, with the option of extension.<br class=""><br class="">These positions fall into the larger framework of an ERC Consolidator grant ?The listening challenge: How ageing brains adapt? (AUDADAPT) recently awarded to Jonas Obleser, and will allow the joint development of cognitive-neuroscience and psychological research projects targeting adaptive control in the auditory modality of middle-aged adults.<br class=""><br class="">Please download the full job advert here: https://www.dropbox.com/s/sqc9c94ewl6bjjh/Ausschreibung_1031_15_Wiss%20MitarbeiterIn_Psychologie_EN.pdf?dl=1 <br class=""><br class="">Note the application deadline of November 12 (postal receipt).<br class=""><br class="">http://auditorycognition.com<br class="">http://uni-luebeck.de<br class=""><br class=""><br class=""><br class=""><br class="">------------------------------<br class=""><br class="">Message: 2<br class="">Date: Tue, 20 Oct 2015 14:58:25 +0000<br class="">From: "Wunderle, Thomas" <thomas.wunderle@esi-frankfurt.de><br class="">To: "fieldtrip@science.ru.nl" <fieldtrip@science.ru.nl><br class="">Subject: [FieldTrip] Spectrum normalization<br class="">Message-ID:<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span><27E5CAD9145EEC41BB9B34C01716A198880C3CD4@UM-excdag-a02.um.gwdg.de><br class="">Content-Type: text/plain; charset="iso-8859-1"<br class=""><br class="">Hi all,<br class=""><br class="">I have a question about how FieldTrip normalizes the output of a spectral analyses using ft_freqanalysis.<br class="">This is important for me, because I need the absolute value of the spectrum for a publication.<br class=""><br class="">I was scanning through the code trying to find the normalization steps.<br class="">In particular, I don't understand the following steps:<br class=""><br class=""><br class="">1.)    The tapers (e.g. hanning) are normalized prior to the multiplication with the data by the following code:<br class="">tap = tap./norm(tap, 'fro');   (line 195 in the function fr_specest_mtmfft)<br class="">What is the rationale of dividing through this special norm of the taper itself?<br class=""><br class=""><br class="">2.)    After calculating the fft, the specrum is scaled (i.e. in the function fr_specest_mtmfft) by:<br class=""><br class="">dum = dum .* sqrt(2 ./ endnsample);  (line 251)<br class=""><br class="">Later on, to get to the power spectrum, the abs of the spectrum is taken and squared<br class=""><br class="">powdum = abs(spectrum(acttap,:,foiind(ifoi),acttboi)) .^2; (line 629 in ft_frequanalysis)<br class=""><br class=""><br class=""><br class="">This puzzles me, because scanning through the literature, the power spectrum should be given by<br class=""><br class="">(2*abs(X)^2) ./ (nfft^2)                -> unit: V^2        (X=signal, nfft = number of data points)<br class=""><br class="">and the PSD by<br class=""><br class="">(2*abs(X)^2) ./ (nfft*Fs)              -> unit: V^2/Hz (X=signal, nfft = number of data points, Fs=sampling rate)<br class=""><br class=""><br class=""><br class="">Alternatively, one can get the amplitude spectrum from the power spectrum by taking the square root of the PSD:<br class=""><br class="">sqrt(PSD)                             -> unit: V/sqrt(Hz)<br class=""><br class="">which is still different from<br class=""><br class="">(2*abs(X)) ./ (nfft*Fres)               -> unit: V/Hz ?   (Fres = frequency resolution = Fs/nfft)<br class=""><br class=""><br class=""><br class="">The result of these equations are different from what comes out of the FieldTrip code.<br class=""><br class="">So what is the unit of the spectrum in FieldTrip?<br class=""><br class="">What is the rationale of scaling the complex spectrum by sqrt(2/nfft) ?<br class=""><br class="">Furthermore, is the unit for the different spectral estimation methods the same? That is, using mtmfft, mtmconvol, wavelet,...?<br class=""><br class="">It would help me a lot if someone could clarify these points.<br class=""><br class="">Thanks in advance,<br class="">Thomas<br class=""><br class=""><br class="">-----<br class="">Dr. Thomas Wunderle<br class="">Ernst Str?ngmann Institute (ESI) for Neuroscience<http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews><br class="">in Cooperation with Max Planck Society <http://www.ncbi.nlm.nih.gov/feed/rss.cgi?ChanKey=PubMedNews><br class="">Deutschordenstrasse 46<br class="">60528 Frankfurt am Main, Germany<br class="">www.esi-frankfurt.de<http://www.esi-frankfurt.de/><br class="">thomas.wunderle@esi-frankfurt.de<mailto:thomas.wunderle@esi-frankfurt.de><br class="">Tel:   +49 69 96769 516<br class="">Fax:   +49 69 96769 555<br class=""><br class="">Sitz der Gesellschaft: Frankfurt am Main<br class="">Registergericht: Amtsgericht Frankfurt - HRB 84266<br class="">Gesch?ftsf?hrer: Prof. Dr. Pascal Fries<br class=""><br class=""><br class="">-------------- next part --------------<br class="">An HTML attachment was scrubbed...<br class="">URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151020/eebaf460/attachment-0001.html><br class=""><br class="">------------------------------<br class=""><br class="">Message: 3<br class="">Date: Wed, 21 Oct 2015 10:30:07 +0200<br class="">From: Grazia Di Pisa <g.dipisa@gmail.com><br class="">To: fieldtrip@science.ru.nl<br class="">Subject: [FieldTrip] Interpolation and ft_channelrepair<br class="">Message-ID: <A46541FB-BC67-44E7-A9CD-541FB39B7C54@gmail.com><br class="">Content-Type: text/plain; charset=utf-8<br class=""><br class="">Dear all,<br class=""><br class="">I?m trying to do interpolation to repair some bad channels, but I?m getting the error below.<br class="">I've read the ft_fetch_sens help but I don?t understand how I should specify the electrodes.<br class=""><br class="">Is there a file I should upload or am I missing something in my code? <br class="">Any help or hint is very much appreciated!<br class=""><br class="">thanks in advance,<br class="">~ grazia<br class=""><br class=""><br class="">//<br class="">Error using ft_fetch_sens (line 183)<br class="">no electrodes or gradiometers specified.<br class=""><br class="">Error in ft_channelrepair (line 115)<br class=""> sens = ft_fetch_sens(cfg, data);<br class=""><br class="">Error in new_analyse_GDP (line 42)<br class="">ft_channelrepair(cfg, data)<br class="">//<br class=""><br class="">This is my code:<br class=""><br class="">15 <span class="Apple-tab-span" style="white-space:pre">     </span>cfg = [];<br class="">16 <span class="Apple-tab-span" style="white-space:pre">   </span>cfg_neighb       <span class="Apple-tab-span" style="white-space:pre">     </span>= [];<br class="">17<span class="Apple-tab-span" style="white-space:pre">        </span>cfg_neighb.method<span class="Apple-tab-span" style="white-space:pre">   </span>= 'triangulation'; <br class="">18    cfg.senstype      <span class="Apple-tab-span" style="white-space:pre">    </span>= 'EEG';<br class="">19    cfg_neighb.layout <span class="Apple-tab-span" style="white-space:pre">        </span>= 'biosemi64.lay';<br class="">20    neighbours        <span class="Apple-tab-span" style="white-space:pre">   </span>= ft_prepare_neighbours(cfg_neighb);<br class="">21    <br class="">22    cfg.neighbours    <span class="Apple-tab-span" style="white-space:pre">   </span>= neighbours;<br class="">23    cfg.channel       <span class="Apple-tab-span" style="white-space:pre">     </span>= {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',}; <br class="">24    cfg.feedback     <span class="Apple-tab-span" style="white-space:pre">      </span> = 'yes';<br class="">25    cfg.layout <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>= 'biosemi64.lay';<br class="">26    lay <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>= ft_prepare_layout(cfg);<br class="">27    <br class="">28    sens <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>= data;<br class="">29    sens.type <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>= 'eeg';<br class="">30    sens.label<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>= lay.label;<br class="">31    sens.chanpos <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>= lay.pos;<br class="">32    sens.chanpos(:,3) <span class="Apple-tab-span" style="white-space:pre">      </span>= 0;<br class="">33  <br class="">34   ft_neighbourplot(cfg, data)<br class="">35 <br class="">36    cfg <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>= [];<br class="">37    cfg.method         <span class="Apple-tab-span" style="white-space:pre">  </span>= 'nearest';<br class="">38    cfg.badchannel     <span class="Apple-tab-span" style="white-space:pre">       </span>= {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'};<br class="">39    cfg.neighbours    <span class="Apple-tab-span" style="white-space:pre">    </span> = neighbours;<br class="">40    cfg.trials        <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span> = 'all';<br class="">41     <br class="">42    ft_channelrepair(cfg, data)<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class="">------------------------------<br class=""><br class="">Message: 4<br class="">Date: Wed, 21 Oct 2015 10:42:03 +0200<br class="">From: "=?UTF-8?Q?J=C3=B6rn_M._Horschig?=" <jorn@artinis.com><br class="">To: "'FieldTrip discussion list'" <fieldtrip@science.ru.nl><br class="">Subject: Re: [FieldTrip] Interpolation and ft_channelrepair<br class="">Message-ID: <002b01d10bdc$5d377040$17a650c0$@artinis.com><br class="">Content-Type: text/plain;<span class="Apple-tab-span" style="white-space:pre">       </span>charset="UTF-8"<br class=""><br class="">Dear Grazia,<br class=""><br class="">try adding cfg.sens = sens; before line 42. That will set the sensor definition so that ft_channelrepair knows the location of your channels, which is otherwise not obvious.<br class=""><br class="">Best,<br class="">J?rn<br class=""><br class="">--<br class=""><br class="">J?rn M. Horschig, PhD, Software Engineer<br class="">Artinis Medical Systems  |  +31 481 350 980 <br class=""><br class=""><blockquote type="cite" class="">-----Original Message-----<br class="">From: fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-<br class="">bounces@science.ru.nl] On Behalf Of Grazia Di Pisa<br class="">Sent: Wednesday, October 21, 2015 10:30 AM<br class="">To: fieldtrip@science.ru.nl<br class="">Subject: [FieldTrip] Interpolation and ft_channelrepair<br class=""><br class="">Dear all,<br class=""><br class="">I?m trying to do interpolation to repair some bad channels, but I?m getting<br class="">the error below.<br class="">I've read the ft_fetch_sens help but I don?t understand how I should specify<br class="">the electrodes.<br class=""><br class="">Is there a file I should upload or am I missing something in my code?<br class="">Any help or hint is very much appreciated!<br class=""><br class="">thanks in advance,<br class="">~ grazia<br class=""><br class=""><br class="">//<br class="">Error using ft_fetch_sens (line 183)<br class="">no electrodes or gradiometers specified.<br class=""><br class="">Error in ft_channelrepair (line 115)<br class=""> sens = ft_fetch_sens(cfg, data);<br class=""><br class="">Error in new_analyse_GDP (line 42)<br class="">ft_channelrepair(cfg, data)<br class="">//<br class=""><br class="">This is my code:<br class=""><br class="">15 <span class="Apple-tab-span" style="white-space:pre"> </span>cfg = [];<br class="">16 <span class="Apple-tab-span" style="white-space:pre">   </span>cfg_neighb       <span class="Apple-tab-span" style="white-space:pre">     </span>= [];<br class="">17<span class="Apple-tab-span" style="white-space:pre">        </span>cfg_neighb.method<span class="Apple-tab-span" style="white-space:pre">   </span>= 'triangulation';<br class="">18    cfg.senstype      <span class="Apple-tab-span" style="white-space:pre">     </span>= 'EEG';<br class="">19    cfg_neighb.layout <span class="Apple-tab-span" style="white-space:pre">        </span>= 'biosemi64.lay';<br class="">20    neighbours        <span class="Apple-tab-span" style="white-space:pre">   </span>= ft_prepare_neighbours(cfg_neighb);<br class="">21<br class="">22    cfg.neighbours    <span class="Apple-tab-span" style="white-space:pre">      </span>= neighbours;<br class="">23    cfg.channel       <span class="Apple-tab-span" style="white-space:pre">     </span>= {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9',};<br class="">24    cfg.feedback     <span class="Apple-tab-span" style="white-space:pre">       </span> = 'yes';<br class="">25    cfg.layout <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>= 'biosemi64.lay';<br class="">26    lay <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>= ft_prepare_layout(cfg);<br class="">27<br class="">28    sens <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>= data;<br class="">29    sens.type <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>= 'eeg';<br class="">30    sens.label<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>= lay.label;<br class="">31    sens.chanpos <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>= lay.pos;<br class="">32    sens.chanpos(:,3) <span class="Apple-tab-span" style="white-space:pre">      </span>= 0;<br class="">33<br class="">34   ft_neighbourplot(cfg, data)<br class="">35<br class="">36    cfg <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>= [];<br class="">37    cfg.method         <span class="Apple-tab-span" style="white-space:pre">  </span>= 'nearest';<br class="">38    cfg.badchannel     <span class="Apple-tab-span" style="white-space:pre">       </span>= {'Fp1', 'Fp2', 'AF7', 'AF3','AF8','F7','F5','FT9'};<br class="">39    cfg.neighbours    <span class="Apple-tab-span" style="white-space:pre">    </span> = neighbours;<br class="">40    cfg.trials        <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span> = 'all';<br class="">41<br class="">42    ft_channelrepair(cfg, data)<br class=""><br class=""><br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">fieldtrip mailing list<br class="">fieldtrip@donders.ru.nl<br class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br class=""></blockquote><br class=""><br class=""><br class=""><br class="">------------------------------<br class=""><br class="">_______________________________________________<br class="">fieldtrip mailing list<br class="">fieldtrip@donders.ru.nl<br class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br class=""><br class="">End of fieldtrip Digest, Vol 59, Issue 17<br class="">*****************************************<br class=""></div></blockquote></div><br class=""></body></html>