How can I take moving average with different window shapes?
8 次查看(过去 30 天)
显示 更早的评论
I need to take the sliding window average of a signal/single column matrix using different shapes of moving window (rectangle, blackman harris, etc). So far I can only find ways to take the moving average with a rectangular window (simply taking the moving average of the numbers with a given window size). How can I take the averages through different window shapes?
Thanks
0 个评论
采纳的回答
Rik
2019-7-26
You can use the conv function to calculate the convolution of your window with your data. Just make sure your window has a sum of 1.
You might need to pay special attention to the edges of your data, to make sure conventions conv is using match your expectations.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Blackman 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!