Functions | Variables

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

Functions

id chEnd ()
 disp ([freq1 freq2]) elseif unlockInfo.plot.harmoNum
harmonics to plot Zero for
basic frequency for first
harmonic else 
warning ('Problems with the harmonics plotted!!!') end windSz
 warning ('LAG!!!!')%Data eegData
Plotting switch typePlot case
specEpoch 
warning ('Plot only the Oz, O1 and O2 channels')
Plotting switch typePlot case
specEpoch avrage and single
check matched decoded get
decoder from this specData 
data () case 'spectAll'%%Subplot all set(hFig
Higher freq bound for xlabel ('Freq.[Hz]')
Higher freq bound for axis
tight end case specAll Subplot
all 
set (hFig,'Position',[399 49 901 768],'visible','on') fStart
Higher freq bound for ylabel ('Freq.[Hz]') end case 'specOrganizado!!!'set(hFig
 subplot (chEnd-chStart+1, 1, kk) hold off imagesc(tspec(tStart
Bold end pause end case specDcdTgt set (hFig,'Position',[131 49 1355 768])%%Subplot all with decoder targets fStart
 subplot ((chEnd-chStart+1)*2+1, 1,[kk *2-1 kk *2]) imagesc(tspec(tStart
 warning ('Axis in time and freq.shifted!!!') pause end case 'eachAllSpec'%%Plot each/pause for iCh
 title (unlockInfo.main.elecLoc{iCh},'FontWeight','Bold') xlabel('Time[s]')
end case specWindow Plot O2 (2:4) fStart = round(freq1*SpecInfo.hz2spec)
Bold xlabel ('Time[s]')
Higher freq bound Find Oz and O2 strcmpi (unlockInfo.main.elecLoc,'o1') case 'timeWindow'%%Time domain plots for ii
 fprintf ('%i-%i-%i\n',[tStart tEnd ii])%Plot each channel kk=0
Bold ylabel (unlockInfo.main.elecLoc{iCh},'FontWeight','Bold') xlabel('Time[s]')
Bold ylim ([-0.8 0.8]) axis tight end pause end%Decoded targets using the HSD%indx
 imagesc (tspec, fspec, 10 *log((abs(flipud(squeeze((specData.data(:,:, ii)))')))))
 title (sprintf('Ch%i', chs(ii)))
end Figure for function plotSpec (allTgtMeanSpec, allTgtSpecInfo, plotInfo)%%%%%%%%%%%%%%%%Plotting each channels%for Ch

Variables

function hFig
 chStart = unlockInfo.plot.chStart
last index for plotted channels freq1 = unlockInfo.plot.freq1 + 1
Add since Freq vals start in
zero lower bound frequency 
freq2 = unlockInfo.plot.freq2
higher bound frequency if
unlockInfo plot 
harmoNum = = 1
Size of plotted window movWind = unlockInfo.plot.movWind
Size of window moves typePlot = unlockInfo.plot.typePlot
Type of plot lagVal = 0.4
 eegTime = 0:1/unlockInfo.main.Fs:unlockInfo.main.len
 eegDcdTgt = unlockData.dcdTgt
 fspec = specData.fspec
 tspec = specData.tspec
Plotting switch typePlot case
specEpoch avrage and single 
trial
Plotting switch typePlot case
specEpoch avrage and single
check matched decoded get
decoder from this specData 
Position
Plotting switch typePlot case
specEpoch avrage and single
check matched decoded get
decoder from this specData 
visible
Plotting switch typePlot case
specEpoch avrage and single
check matched decoded get
decoder from this specData on 
fStart = round(freq1*SpecInfo.hz2spec)
Lower frequency bound fEnd = round(freq2*SpecInfo.hz2spec)
Higher freq bound for iCh
Higher freq bound for ii
 tEnd = ii + round(windSz*SpecInfo.sec2spec)
converted to time samples rawStart = round((ii/SpecInfo.sec2spec)*unlockInfo.main.Fs)
 rawEnd = round((windSz + ii/SpecInfo.sec2spec)*unlockInfo.main.Fs)
Plot each channel kk = 0
 FontWeight
Bold end subplot((chEnd-chStart+1)*2+1,
1,(chEnd-chStart+1)*2+1) plot(eegTime(rawStart
axis 
tight
end case specWindow Plot O1
end case specWindow Plot Oz
 dcdTgt = unlockData.dcdTgt(indx)
unlockInfo main elecLoc totalTime = unlockInfo.main.szData(1)/unlockInfo.main.Fs
for iChs
 loco

Function Documentation

id chEnd (  )  [virtual]
Plotting switch typePlot case specEpoch avrage and single check matched decoded get decoder from this specData data (  ) 
disp (  ) 
fprintf ( '%i-%i-%i\n'   )  [pure virtual]
imagesc ( tspec  ,
fspec  ,
10 *  log(abs(flipud(squeeze((specData.data(:,:, ii)))'))) 
)
Bold O2 ( 2:4   )  = round(freq1*SpecInfo.hz2spec)
end Figure for function plotSpec ( allTgtMeanSpec  ,
allTgtSpecInfo  ,
plotInfo   
)
Higher freq bound for axis tight end case specAll Subplot all set ( hFig  ,
'Position ,
'visible ,
'on  
)
Bold end pause end case specDcdTgt set ( hFig  ,
'Position  
)
Higher freq bound Find Oz and O2 strcmpi ( unlockInfo.main.  elecLoc,
'o1'   
)
subplot ( (chEnd-chStart+1)*2+  1,
 
)
subplot ( chEnd-chStart 1,
,
kk   
)
title (  ) 
title ( sprintf('Ch%i', chs(ii))   ) 
warning ( 'LAG!!!!'   ) 
Plotting switch typePlot case specEpoch warning ( 'Plot only the  Oz,
O1 and O2 channels'   
)
warning ( 'Axis in time and freq.shifted!!!'   ) 
harmonics to plot Zero for basic frequency for first harmonic else warning ( 'Problems with the harmonics plotted!!!'   ) 
Bold xlabel ( 'Time '  [s]  ) 
Higher freq bound for xlabel ( 'Freq. '  [Hz]  ) 
Bold ylabel ( 'Freq. '  [Hz]  ) 
Bold ylabel (  ) 
Bold ylim (  ) 

Variable Documentation

dcdTgt = unlockData.dcdTgt(indx)
eegDcdTgt = unlockData.dcdTgt
Lower frequency bound fEnd = round(freq2*SpecInfo.hz2spec)
harmonics to plot Zero for basic frequency for first harmonic freq1 = unlockInfo.plot.freq1 + 1
Higher freq bound for Subplot all with decoder targets fStart = round(freq1*SpecInfo.hz2spec)
elseif unlockInfo plot harmoNum = = 1
case diagnostic Diagnostic of location of end of trial flags hFig
Initial value:
 plotUnlockTimeSpec(unlockData,specData,SpecInfo,unlockInfo)
%
%
%
%
%
%

% Params
nChs    = unlockInfo.main.nChs
for iCh
Initial value:
 1:nChs
            subplot(4,2,iCh)
            plot(fspec(fStart:fEnd),squeeze(specData.data(fStart:fEnd,iCh)))
            set(gca,'Ydir','normal')
            title(unlockInfo.main.elecLoc{iCh},'FontWeight','Bold')
            ylabel('Freq. power')
for iChs
Initial value:
 1:nChs
            subplot(nChs,1,iChs)
            plot(endTrials(:,iChs))
            %title(sprintf('Channel %i',iChs))
            ylabel(sprintf('Ch%i',iChs))
        end
        subplot(nChs,1,1)
        title(sprintf('Location of endTrialFlag %i in recording',endTrialFlag),'FontWeight','Bold')
end

% [row,colm] = find()
Higher freq bound for ii
Initial value:
 1:round(movWind*SpecInfo.sec2spec):length(tspec)
            % Start and end times converted to spec samples
            tStart = ii
Plot each channel kk = 0
Type of plot lagVal = 0.4
Initial value:
 sum(sum())x
% 
% % Fi
% for ii = 1:BCIinfo.numChs       %total number of EEG channels
%     figure(1000+ii)
Size of plotted window movWind = unlockInfo.plot.movWind
Higher freq bound Find O1
Higher freq bound for Position
converted to time samples rawStart = round((ii/SpecInfo.sec2spec)*unlockInfo.main.Fs)
Bold end subplot ((chEnd-chStart + 1)*2+1,1,(chEnd-chStart+1)*2+1) plot(eegTime(rawStart axis tight
unlockInfo main elecLoc totalTime = unlockInfo.main.szData(1)/unlockInfo.main.Fs
in seconds time removed before dcd trigger is stamped To assure data is from same trial and no spill over to next trial
Size of window moves typePlot = unlockInfo.plot.typePlot
Plotting switch typePlot case specEpoch avrage and single check matched decoded get decoder from this specData visible