M-point averaging filter
显示 更早的评论
I need to implement a one-dimensional M-point averaging filter for a matrix consisting of values (pixels of an image) between 0 and 1, such that each pixel value is replaced by the equal-weighted average of its (M − 1)/2 neighbors to its left, (M − 1)/2 neighbors to its right, and the pixel value itself.
For instance, for M = 3, it would be like:
y[n,m]= 1/3 (x[n,m−1] + x[n,m] + x[n,m+1])
Please help me out with this. Thank you.
2 个评论
Austin Thai
2021-4-17
编辑:Austin Thai
2021-4-17
Have you checked out the movmean function? You should be able to do
y[n,:]=movmean(x(n,:),3)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 FIR Filter Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!