blCorrCs.m 548 B

1234567891011121314
  1. function [outData] = blCorrCs(inData,timeWinStart,timeWinEnd)
  2. %BLCORR performs baseline correction using the given time window
  3. % input stream is divided into trials and average voltage within the set
  4. % time window is calculated for each trial. Afterwards this average
  5. % activity is subtracted from the whole trial to normalise activity in
  6. % set time window to 0.
  7. % calculate average voltage within time window
  8. avV = mean(inData(timeWinStart:timeWinEnd,:));
  9. % subtract average voltage from trials
  10. outData = inData-avV;
  11. end