[FieldTrip] No mtmconvol on data with partial nans

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed May 25 15:40:06 CEST 2016

Hi Stephen,

> 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.

Perhaps you have to :o). This is the only (relatively straightforward) way I can think of at least. If you ensure your trialinfo field to have trial counter prior to doing the partial rejection, you will have the necessary bookkeeping info to glue things together again.

> 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.

I am afraid that this is impossible. Reason: algorithmically ft_specest_mtmconvol is exploiting the fact that convolution in the time domain is equivalent to multiplication in the frequency domain (which is what makes the function fast). The bottom line is that an FFT is done on the whole epoch (followed by a multiplication with the FFT of tapered sine/cosine waves), which, if the data epoch contains NaNs, returns NaNs all over the place.


> Best wishes,
> Stephen
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

More information about the fieldtrip mailing list