[FieldTrip] basic question

Jörn M. Horschig jorn at artinis.com
Mon Feb 2 11:47:52 CET 2015

Hi Benedikt and Hweeling,


note that the rounding step is not necessary, because FieldTrip will round
to steps according to your frequency resolution. Actual frequencies of
interest (foi) are subject to the time window of your trials defining the
Raleigh frequency (i.e. frequency resolution). With trials of 2s you have a
frequency resolution of 0.5 Hz, so you can only get estimates at 4 Hz, 4.5
Hz, 5 Hz etc. With the code you sent around, you request frequency at


4.0000    4.7568    5.6568    6.7271


will thus effectively 4, 5, 6 and 7 Hz will be computed (due to the rounding
to the next step of the 0.5 Hz resolution). 


I do not know the length of your trials, but I thought I drop this here to
avoid future questions on ‘why this didn’t work as expected’ ;)





Jörn M. Horschig, Software Engineer

 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 


From: fieldtrip-bounces at science.ru.nl
[mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Benedikt Ehinger
Sent: Monday, February 2, 2015 10:13 AM
To: fieldtrip at science.ru.nl
Subject: Re: [FieldTrip] basic question


Dear Hweeling,
we use the following code:

        % Make 23 logarithmical spaced .25-octave frequencies
        cfg.foi = logspace(log10(4),log10(181),23);
        cfg.foi = round(cfg.foi.*100)./100; % optional rounding to get nice
round 4,8,16...64Hz 
        % The windows should have 3/4 octave smoothing in frequency domain
        cfg.tapsmofrq = (cfg.foi*2^((3/4)/2) - cfg.foi*2^((-3/4)/2)) /2; %
/2 because fieldtrip takes +- tapsmofrq    
        % The timewindow should be so, that for freqs below 16, it results
in n=1
        % Taper used, but for frequencies higher, it should be a constant
        % To get the number of tapers we use:
        cfg.t_ftimwin =

I guess the first line is the answer to your question.
I hope this bit of code helps.

Am 02.02.2015 um 09:24 schrieb Hwee Ling Lee:

Dear all,


I've got a basic question regarding spectral analysis.


In Hipp's neuron paper, it was mentioned that "spectral estimates were
computed across 23 logarithmically scaled frequencies from 4 -  181 Hz (0.25
octave steps)". May I know how can one implement this using Fieldtrip?




Best regards,




fieldtrip mailing list
fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl> 



Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. 
 <http://www.avast.com/> www.avast.com 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150202/0d6741fd/attachment-0002.html>

More information about the fieldtrip mailing list