How do I control when the downsample Simulink block begins to sample?

1 visualización (últimos 30 días)
Victor Esparza
Victor Esparza el 24 de Mayo de 2022
Editada: Shivang el 16 de Oct. de 2023
I would like to control when the downsample block start sampling. At the moment it starts at sample 0.
I tried to use the Enable block but, that only resets the states within the sub system and the downsample sampling remains unchanged.
Could you provide some advice on this?

Respuestas (1)

Shivang
Shivang el 16 de Oct. de 2023
Editada: Shivang el 16 de Oct. de 2023
Hi Victor,
I understand you would like to control the instant when the 'Downsample' block starts sampling.
This can be done using the 'Switch' block. The two data inputs to the 'Switch' block would be the original signal and the downsampled signal generated after passing the original signal through a 'Downsample' block.
The control input to the 'Switch' block can come from a 'Relational Operator' block. This block can be used to generate a high signal once the simulation time exceeds a certain threshold. The current simulation time can be obtained using the 'Clock' block and the threshold specified using a 'Constant' block.
With this setup, the original signal will pass through, and the downsampling of the signal will only begin at the specified threshold.
Refer to the image below for a visual representation of the above setup.
Hope this helps.
Regards,
Shivang

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by