What is the default window size when you use the 'movmedian' or 'movavg' method in the smoothdata function?
7 views (last 30 days)
Show older comments
Swapnil Kelkar
on 27 Mar 2019
Commented: Chris Turnes
on 27 Mar 2019
I was trying to use the inbuilt function smoothdata to try and reduce the noise in my set of data and was wondering what the default window size would be selected when we use the 'movmedian' or 'movavg' method.
0 Comments
Accepted Answer
Walter Roberson
on 27 Mar 2019
There isn't one. When you specify that method yourself then you must pass in the window size. If you do not specify the method or window size then it uses an algorithm to decide the window size. The document says:
When the window size for the smoothing method is not specified, smoothdata computes a default window size based on a heuristic. For a smoothing factor τ, the heuristic estimates a moving average window size that attenuates approximately 100*τ percent of the energy of the input data
1 Comment
Chris Turnes
on 27 Mar 2019
To add to this, the window size that this heuristic determines is returned as the second output of the function. If you want to see what the window was selected for your data, just grab the 2nd output.
More Answers (0)
See Also
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!