Hi, I am trying to trigger an analog signal(it can be digital too) from an analog input. I want to trigger the output whenever a falling edge is detected. Below I have attached my programme. This works well for lower frequencies of around 5Hz however for higher frequencies the input signal, if it's a sine wave, gets kind of modulated and gives wrong results. please help me rectify this so that it works for higher frequencies.
Thanks.