demean.m 495 B

1234567891011121314
  1. function [outData] = demean(inData)
  2. %DEMEAN 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);
  9. % subtract average voltage from trials
  10. outData = inData-avV;
  11. end