Beauchamp:ECogAnalysisv2: Difference between revisions
No edit summary |
No edit summary |
||
Line 64: | Line 64: | ||
Creates a matrix called 'traces' and saves each channel data to one row of this matrix. Audio and diode signals are saved to the last two rows of the matrix. | Creates a matrix called 'traces' and saves each channel data to one row of this matrix. Audio and diode signals are saved to the last two rows of the matrix. | ||
*Common Average Re-referencing (CAR) (Optional): | |||
CAR calculates average over all channels (averages rows in 'traces' matrix) at each time point and subtracts that average from each individual channel. | |||
*Grouping trials: | |||
Trial onset, trial end, trial type and button press press information are saved in a time stamp file. | Trial onset, trial end, trial type and button press press information are saved in a time stamp file. | ||
e.g. /Volumes/data/UT/YAO/eCog/YAODatafile021_timeStamp.mat | e.g. /Volumes/data/UT/YAO/eCog/YAODatafile021_timeStamp.mat | ||
Time stamp file includes eventData file. In eventData file, 4096, 4097, 4098 etc. denotes different stimuli while the following 128 or 129 denotes the behavioral response of the subject to the stimulus. For each trial we assign a number that denotes the stimulus type and response combination | |||
Time stamp file includes 'eventData' file. In eventData file, 4096, 4097, 4098 etc. denotes different stimuli while the following 128 or 129 denotes the behavioral response of the subject to the stimulus. For each trial we assign a number that denotes the stimulus type and response combination. Then we save these number in a separate matfile called 'imageIndex'. | |||
*Epoching the signal: | *Epoching the signal: | ||
Time stamp file also includes eventTime file. In eventTime file trial onset, trial end and button press press times (in terms of seconds) with respect to the start time of the session is found. Start time of each trial is earlier than the start time of the actual stimulus (appearance of sound or video of the presentation screen). We epoch the trials starting from 1 second before and until 3 or 4 seconds after the audio or video onset. For auditory only trials we use the | Time stamp file also includes eventTime file. In eventTime file trial onset, trial end and button press press times (in terms of seconds) with respect to the start time of the session is found. Start time of each trial is earlier than the start time of the actual stimulus (appearance of sound or video of the presentation screen). We epoch the trials starting from 1 second before and until 3 or 4 seconds after the audio or video onset. For auditory only trials we use the |
Revision as of 10:19, 16 May 2014
To search for things on the wiki, use Google's site search feature. For instance, to find an Experiment Sheet, type
site:openwetware.org/wiki/Beauchamp ExperimentSheet
The first step is to define the "S" data structure. To do this we run generateOBJSetting.m script.
An example can be found in: /Volumes/data/lab/eCog-mfiles
Here are the components of the S data structure:
fileName: {'YAODatafile017' 'YAODatafile018'} chanDesList: {1x68 cell} images: 8 imageNames: {6x1 cell} kStimOn: 80 kImageMin: 4096 kResponse_leftbutton: 128 kResponse_rightbutton: 129 Fs: 2000 startTime: 0 sampleTime: 0.5000 trialTimeCourse: [1x8000 double]
Here are what the elements of the data structure represent:
- filename: Name of the raw data file. Each session of an experiment is recorded in a separate datafile.
- chanDesList: List of electrodes written according to the montage.
- images: Number of different stimuli (conditions) presented in this experiment.
- kStimOn: Stimulus onset. The onset of each presented stimulus is registered as an event. Stimulus onset events are always denoted by 80.
- kImageMin: Denotes the first stimulus. Every stimulus has a code number but the code number for the first stimulus is always 4096. 4097 denotes the second stimulus, 4098 denotes the third stimulus etc.
- kResponse_leftbutton: Left mouse button presses are registered as 128.
- kResponse_rightbutton: Left mouse button presses are registered as 129.
- Fs: Sampling frequency. The data is recorded at 2000 Hz.
- startTime: Start time of the recording.
- sampleTime: Time between each sample point (1/Fs) in milliseconds.
- trialTimeCourse: Time course of trial. e.g. -1:1/S.Fs:4 (A 5 second trial that consists of 8000 sample points).
- Data files:
Information about data files (i.e which experiment session is recorded under which data file) and electrode montage can be found in the physiology file of each subject. e.g. /Volumes/data/UT/YAO/YAOPhysiology.docx
Data files of each subject are found on the server: e.g. /Volumes/data/UT/YAO/eCog/
Data for each channel is recorded in a separate file: e.g. YAODatafile021_ch90.mat ( Data file 21, channel 90)
Audio signal (stimulus sound) is always saved in Channel 129.
A photo diode that is attached on the screen of the presentation computer during the presentation of the stimuli. It detects whenever a new video stimulus appears on the screen. This diode signal is always saved in Channel 130.
The next step is to load the appropriate data files and adjust the epochs based on the trial onset times. To do this we run the Preprocessing1.m script.
An example can be found in: /Volumes/data/lab/eCog-mfiles
This script contains the following steps:
- Loading data files:
Creates a matrix called 'traces' and saves each channel data to one row of this matrix. Audio and diode signals are saved to the last two rows of the matrix.
- Common Average Re-referencing (CAR) (Optional):
CAR calculates average over all channels (averages rows in 'traces' matrix) at each time point and subtracts that average from each individual channel.
- Grouping trials:
Trial onset, trial end, trial type and button press press information are saved in a time stamp file. e.g. /Volumes/data/UT/YAO/eCog/YAODatafile021_timeStamp.mat
Time stamp file includes 'eventData' file. In eventData file, 4096, 4097, 4098 etc. denotes different stimuli while the following 128 or 129 denotes the behavioral response of the subject to the stimulus. For each trial we assign a number that denotes the stimulus type and response combination. Then we save these number in a separate matfile called 'imageIndex'.
- Epoching the signal:
Time stamp file also includes eventTime file. In eventTime file trial onset, trial end and button press press times (in terms of seconds) with respect to the start time of the session is found. Start time of each trial is earlier than the start time of the actual stimulus (appearance of sound or video of the presentation screen). We epoch the trials starting from 1 second before and until 3 or 4 seconds after the audio or video onset. For auditory only trials we use the