Smooth step changes in a array

Hello,
I'm currently working with a robot, and because of some calulations, the commanded signal has step changes which I want to somehow smooth this steps to a progressive curve. My question is if there is proper matlab tool which can help me with this task or if I have to do it manually. Here my data and a plot .
Thanks in advance

3 comentarios

John D'Errico
John D'Errico el 10 de Mzo. de 2023
Um, not really. But your question is pretty vague. It souds as if you want to approximate a stepwise function,, which in your case seems to be just a boolean thing, either on or off, at seemingly random intervals. What would you approximate it with? Perhaps some function which has the same average behaviour locally? Yes, you could do something, but you would need to write at least some minor amount of code, depending on your goals, and what that approximation would mean.
Or, are you asking about the curve on top? Yes, you could probably use a smoothing spline for that curve.
hello
you may want to implement a discrete low pass filter in your command signal
the very simple first approach I can suggest is in the form a first order recursive filter
a = constant between 0 and 1
out_new = out_old*a + input*(1-a)
Jan
Jan el 13 de Mzo. de 2023
A simple moving mean filter might be working also.

Iniciar sesión para comentar.

Respuestas (1)

Swaraj
Swaraj el 5 de Abr. de 2023

0 votos

There can be multiple ways of doing it. One common method is to use a low-pass filter which can remove high frequency components and smooth the signal.
You can go through the following Documentations for more details.

Productos

Versión

R2022b

Etiquetas

Preguntada:

el 10 de Mzo. de 2023

Respondida:

el 5 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by