[FieldTrip] Resampling error + General question on resampling vs single precision

Yasir Çatal catalyasir at gmail.com
Thu Feb 2 18:56:58 CET 2023


Hello FieldTrip community,

When I run ft_resampledata, I get the following error:

Error using signal.internal.resample.nonUniformParser>getSamples
> The number of elements of Tx must match the number of rows of X when X is
> a matrix
> Error in signal.internal.resample.nonUniformParser (line 23)
> [x, tx] = getSamples(xIn,tx1,Dim);
> Error in resample>nonUniformResample (line 268)
> [x, tx, tGrid, fs, p, q] =
> signal.internal.resample.nonUniformParser(isDimValSet,Dim,m,xIn,varargin{:});
> Error in resample (line 214)
>             nonUniformResample(isDimValSet,Dim, m, method1, dimIn, xIn, ...
> Error in ft_resampledata (line 253)
>         newdat = transpose(resample(transpose(olddat),fsres,fsorig));


I searched the mailing list and found a similar error from another
user: [FieldTrip]
Errors with downsampling and artifact rejection (ru.nl)
<https://mailman.science.ru.nl/pipermail/fieldtrip/2020-June/040130.html>

The solution for him was using an integer division of the original sampling
rate (1000 -> 250 or 200). However, my data has a sampling rate of
508.6275 (HCP-MEG data, rmegpreproc output) which I'm afraid doesn't have a
nice integer division. I tried with a couple of different cfg.resamplerefs
but none of them worked.

My second question is a more general one. For memory-efficient processing,
which one is a better option: using single data type or downsampling but
keeping it double precision.

Thanks,
Yasir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230202/967cca89/attachment.htm>


More information about the fieldtrip mailing list