[FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert)

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Tue Apr 29 11:17:20 CEST 2014


Hi Elisa,

please note the following things:
1) Using an up-to-date version is always good (in a more recent FT 
version, you are forced to specify cfg.detrend when applying 
ft_resampledata).
2) Find out whether the version you are using detrending is applied by 
default (it used to be, but we changed this default. If you want to know 
why, check the help of ft_resampledata in one of the newer versions).
3) In ft_resampledata, we now suggest to apply demeaning before 
resampling. You can always add back the mean after resampling (given 
that you saved it beforehands)

Best,
Jörn



On 4/28/2014 5:45 PM, Elisa Carrus wrote:
> Ah, that's it! I should have set demean to 'no'.
>
> Thanks!
>
> On 28/04/2014 16:32, Julian Keil wrote:
>> Hi Elisa,
>>
>> did you check your .cfg of the output for demean and detrend?
>> Depending on the FT-Version you use, the defaults may be to demean 
>> and detrend your data which might center the data around 0.
>>
>> See the help of your fr_resampledata-function for more info.
>>
>> Best,
>>
>> Julian
>>
>>
>> ********************
>> *Dr. Julian Keil*
>> *
>> *
>> AG Multisensorische Integration
>> Psychiatrische Universitätsklinik
>> der Charité im St. Hedwig-Krankenhaus
>> Große Hamburger Straße 5-11, Raum E 307
>> 10115 Berlin
>>
>> Telefon: +49-30-2311-1879
>> Fax:        +49-30-2311-2209
>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration
>>
>> Am 28.04.2014 um 16:52 schrieb Elisa Carrus:
>>
>>> Hi FT users,
>>>
>>> I am having some problems with resampling (downsampling) the data.
>>>
>>> Here is what I'm doing:
>>>
>>> I preprocess the continuous data to obtain band-pass filtered signal 
>>> in several frequencies (4-8,8-12,12-30, etc), also taking the abs 
>>> value of the Hilbert transform. The absolute value of the Hilbert is 
>>> ultimately what I need.
>>>
>>> I have used the following code:
>>> /
>>> //cfg = [];//
>>> //cfg.channel = 'MEG';//
>>> //cfg.demean = 'yes';//
>>> //cfg.detrend = 'yes';//
>>> //cfg.lpfilter = 'yes';//
>>> //cfg.hilbert = 'abs';//
>>> //cfg.hpfilter = 'yes';//
>>> //cfg.hilbert = 'abs';//
>>> //cfg.lpfreq = 30;//
>>> //cfg.hpfreq = 12;//
>>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';//
>>> //cfg.continuous = 'yes';//
>>> //beta = ft_preprocessing(cfg);//
>>> /
>>> After this, I epoch the data as follows
>>>
>>> /cfg = [];//
>>> //cfg.trl = trl2; % this is a trial definition previously created//
>>> //beta_ep = ft_redefinetrial(cfg,beta);/
>>>
>>> and then I downsample as follows:
>>>
>>> /cfg = [];//
>>> //cfg.resamplefs = 500;//
>>> //beta_epdw = ft_resampledata(cfg, beta_ep)/
>>>
>>> I don't encounter any errors, but the strange thing is that the data 
>>> looks fine up to before I downsample (i.e.g. if I plot one trial, 
>>> it's all positive values, as I would expect from the abs of the 
>>> Hilbert), but if I plot the downsampled data, the signal has both 
>>> negative and positive values.
>>>
>>> Is there something I'm missing?
>>>
>>> Thanks a lot if you can help,
>>>
>>> Elisa
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands




More information about the fieldtrip mailing list