Reference
HowToGuides
Manuals
LabAlumni
DataAnalysis
Advice for...
Admin
This is an old revision of the document!
Note: as of Jan/2014, make sure you use the APX_devel branch on GitHub to get the latest version. At some point this will be merged back into master.
To load data:
channels_to_load = [10:13]; % specify channels in the APX data file to load data = AMPX_loadData('R041-2013-08-06.dat',channels_to_load,20); % note decimation factor of 20
To convert into a fieldtrip data structure:
data_ft = AMPX_makeft(data);
Make trials (note, this will require an event file to have been created previously, Eric to update explanation of this):
%% trl cfg = []; cfg.trialfun = 'ft_trialfun_AMPXsquareTrack'; cfg.trialdef.hdr = data.hdr; cfg.trialdef.pre = 2; cfg.trialdef.post = 3; cfg.trialdef.eventtype = 'nose_in_nofires'; % could be 'nosepoke', 'reward', 'cue' [trl, event] = ft_trialfun_AMPXsquareTrack(cfg); cfg.trl = trl; data_trl = ft_redefinetrial(cfg,data_ft);
Now you can do the usual ft analysis stuff:
%% cfg = []; % start with empty cfg cfg.output = 'pow'; cfg.channel = '10'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 1:1:100; % frequencies of interest cfg.t_ftimwin = ones(size(cfg.foi)).*0.5; % window size: fixed at 0.5s cfg.toi = -1.5:0.05:2.5; % times of interest