Convert step to continuous signal (live data from sensor)

Hi, I am getting the discrete sensor data from Raspberry Pi which is connected in Simulink. I would like to convert the stepped signal to continuous or smoothed signal in order to further processing. I would like to convert as pointed in RED color in the attached picture. </matlabcentral/answers/uploaded_files/96301/step.PNG> Thank you.

 Respuesta aceptada

Birdman
Birdman el 27 de Nov. de 2017
You may pass it from a second order continuous filter.
Gs=tf([5000],[1 150 50*100]);%filter
step(Gs);set(gca,'XLim',[0 1])
You will see that the signal rises in a reasonable time and it is smoothed. Use the output of the step function by writing
[y,t]=step(Gs);

4 comentarios

Mohamed Haroon Abdul Jabbar
Mohamed Haroon Abdul Jabbar el 28 de Nov. de 2017
Editada: Mohamed Haroon Abdul Jabbar el 28 de Nov. de 2017
Is it possible to convert the step signal directly from Simulink? I am getting the signal from Temperature sensor through Raspberry Pi which is connected in external mode. I have used another function to read the temperature data for 1 wire communication. When I tried this code in temperature function to filter, there shows one error that 'tf' function does not support code generation. Is there any other method which supports code generation? Thank you.
Birdman
Birdman el 28 de Nov. de 2017
Yes of course. See the attached model.
It worked for me. However, I have changed the parameter values to get a reasonable response. I need to modify again to get accurate response. Thanks a lot.
Birdman
Birdman el 28 de Nov. de 2017
Yes of course, i was just trying to get you to the point. You are welcome.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Comentada:

el 28 de Nov. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by