Functions | Variables

unlock/analysis/andres/Code/unlockMain.m File Reference

Functions

Data recording system else Fixed fileName (how it should be always)%session
 fprintf ('Just loaded the file%s!!!\n', fileName)%%Filter data[unlockFiltData
 disp ('Just filtered the data!!!')%%Epoch data using the endTrialFlag if unlockInfo.epoch.doEpochs[unlockEpochs
Plotting decodeTrial triggers
if unlockInfo plot doPlot 
plotDcdTrigSamp (dcdTgt, epochDcdTgt, unlockInfo) end%%Epoch spectrum if unlockInfo.epoch.doSpectrum SpectInfo.Fs
 disp ('Just got the spectrum!!!') spectData.tspec
 disp ('Just got the spectrogram!!!')%%Plot spectrogram if unlockInfo.plot.doPlot unlockInfo.plot.typePlot
Window size text if strcmp (unlockInfo.plot.typePlot,'spectAll') lenWindow
elseif isfield (unlockInfo.analysis,'specInfo')%size of window for spectrogram lenWindow
else warning ('No harmonics!!') end%Save saveFilename

Variables

function onlinePerf
FileName if nargin
unlockInfo main parentFile = 'C:\Users\Administrator\Documents\BU\Speechlab\Unlock\Data\raw\20131217-mobilab\collector_mobilab_14_15_3minutes.txt'
 fileName = 'C:\Users\Administrator\Documents\BU\Speechlab\Unlock\Data\raw\20140106-mobilab\mobilab-single-ssvep-diag-15hz_1389043288.txt'
unlockInfo main systemID = 'mobilab'
 rawName = 'collector_mobilab_12_13_3minutes'
Set Unlock Params unlockInfo = setUnlockParams(unlockInfo)
Load file [unlockData, unlockInfo] = loadUnlockFile(unlockInfo)
unlockData data = unlockFiltData
 dcdTgt
 epochDcdTgt = getUnlockEpochs(unlockData,unlockInfo)
SpectInfo nChs = unlockInfo.main.nChs
SpectInfo freqBand = unlockInfo.main.freqBand
SpectInfo nEpochs = unlockInfo.epoch.nEpochs
SpectInfo doEpochs = unlockInfo.epoch.doEpochs
SpectInfo nOdd = unlockInfo.epoch.nOdd
 SpecParams = SpectInfo
 SpectInfo = setDefaultSpecParams(SpectInfo) SpecParams
SpectInfo params = SpecInfo.params
 eegData = unlockEpochs
unlockInfo epoch spect = getUnlockSpectrum(eegData,SpectInfo) SpectInfo
Extracting epoch s spectrum
features 
featData = spectData
Decode based on Oz dcdData = extractFeat(featData,unlockInfo) spectData
unlockInfo epoch spec = getUnlockSpecgram(eegData,SpecInfo) SpecInfo
end end Raw time Spectrum if
unlockInfo main doSpectrum
SpectInfo 
Fs = unlockInfo.main.Fs
Need a setDefaultParams
function Get 
spectrum [spectData, SpectInfo] = getUnlockSpectrum(eegData,SpectInfo)
unlockInfo analysis spectInfo = SpectInfo
Plot spectrum if unlockInfo
plot doPlot unlockInfo plot 
typePlot = 'spectAll'
 hFig = plotUnlockTimeSpec(unlockData,spectData,SpectInfo,unlockInfo)
 SpecInfo = setDefaultSpecParams(SpecInfo)
Get spectrogram [specData, SpecInfo] = getUnlockSpecgram(eegData,SpecInfo)
unlockInfo analysis specInfo = SpecInfo
end end Save spectrum
spectrogram figure if
unlockInfo main saveFig 
figName = unlockInfo.main.parentFile(strfind(lower(unlockInfo.main.parentFile),'hz')-2:end-4)
end Harmonics text if
unlockInfo plot 
harmoNum = = 0

Function Documentation

disp ( 'Just filtered the data!!!'   ) 
disp ( 'Just got the spectrum!!!'   ) 
disp ( 'Just got the spectrogram!!!'   ) 
Data recording system else Fixed fileName ( how it should be  always  ) 
fprintf ( 'Just loaded the file%s!!!\n'  ,
fileName   
)
elseif isfield ( unlockInfo.  analysis,
'specInfo  
)
Plotting decodeTrial triggers if unlockInfo plot doPlot plotDcdTrigSamp ( dcdTgt  ,
epochDcdTgt  ,
unlockInfo   
)
Window size text if strcmp ( unlockInfo.plot.  typePlot,
'spectAll'   
)
else warning ( 'No harmonics!!'   ) 

Variable Documentation

unlockData data = unlockFiltData
Decode based on Oz dcdData = extractFeat(featData,unlockInfo) spectData
dcdTgt
eegData = unlockEpochs
epochDcdTgt = getUnlockEpochs(unlockData,unlockInfo)
Extracting epoch s spectrum features featData = spectData
end end Save spectrum spectrogram figure if unlockInfo main saveFig figName = unlockInfo.main.parentFile(strfind(lower(unlockInfo.main.parentFile),'hz')-2:end-4)
Load file[unlockData, unlockInfo] = loadUnlockFile(unlockInfo)
unlockInfo main fileName = 'C:\Users\Administrator\Documents\BU\Speechlab\Unlock\Data\raw\20140106-mobilab\mobilab-single-ssvep-diag-15hz_1389043288.txt'
end end Raw time Spectrogram if unlockInfo main doSpecgram Set default spectrogram params SpecInfo Fs = unlockInfo.main.Fs
elseif unlockInfo plot harmoNum = = 0
hFig = plotUnlockTimeSpec(unlockData,spectData,SpectInfo,unlockInfo)
FileName if nargin
Initial value:
= 0                              % Custom fileName
    %unlockInfo.main.parentFile  = 'C:\Users\Administrator\Documents\BU\Speechlab\Unlock\Data\raw\20131217-mobilab\collector_mobilab_12_13_3minutes.txt'
Online decoder performance onlinePerf
Initial value:
 unlockMain(fileName)
% function onlinePerf = unlockMain(fileName)
%
% Main function for analysis of unlock recorded data
%
%
%
%
% Andres. V1. 18 Dec 2013
% Last modified 07 Jan 2014

%% Set folders and paths
unlockInfo.main.dirs = initUnlockDirs
end unlockInfo main parentFile = 'C:\Users\Administrator\Documents\BU\Speechlab\Unlock\Data\raw\20131217-mobilab\collector_mobilab_14_15_3minutes.txt'
rawName = 'collector_mobilab_12_13_3minutes'
unlockInfo epoch spec = getUnlockSpecgram(eegData,SpecInfo) SpecInfo
Need a setDefaultParams function SpecInfo = setDefaultSpecParams(SpecInfo)
unlockInfo epoch spect = getUnlockSpectrum(eegData,SpectInfo) SpectInfo
SpectInfo = setDefaultSpecParams(SpectInfo) SpecParams
Get spectrogram[specData, SpecInfo] = getUnlockSpecgram(eegData,SpecInfo)
Need a setDefaultParams function Get spectrum[spectData, SpectInfo] = getUnlockSpectrum(eegData,SpectInfo)
unlockInfo main systemID = 'mobilab'
Plot spectrum if unlockInfo plot doPlot unlockInfo plot typePlot = 'spectAll'
unlockInfo = setUnlockParams(unlockInfo)