How can I detect a sign change without detection of 0 holding (Simulink)

9 ビュー (過去 30 日間)
Nick
Nick 2016 年 4 月 14 日
コメント済み: Nick 2016 年 4 月 18 日
Hi,
I want to detect sign changes with Simulink blocks. By using the common libary, I also detect when the signal jumps from positive to 0, hold 0 and rises back to the positive area, which is not beneficial in my case. Do you know a way how to detect sign changes with real zero passings?
Thanks.

回答 (1 件)

Anish Mitra
Anish Mitra 2016 年 4 月 18 日
You can make use of the "Detect" blocks in the Simulink>Logic and Bit Operations library.
>> web(fullfile(docroot, 'simulink/slref/detectfallnegative.html'))
These blocks are for Fixed Step solvers. If the logic needs to be implemented using Variable Step solvers, then you can use a Memory block to construct the logic. Essentially this would mean taking the product of the signal, and the signal delayed by 1 (using a Memory block, not a delay). If the sign of the product is negative, it means that there is a zero crossing at that particular time step.
Hope this helps.
Anish
  1 件のコメント
Nick
Nick 2016 年 4 月 18 日
Hi Anisha,
thank you for your suggestion. In case there are two zero sample points in a row, this detection won't work.
I solved this problem by saving the last non-zero value and thought there might be a better solution (a block from the libary).
Cheers, Nick.

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by