smoothsignal

[xSmoothed] = smoothsignal(x, WindowSize, method, dispout)

Description

Smooth input data using a window function

Inputs

x
Input data
WindowSize=33;
Window size (number of adjacent elements)that is used for smoothing, should be equal or larger than 3
method=’moveavg’;
Smoothing method
‘moveavg’: moving average
‘lowpass’: Low-Pass filter
‘savgol’: Savitzky-Golay filter
‘butter’: Butterworth filter
dispout=’no’;
Define to display outputs or not (‘yes’: display, ‘no’: not display)

Outputs

xSmoothed
Smoothed data

Examples

x(:,1)=sin(linspace(0,6*pi,200))+rand(1,200);
[xSmoothed]=smoothsignal(x,33,'moveavg','yes');

References