That might be a start.
Could you share a schematic?
What happens after the first signal peak value is detected? Do you have a time out setting? (not for debouncing).