MOVAV Perform a moving average of data indexed by xvals. Supports use of a moving non-rectangular window. Can be used to resample a data matrix.

Usage: >> [outdata,outx] = movav(data,xvals,xwidth,xadv,firstx,lastx,xwin);

Inputs:
data   
input data (chans,frames)
xvals   
index for each data frame (column) {def|0 -> 1:frames} Note that default is fastest, assumes equal x-spacing.
xwidth   
smoothing-window width in xvals {def|0 -> (lastx-firstx)/4}
xadv   
xvals step size {default|0 -> 1} Note that to reduce yyy frames to xxx, use yyy/(xxx+2)
firstx   
low xval of first averaging window {def|0 -> low xvals}
lastx   
high xval of last averaging window {def|0 -> high xvals}
xwin   
vector of window values {def|0 -> ones() = square window} May be long; linear interp. is NOT used between values. An example is >> gauss(1001,2) -> [0.018 ... 1.0 ... 0.018]

Outputs:
outdata   
smoothed data (chans,
outx   
xval midpoints of successive output data windows

Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 10-25-97

See the matlab file movav.m (may require other functions)

Back to functions