Skip to content

wvAverage

  wvAverage performs waveform averaging about a set of trigger times

  wvAverage is also called for spike-triggered averaging by the sigTOOL
  Spike Train Toolkit

  wvAverage provides both mean and median averaging and also returns error
  estimates: standard deviations for the mean or, with the Statistics
  Toolbox installed, 25/75th percentiles for the median

  Exampe:
  result=wvAverage(fhandle, field1, value1, field2, value2....)

  returns a sigTOOLResultData object. If no output is requested the result
  will be plotted.

  Valid field/value pairs are:
      'trigger'               one or more valid trigger channel numbers
                                 (scalar or vector)
      'sources'               one or more valid source channel numbers
                                 (scalar or vector)
      'start'                 the start time for data processing
                                 (scalar, in seconds)
      'stop'                  the stop time for data processing
                                 (scalar, in seconds)
      'duration'              the duration of the sweep (pre+post time)
                                 (scalar, in seconds)
      'pretime'               the pre-time
                                 (scalar, as a percentage of the duration)
      'sweepsperaverage'      the number of triggers to use for each average.
                              Set to zero to use all available triggers.
                              If sweepsperaverage is non-zero and less than
                              the total number of triggers available,
                              multiple averages will be returned each using
                              sweepsperaverage triggers
                                  (scalar)
      'overlap'               the percentage overlap for multiple triggers.
                              If overalp is non-zero, multiple averages will
                              be calculated using overlapping data. For example,
                              with sweepsperaverage=20 and overlap=50,
                              averages will be calculated for sweeps 1-20,
                              11-30, 21-40 etc.
                                  (scalar)
      'retrigger'             Logical flag. If retrigger is true, all
                              triggers will be used (typically e.g for
                              spike-triggered averaging). If false, triggers
                              will be debounced (see debounce.m).
                                  (Logical. default==false)
      'dcflag'                Logical flag. If true, the average value in the
                              pre-stimulus period (the values at t<0) will be
                              subtracted for each average. If no pre-stimulus
                              period is defined (i.e. pretrigger==0), the
                              value if the first bin in the result will
                              be subtracted for each average.
                                  (Logical. default==false)
      'method'                the averaging method. A string, either 'mean'
                              or 'median'
                                  (Default=='mean')
      'errtype'               the error type. A string, either 'std' for
                              standard deviation or 'prctile' for percentiles.
                                  (Default=='std')
      percentiles             a two-element vector giving the required
                              percentiles if errtype=='prctile'.
                                  (Default [25 75]);

  Toolboxes Required: For percentiles, the MATLAB prctile function is
                        needed (e.g. Stats Toolbox).

  -------------------------------------------------------------------------
  Author: Malcolm Lidierth 11/07
  Copyright © The Author & King's College London 2007-
  -------------------------------------------------------------------------

  Revisions:
        12.10.08    Fix odata
        27.09.09    Add test for shorter sampling time on source compared
                    to trigger channel
        09.10.09    Add pairwise trigger/source averaging