I created 2 boards communicating each other like an intercom system. One of them has a button to send a ring signal to the other. The ring signal consists of PWM signals created by an MCU. I want to detect the ringtone by the MCU of the receiver side.
My ringtone contains 4 outer pulses with a period of 300 ms:
200ms of this signal contains the inner pulses with a period of 1.25ms:
So, I want to add a filter circuit to the receiver side of the ringtone and convert the outer signal to a straight PWM signal. Below is an example output
So far, I have tried adding an RC low pass filter with a cut of frequency of the outer signal (1/300ms = 3.33Hz). But I couldn't even get close to the example output. Is there anything I misunderstand about the concept since I'm not very experienced in circuit designs?
Regarding my circuit: I just added a series resistor and a parallel capacitor to the node:
Edit: I didn't want to talk about the circuit that handles converting the audio line signal back to the PWM since this is not the subject on this question. But I suspect that my RC filter does not work properly because of that part. I tried the solutions on the answer but they didn't work as expected.
Below is the schematic of my optocoupler side, line input contains the audio signal of the PWM. The audio signal converted back to the PWM by the optocoupler then I get the PWM signal which I gave the screenshots above. But when I add the RC parts to the OPTO_OUTPUT node, PWM signal changes in terms of volts too. Do you think I have a mistake on adding the RC parts?