My aim is that the input varies between 0 to 5 volts with 500 Hz (like amplified and rectified EMG signal) and the reference is for example is 2 volt. If the input is bigger than referance the output must be 5V, for the opposite status the output must be 0V.
Firstly i tried a simulation. I added sinus wave generator as the input. But the output's changing (rising and falling) is not so fast. You can see the rising and falling time about 800us below the image.