Functions | |
| epoch s samples | epochDcdTgt (:, iIndx) |
| window of decoded targets | warning ('MUST DOUBLE CHECK SAMPLES ALIGNED') end%Extra data left |
| window of decoded targets usefull if problems aligning data if | epochIndx (iIndx)< unlockInfo.main.szData(1) leftOvers.eegData |
Variables | |
| function [unlockEpochs, unlockInfo, dcdTgt, epochDcdTgt] | |
| eegTime = 0:1/unlockInfo.main.Fs:unlockInfo.main.len | |
| eegEndTri = unlockData.endTrl | |
| eegDcdTgt = unlockData.dcdTgt | |
| fspec = specData.fspec | |
| tspec = specData.tspec | |
| Params | Fs = unlockInfo.main.Fs |
| nChs = unlockInfo.main.nChs | |
| nTrials = unlockInfo.main.nTrials | |
| expTgts = unlockInfo.decoder.stimFreq | |
| stimLen = unlockInfo.behav.stimLen | |
| restLen = unlockInfo.behav.restLen | |
| trialLen = (stimLen + restLen)*Fs | |
| trial length in samples unlockInfo epoch | trialSampLen = trialLen |
| do this here since later is it changed Extracting all epochs For triggered epochs if unlockInfo main triggeredData | epochIndx = (find(eegEndTri)) |
| nEpochs = numel(epochIndx) | |
| eegAllEpochs = nan(trialLen,nChs,nEpochs) | |
| for | iIndx |
| leftOvers | dcdTgt = eegDcdTgt(epochIndx(iIndx):end) |
| else leftOvers | eegData = [] |
| end When not all trials have an end Trigger else if unlockInfo epoch fromEnd Start getting epochs from last trigger Number epochs | indx = find(eegEndTri) |
| samples where trial labeled as ended | iEpoch = 0 |
| epoch s samples epochDcdTgt | ( | : | , | |
| iIndx | ||||
| ) |
| window of decoded targets warning | ( | 'MUST DOUBLE CHECK SAMPLES ALIGNED' | ) |
| eegAllEpochs = nan(trialLen,nChs,nEpochs) |
| end Epoch s Spectrograms if unlockInfo epoch doSpecgram eegData = [] |
| eegDcdTgt = unlockData.dcdTgt |
| eegEndTri = unlockData.endTrl |
| do this here since later is it changed Extracting all epochs For triggered epochs if unlockInfo main triggeredData epochIndx = (find(eegEndTri)) |
| expTgts = unlockInfo.decoder.stimFreq |
| end end Raw time Spectrogram if unlockInfo main doSpecgram Set default spectrogram params SpecInfo Fs = unlockInfo.main.Fs |
| end Spec analysis transformation factors SpectInfo fspec = specData.fspec |
| function[unlockEpochs, unlockInfo, dcdTgt, epochDcdTgt] |
| samples where trial labeled as ended iEpoch = 0 |
| for iIndx |
| end When not all trials have an end Trigger else if unlockInfo epoch fromEnd Start getting epochs from last trigger Number epochs indx = find(eegEndTri) |
| trial length in samples unlockInfo epoch trialSampLen = trialLen |
| end Spec analysis transformation factors SpecInfo tspec = specData.tspec |
1.7.1