I have created a circuit where I want to detect a pulse width, but unfortunately I can't get what I want. I think my circuit is totally wrong. I am looking online to find a solution, but the closest solution which I found was the Duty Cycle Adjusting Circuit for Clock Signals, which is not what I need.
But all I get is triangle wave generator.
So I have changed the circuit a little bit and I have got a result closer to the desired output. With the proposed solutions is a little bit hard to understand what I should do to achieve my desired output.
Here is the output that I get:
I want v(net2) to start from 0 and be more linear after the pulse. I have also designed another circuit but there I get something completely wrong.
Here is alternative circuit:
And the output of this circuit is:
Which is not even closer to the first solution. Help me to achieve the desired solution given in the first picture.