resampledata

Montez, T. t.montez at VUMC.NL
Tue Nov 2 16:54:46 CET 2004


Hi,

Using the code:


addpath E:\Matlab\fieldtrip-0.9.2

% READING THE DATA

hdr =
read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012-4channels.res4');
dat = read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4',
hdr, 1, 4096);

cfg = [];

cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds'
cfg.trl=[1 4096 0]

cfg.channel='MEG'

datatest = preprocessing(cfg)
save ('E:\Matlab\Data\Test\datatest')

% FILTERING AND RESAMPLE

cfg.lpfreq = 13

cfg.resamplefs = 250
datatest_filtered = resampledata(cfg, datatest)

cfg.hpfreq = 8

datatest_filtered = preprocessing(cfg)
save ('E:\Matlab\Data\Test\datatest_filtered')


I get the error:


% ??? Error using ==> preprocessing
% resampling is not supported any more, see RESAMPLEDATA



However it seem to work:


>> datatest_filtered

datatest_filtered =

            cfg: [1x1 struct]
            hdr: [1x1 struct]
          label: {4x1 cell}
          trial: {[4x1639 double]}
         offset: 0
           time: {[1x1639 double]}
        fsample: 250
           grad: [1x1 struct]
    origfsample: 625
     origoffset: 0
       origtime: {[1x4096 double]}

>> cfg

cfg =

       dataset: 'E:\Matlab\Data\A012-4channels.ds'
           trl: [1 4096 0]
       channel: 'MEG'
        lpfreq: 13
    resamplefs: 250
        hpfreq: 8


I am skipping cfg.detrend ='yes' because it is the default.

Should I use cfg.downsample=X; instead of resampledata?

The file resampledata.m does not appear in the reference documentation list
of the FieldTrip webpage.


Thanks,
Teresa Montez



More information about the fieldtrip mailing list