Beauchamp:ECogAnalysis: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 10: Line 10:
===doLFPvoltage===
===doLFPvoltage===
To analyze the data, the first step is to organize the raw analog traces into a structure relating to the trial number. This is done by the function doLFPvoltage.m. To run analysis on all channels and save the data:
To analyze the data, the first step is to organize the raw analog traces into a structure relating to the trial number. This is done by the function doLFPvoltage.m. To run analysis on all channels and save the data:
Find the directory you wish to save the data in. The best way to do this is to create a new folder for each type of data with the filename (e.g. JPDatafile006 LFPvoltage). Make this the current directory in MATLAB.
Find the directory you wish to save the data in. The best way to do this is to create a new folder for each type of data with the filename (e.g. JPDatafile006 LFPvoltage). Make this the current directory in MATLAB.
type the following into the MATLAB command window:  
type the following into the MATLAB command window:  
<code>for c = 1:<number of channels>
 
doLFPvoltage('<fileName>', c, 'none', 1);
 
c
<code>for c = 1:<number of channels> <br> doLFPvoltage('<fileName>', c, 'none', 1); <br> c <br> end</code>
end</code>
 
The previous step can take many minutes, depending on the number of channels. After it has gone through all channels, be sure to update the path so that these files are accessible to other functions as the analysis continues.
The previous step can take many minutes, depending on the number of channels. After it has gone through all channels, be sure to update the path so that these files are accessible to other functions as the analysis continues.


===doPowerSpectra===
===doPowerSpectra===
The next step of the analysis is to calculate Power Spectra. This is done by doPowerSpectra.
The next step of the analysis is to calculate Power Spectra. This is done by doPowerSpectra.

Revision as of 12:03, 29 July 2010

Processing Data from Ping Sun

Please note, all work with the ECoG data will be done in MATLAB. First, get the data files from Ping. There is one data file per channel, which will be entitled fileName_ch#.mat (e.g. "JPDatafile006_ch15.mat", where JPDatafile006 is fileName and 15 is the channel number in question). In addition, a time stamp file is needed, named fileName_timeStamp.mat (e.g. JPDatafile006_timeStamp.mat). Once these files are uploaded to the server, one must create a setting file in MATLAB called OBJSettingForAll_new.mat. This is done by the generateOBJSetting_new.m. This setting file will encode the information particular to that subject's experiment. Of particular importance to edit is the list of channel names (S.chanDesList), as this changes for every patient. For example, for JPDatafile006, the channel list is:

S.chanDesList = {'G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10', 'G11', 'G12', 'g13', 'G14', 'G15', 'G16', 'G17', 'G18', 'G19', 'G20', 'G21', 'G22', 'G23', 'G24', 'G25', 'G26', 'G27', 'G28', 'G29', 'G30', 'g31', 'G32', 'AF1', 'AF2', 'AF3', 'AF4', 'AIT1', 'AIT2', 'AIT3', 'AIT4', 'MIT1', 'MIT2', 'MIT3', 'MIT4', 'PIT1', 'PIT2', 'PIT3', 'PIT4', 'SPLT1', 'SPLT2', 'SPLT3', 'SPLT4', 'SPLT5', 'SPLT6', 'IPLT1', 'IPLT2', 'IPLT3', 'IPLT4', 'IPLT5', 'IPLT6', 'IPLT7', 'IPLT8', 'EKG1', 'EKG2'};

As long as the same experiment is being done and the equipment doesn't change, nothing else should need to be edited. If it were to change, examine items such as S.images, S.imageNames, S.sampleHZ, etc. Additional comments can be found on the code itself.

LFP Traces and Power Spectra

doLFPvoltage

To analyze the data, the first step is to organize the raw analog traces into a structure relating to the trial number. This is done by the function doLFPvoltage.m. To run analysis on all channels and save the data:

Find the directory you wish to save the data in. The best way to do this is to create a new folder for each type of data with the filename (e.g. JPDatafile006 LFPvoltage). Make this the current directory in MATLAB. type the following into the MATLAB command window:


for c = 1:<number of channels>
doLFPvoltage('<fileName>', c, 'none', 1);
c
end

The previous step can take many minutes, depending on the number of channels. After it has gone through all channels, be sure to update the path so that these files are accessible to other functions as the analysis continues.

doPowerSpectra

The next step of the analysis is to calculate Power Spectra. This is done by doPowerSpectra.