Square wave function programming on Arduino Due

is the actual real world sensor signal the black trace on the diagram in post #1 and you wish to convert this to the violet trace using an arduino?
if so could you use an ADC to

  1. sense the rising edge and output a high signal on a digital pin
  2. sense the falling edge and output a low signal on a digital pin
    if not could give us more details of the project, e.g. input signals and output required?