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

Elisa Carrus elisa at csl.psychol.cam.ac.uk
Wed Apr 30 12:38:01 CEST 2014


Thanks Jörn,

Yes, I have the latest version and I am forced to specify the detrend 
option. However, as for cfg.demean, I had done it when reading the 
continuous data with ft_preprocessing. Would you suggest doing it again 
then, when resampling the epoched data? It's because when I resample 
with 'cfg.demean = yes', my Hilbert values are centred around zero, i.e. 
I have both positive and negative values.

Thanks,
Elisa


On 29/04/2014 10:17, "Jörn M. Horschig" wrote:
> 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
>
>




More information about the fieldtrip mailing list