[FieldTrip] No mtmconvol on data with partial nans

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Thu May 26 10:58:16 CEST 2016


Dear Tzvetomir,

Thank you so much! That is very helpful.

And I concur fully with the praise of FT, and the mailinglist :-)

Best wishes,
Stephen


On 26 May 2016 at 08:02, Tzvetomir <tzvetan at ustc.edu.cn> wrote:

> Dear Stephen,
>
> you could also apply the nanconv() function of B.Kraus, available on
> Matlab's fileexchange.
>
> (http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv)
>
> I'm doing my own wavelet processing for the reason that part of my epochs
> are filled with nan's due to experimental design.
>
> But fieldtrip website remains a huge source of infos, tips and solutions
> where to look for :)
>
> all the best,
>
> Tzvetomir
> On 2016-05-25 10:08 PM, Stephen Whitmarsh wrote:
>
> As a follow-up: I guess the best solution in the case would then be to
> make my TFR, and replace those values with nans based on the sample number
> from the time-series artifact detection.
>
> Cheers,
> Stephen
>
> On 25 May 2016 at 15:58, Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
> wrote:
>
>> Hi Jim!
>>
>> Thanks. Ofcourse, that's the problem. However, method = 'wavelet', and
>> method = 'tfr' give the same problem. I'm afraid I'll end up writing my own
>> code, cutting up data and using an FFT :-/
>>
>> Thank again,
>>
>> Stephen
>>
>> On 25 May 2016 at 15:34, Herring, J.D. (Jim) < <j.herring at donders.ru.nl>
>> j.herring at donders.ru.nl> wrote:
>>
>>> Hi Stephen,
>>>
>>> As far as I know this is expected as mtmconvol is actually multiplying
>>> the fft of the entire trial with the fft of your tapered windows. Perhaps
>>> it will work of you use one of the methods that actually uses convolution
>>> in the time domain rather than multiplication in the frequency domain.
>>>
>>> Best,
>>>
>>> Jim
>>>
>>>
>>>
>>> > On 25 May 2016, at 15:29, Stephen Whitmarsh <
>>> stephen.whitmarsh at gmail.com> wrote:
>>> >
>>> > Hi FieldTrippers,
>>> >
>>> > I hope someone can help me with the following.
>>> >
>>> > My problem is that I like to maintain my original rpt/chan/time/freq
>>> size after artefact rejection based on the time series data, i.e. to have
>>> the same dimensions of the TFR as if I did not reject data. This is for
>>> reasons of bookkeeping between different types of channels that are
>>> processed differently throughout my analysis.
>>> >
>>> > What works well is to detect artifacts in the data and replace those
>>> intervals with nans using ft_rejectartifact, with cfg.reject = 'nan'. So
>>> far this is perfect for the approach I had in mind.
>>> >
>>> > However, ft_freqanalysis (method = 'mtmconvol') outputs whole trials
>>> as nans whenever a (small) period has nans. What I would need - and in fact
>>> expect - is that only those time/frequency windows that have (one or more)
>>> nan values will output nan, while the rest should merrily go round giving
>>> power values. After all, the data is there.
>>> >
>>> > It is unclear to me whether this is expected behaviour or not. I might
>>> be making a mistake but some simple tests replicated this behaviour.
>>> >
>>> > Is there a solution that still allows me to end up with a
>>> rpt/chan/time/freq representation of the same size as when i would not have
>>> rejected artifacts?
>>> >
>>> > The only other FieldTrip-like option I can think of is to use
>>> ft_rejectartifact with method = 'partial', do the freqanalysis on trial
>>> parts, and somehow glue the separate trial parts together again afterwards.
>>> But I really don't want to go in that direction.
>>> >
>>> > In the end I'm afraid I don't understand the core of
>>> ft_specest_mtmconvol enough to see where I could hack it. I hope some of
>>> you might be able to help.
>>> >
>>> > Best wishes,
>>> > Stephen
>>> >
>>> >
>>> > _______________________________________________
>>> > 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
>>>
>>
>>
>
>
> _______________________________________________
> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
> --
> __________________________________________________
>
> Tzvetomir Tzvetanov, PhD
> (赐为)
>
> Associate Professor
> Vision Research Laboratory, School of Life Sciences,
> CAS Key Laboratory of Brain Function and Disease,
> University of Science & Technology of China
> Hefei, Anhui 230027, P.R.Chinahttp://vision.ustc.edu.cn/
> Email: tzvetan at ustc.edu.cn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160526/db844226/attachment-0002.html>


More information about the fieldtrip mailing list