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

1 Ansicht (letzte 30 Tage)
Victor Esparza
Victor Esparza am 24 Mai 2022
Bearbeitet: Shivang am 16 Okt. 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?

Antworten (1)

Shivang
Shivang am 16 Okt. 2023
Bearbeitet: Shivang am 16 Okt. 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

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by