What does IIR and FIR filter are used for in embedded

It looks like the rising edge of Channel 2 is the place to sample the blue line. Then just use the value to set the tone(). I would use a pot for a 'squelch' and turn off the audio if the sampled value is below the squelch threshold.