Reset a sine wave in Simulink

7 ビュー (過去 30 日間)
Mvdw
Mvdw 2018 年 6 月 14 日
コメント済み: Fangjun Jiang 2018 年 6 月 16 日
Hi all,
So I'm trying to reset a sine wave its phase in Simulink. The idea is:
- When I enable the block, a cosine wave starts at zero.
- When the block disables, the output is zero.
- When the block enables again, the phase of the cosine is reset and starts at zero again.
If I use the enabled block, the output gets zero, but when enabling again, the cosine just continues its phase, so if the enabling is not in phase with the cosine, it does not start at 0 again.
This is what I am able to get:
But when the phase of the enabling block pulse changes, the sine does not reset its phase:
Someone has an idea how to do this?

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2018 年 6 月 16 日
Use the "Fcn" block which you can specify "sin(u)" as the function. Use an "Integrator" block with the input as constant value of 1 or other value. Enable the "reset" (select level) of the "Integrator" block, your enable/disable signal will be the "reset" input. Feed the output of "Integrator" block to the input of "Fcn" block.
  1 件のコメント
Fangjun Jiang
Fangjun Jiang 2018 年 6 月 16 日
Re post. Similar answer was deleted by Birdman.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by