eeg_tools.MA

eeg_tools.MA(signal, window_size, past=True)[source]

Smooth 1d/2darray using a moving average filter along one axis

Parameters:

signal : NumPy 1d/2darray

Input signal of shape M-by-N, where M is the number of signal sources (regions, measuring devices, etc.) and N is the number of observations/measurements. Smoothing is performed along the second axis, i.e., for each source all N observations are smoothed independently of each other using the same moving average window.

window_size : int

Positive scalar defining the size of the window to average over

past : bool

If past = True then only preceding data is used to calculate the moving average. In addition, the rolling standard deviation is also computed. For past = False the input signal is filtered using an MA sliding window that averages across data points between - window_size/2 and window_size/2. If past = False no rolling standard deviation is calculated.

Returns:

If past == True

ma_signal : NumPy 1d/2darray

Moving average of signal (same shape as input)

sd_signal : NumPy 1d/2darray

Rolling Standard deviation of signal (same shape as input)

If past == False

ma_signal : NumPy 1d/2darray

Smoothed signal (same shape as input)

See also

None

Notes

None