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.

 Accepted Answer

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 Comments

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.
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.
Yes of course, i was just trying to get you to the point. You are welcome.

Sign in to comment.

More Answers (0)

Categories

Products

Community Treasure Hunt

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

Start Hunting!