フィルターのクリア

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

2 ビュー (過去 30 日間)
Victor Esparza
Victor Esparza 2022 年 5 月 24 日
編集済み: Shivang 2023 年 10 月 16 日
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?

回答 (1 件)

Shivang
Shivang 2023 年 10 月 16 日
編集済み: Shivang 2023 年 10 月 16 日
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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by