Easy way to clean up a plot?
9 views (last 30 days)
Show older comments
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!
0 Comments
Answers (3)
John Petersen
on 16 Nov 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.
0 Comments
Image Analyst
on 17 Nov 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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!