Constant Fraction Discriminator
I have 2 arrays, one is inverted and scaled and the other remains positive and with original size. Now I have to delay the positive one by half the rise time. Then I have to find zero crossing. Finally, I have to find the maximum or determine an object detection.
I have an array after the ADC. I inverted that. Now I'm thinking about how I can take the next steps to create a constant fraction discriminator.
Finally, I have to turn on 1 LED when an object comes closer to my sensor and 2 LEDs when this object comes even closer to the sensor.
The LEDs are connected to 2 pins and need ground on these pins because they are connected to the voltage source from one side.
I would be very grateful if someone could help me write a C code with explanation.