Hit crossing block: how to emulate them with simpler blocks

1 view (last 30 days)
Dear all,
I have a couple of problems related to hit crossing blocks.
The first one, is that I need to implement a hit-crossing block by using only "simple" blocks, like unit-delays, memory blocks, logic operators, switch, etc, and I wonder how to do that. I have tried to use a switch block with a constant "0" and a constant "1" as inputs and to switch between such "0" and "1" according to the zero-crossing of the continuous-time signal. What I get with variable-step solvers is a zero-crossing error (too many consecutive zero-crossing). However, this does not happen with fixed-step solvers or with variable-step solvers when I explicitly use hit crossing blocks. This suggest me that there must be a way to "emulate" the hit crossing block by using simpler blocks. But... how to do that?
The second one, more related to the hit crossing block itself, is that when a hit crossing has been detected, then it generates a pulse in the output. What if I want a constant signal instead? For instance, what if I need to set the output signal to "1" when I detect a zero crossing of from "above" and a "0" when I detect it from below and hold these signals?
Can you help me?
Thanks, Ubaldo

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!