Smoothing noisy increasing measurement/calculation
1 次查看(过去 30 天)
显示 更早的评论
I have a set of calculated values based on measured data (erosion through a pipe) where decreasing values are physically impossible. I want to smooth out the data and account for the fact that it is impossible to decrease, but don't want my new data to take giant jumps when the noise is significant. Any suggestions would me much appreciated.
0 个评论
采纳的回答
Chad Greene
2014-2-18
A moving average should do it. You'll lose some temporal resolution, but if the noise is gaussian then a moving average will force the noise to asymptote to zero with increasing time window size. There are several moving average functions on the file exchange; I'm not sure which is best.
Alternatively, you could apply a low-pass frequency filter if the lowest frequency of the noise is not below the highest frequency of your erosion signal. If you have the signal processing toolbox, I made this to make frequency filtering a little more intuitive: http://www.mathworks.com/matlabcentral/fileexchange/38584-butterworth-filters
更多回答(2 个)
John D'Errico
2014-2-18
So use a tool like SLM (download from the file exchange) to fit a monotone increasing spline to the data, smoothing through the noise.
0 个评论
Image Analyst
2014-2-18
How about just scan the array and compare to the prior value?
for k = 2 : length(erosion)
if erosion(k) < erosion(k-1)
erosion(k) = erosion(k-1);
end
end
Simple, fast, intuitive.
2 个评论
Image Analyst
2014-2-18
Even if you do a sliding mean like Chad suggested, you'll still have to do my method (or equivalent) because you said that decreasing values are physically impossible. A sliding mean filter can have values that decrease so you'll have to scan for that and fix it when it occurs.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!