Easy way to clean up a plot?

17 visualizaciones (últimos 30 días)
Matthew
Matthew el 16 de Nov. de 2012
Good morning, I have an array of data from a CSV file that I am plotting in MATLAB. However, the data is noisy, and I really would like to show just the fundamental shape of the data (the bold part of the signal).
Does anyone have any experience with this or any ideas which may help me? Thank you!

Respuestas (3)

John Petersen
John Petersen el 16 de Nov. de 2012
Here are two ideas that should work. 1. Try a standard moving average with lead and lag data points. 2. Take small sample sets (10-20 for your data set) and throw out samples that are much different from the mean of the data set.

Azzi Abdelmalek
Azzi Abdelmalek el 16 de Nov. de 2012
Try a Butteworth filter

Image Analyst
Image Analyst el 17 de Nov. de 2012
Try a Savitzky-Golay Filter, if you have the signal processing toolbox. It's a filter that has a moving window and the central element of the window is replaced by the value of a polynomial fitted through the data in the window. For order 1 (fitting to a line) I believe it's the same as using conv() but you might be able to get more pleasing fitting by using a larger window and fitting to a 2nd, 3rd, or 4th order polynomial. I have a demo if you want. It applies it to an image, first horizontally to rows, then vertically to columns.
There is also a Curve Fitting Toolbox that has lots of curve fitting capabilities.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by