Smoothing filters
Mostrar comentarios más antiguos
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?
1 comentario
Ivan Mohler
el 17 de Mayo de 2012
Respuestas (5)
Wayne King
el 17 de Mayo de 2012
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
el 17 de Mayo de 2012
0 votos
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
el 17 de Mayo de 2012
0 votos
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
el 17 de Mayo de 2012
0 votos
If you want loess smoothing then see smooth() in the Curve Fitting Toolbox. That offers loess and a number of other smoothing options.
Casey
el 17 de Mayo de 2012
0 votos
Yeah just use. y=smooth(y,'loess');
Categorías
Más información sobre Smoothing and Denoising en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!