slidingavg

One-dimensional sliding-window arithmetic average of a signal.
7.9K 次下载
更新时间 2016/4/11

查看许可证

This function implements a one-dimensional smoothing filter, applying a sliding window to a numerical sequence. Such filtering replaces the center value in the window with the arithmetic mean computed among the points within the window.
When the sliding window is exceeding the lower or upper boundaries of the input vector, the average is computed only among the available points.

This function can be conveniently employed for smoothing one-dimensional noisy signals and its results are very similar to other "quick and dirty" smoothing techniques.
When compared to a standard first-order low-pass filter, it is important to note that the averaging performed here does not only involve the past history of the signal but the future samples as well.

I underline that the filtering by the present routine resembles what the median filter performs (see medfilt1()), although there is no "artifact" or transient responses at the beginning and the end of the signal, due to the presence of a non-zero offset in the data (see the screenshot).

引用格式

Michele Giugliano (2024). slidingavg (https://www.mathworks.com/matlabcentral/fileexchange/1967-slidingavg), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R12.1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Digital Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

BSD License update.