Smoothing filters
古いコメントを表示
Do any know some good code of smoothing filter for data (like temperatures, flows and so on)? I have 5 columns of 10 000 data and I need to smooth them.... Maybe to adjust the filter to smooth my outliers by some average values (every 5 values can calculate average)...or?
回答 (5 件)
Wayne King
2012 年 5 月 17 日
It sounds like you just want a simple moving average filter (5 point). You can do that with
b = 1/5*ones(5,1);
output = filter(b,1,inputdata);
Image Analyst
2012 年 5 月 17 日
0 投票
Another option is the Savitzky Golay filter where it fits the moving window to a polynomial. Done in MATLAB by the sgolay() function.
Image Analyst
2012 年 5 月 17 日
0 投票
If it's outliers that you want to delete, Brett Schoelson (of the Mathworks) has this File Exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/3961
We've also used this outlier detection method "the median absolute deviation":
Outliers are identified using modified Z-scores, based on median absolute deviation (Boris Iglewicz and David Hoaglin (1993), "Volume 16: How to Detect and Handle Outliers", The ASQC Basic References in Quality Control: Statistical Techniques, Edward F. Mykytka, Ph.D., Editor.). This method was selected because it doesn’t impose a normality assumption on the data, and it is known to be more robust with smaller data sets than a traditional method based on the z-score ((value-mean)/standard deviation). The algorithm relies on median values (median, median deviation, deviation from the median), as opposed to the mean and standard deviation values. The reason is that the median is much less sensitive to the presence of outliers, while the mean and standard deviation values are greatly influenced by the presence of outliers and their magnitude.
Wayne King
2012 年 5 月 17 日
0 投票
If you want loess smoothing then see smooth() in the Curve Fitting Toolbox. That offers loess and a number of other smoothing options.
Casey
2012 年 5 月 17 日
0 投票
Yeah just use. y=smooth(y,'loess');
カテゴリ
ヘルプ センター および File Exchange で Smoothing and Denoising についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!