1.移动平均法(邻域平均值滤波器)
One simple form of moving average is to calculate the average of adjacent measurements at a certain position. In a one-dimensional series of measurements a[1:N], for example, the moving average at a[n] can be calculated as a[n] = (a[n-1] + a[n] + a[n+1]) / 3, for example. If you go through all of your measurements, you're done. In this simple example, our averaging window has size 3. You can also use windows of different sizes, depending on how much smoothing you want
Use an algorithm based on convolution to make the calculation easier. The advantage of using convolution is that you can choose different kinds of averages, like weighted averages, by simply changing the window.
参考下面这个滤波器的实现:
bool SmoothingTrajectoryFilter::applyFilter(robot_trajectory::RobotTrajectory& rob_trajectory) const
{
/** 总体思路:
* - 使用相邻的num_coef_个数据,来生成第i个数据过滤后的值 //num_coef_为奇数, k=num_coef_/2; i-k,...,i,...,i+k

本文介绍了移动平均滤波器,通过邻域平均值计算提高数据平滑,以及Savitzky-Golay滤波器,一种基于最小二乘的多项式拟合方法。两种技术对比,展示了在信号处理中如何减少噪声并保持信号特性。
最低0.47元/天 解锁文章


被折叠的 条评论
为什么被折叠?



