How can I ignore (delete) unwanted peaks of a continious signal?

4 views (last 30 days)
Hey, i have a signal with peaks (frequency of them is not constant) and goal is to just go over it in a straigt line. The system is build in simulink and i tryed different filter, but didnt' succed. Any ideas?
It is the curve of the speed of a motor and i would like to get a straigt line (red) instead of an overshoot.
Thanks for your help.
Best regards.
  6 Comments
Emefun
Emefun on 16 Mar 2024
i dont have access to it until tuesday to send a screenshot, but I can try to explain.
I get the velocitycurve of the motor with disturbances from a subsystem. I should transfer this curve without the disturbance-peaks into my system.
It is just important, that the system don't get the peaks. It would be instable then.

Sign in to comment.

Accepted Answer

John D'Errico
John D'Errico on 13 Mar 2024
Just choose some point where the curve should have settled into its long term nominal state. That should be at or about a time of 25 in your plot.
Next, take the median value of the curve over that interval, here from a time of 25 to the end.
help median
MEDIAN Median value. For vectors, MEDIAN(x) is the median value of the elements in x. For matrices, MEDIAN(X) is a row vector containing the median value of each column. For N-D arrays, MEDIAN(X) is the median value of the elements along the first non-singleton dimension of X. MEDIAN(X,"all") is the median of all elements of X. MEDIAN(X,DIM) takes the median along the dimension DIM of X. MEDIAN(X,VECDIM) operates on the dimensions specified in the vector VECDIM. For example, MEDIAN(X,[1 2]) operates on the elements contained in the first and second dimensions of X. MEDIAN(...,NANFLAG) specifies how NaN values are treated: "includemissing" / "includenan" - (default) The median of a vector containing NaN values is also NaN. "omitmissing" / "omitnan" - The median of a vector containing NaN values is the median of all its non-NaN elements. If all elements are NaN, the result is NaN. Example: X = [1 2 4 4; 3 4 6 6; 5 6 8 8; 5 6 8 8] median(X,1) median(X,2) Class support for input X: float: double, single integer: uint8, int8, uint16, int16, uint32, int32, uint64, int64 See also MEAN, STD, MIN, MAX, VAR, COV, MODE. Documentation for median doc median Other uses of median categorical/median prob.NormalDistribution/median codistributed/median tabular/median datetime/median tall/median duration/median timeseries/median fixedpoint/median
Finally, discard any value ABOVE that median. You can just use min to perform that task. You might even be more aggressive, and choose the 25th percentile of the curve, as perhaps a better estimate of the long term behavior, better insuring you don't get any of those outlier segments at all.
  2 Comments
Emefun
Emefun on 16 Mar 2024
Edited: Emefun on 16 Mar 2024
hey, thanks for the help.
problem is, that the peak could occur any time. Also the amplitude can get a different value due to requirements of the speed.
Maybe I dont get you right.
Emefun
Emefun on 20 Mar 2024
@John D'Errico it got how to use the min block, but it is a continious signal and i dont know how to build this median in simulink then

Sign in to comment.

More Answers (0)

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!