问题
I have an input signal I=sin(omega*t). Which simulink model do I use in order to get a pulse every time the signal crosses zero-point?
回答1:
Here's my suggestion:
The transport delay block makes a delayed version of input signal. You need to make the sampling rate of this block low. Then, signs of original and delayed signals are subtracted. If signs are equal you get 0, if signs are different (zero is crossed) then you get +-2. You take absolute value and divide signal by 2 to get:
回答2:
I find one another way to do this:
Upper part of image - it's all simulink model, bottom part - is a resettable subsystem.
Result:
Constant 1
is an amplitude of pulse, 3
in Compare To Constant block - is a length of pulse.
来源:https://stackoverflow.com/questions/34327814/need-to-generate-pulse-when-a-signal-crosses-zero-point-in-simulink