How can I eliminate the random noise of velocity plot of my beam model simulation?

% The MATLAB file is in the attachment. % This question has been troubled me for a long time and I would thank you very much if you may give me some suggestions. % I am trying to build up a simplified beam model to simulate the lateral vibration for pipelines on seabed using central finite difference method.

 Accepted Answer

I'd use the Savitzky-Golay filter, which is basically a moving window where the center is replaced by a value taken from a polynomial fitted to the data in the moving window. I attach an example for filtering a 1-D sine wave. You'd need the Signal Processing Toolbox.

3 Comments

Thank you very much for your prompt answer. This is really a good way to solve the noise after my running out the program. But can solve this problem in my program thus I can get a smooth output directly? Because I still need to add some events functions judgement in my ODE function to specify the zero-crossing point of velocity thus the reprocess solution you give me seem not work in this way.
I'm not sure how to answer this. Yes it will smooth a signal ("output"), and yes you can get a smooth output directly (meaning after you call sgolayfilt). I have no idea what to say when you say you need to add some functions to your code. Just go ahead and do that. But I'm not sure why you say that you can't then use sgolayfilt "in this way". Sure you can. Whenever you have a signal you need smoothed, just go ahead and call it -- what's the problem?
Thanks for comments. What I considered here is whether the sgolayfilt command will damage the validity of my results. Because I am not sure the results with noise is true or not. Thus I prefer to finding out is there anything wrong in my program results in such a large noise rather than reprocess the data I have acquired.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!