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?