I have 1kHz square wave I would like to measure the max and min voltage of. But, it is asymmetrical in both amplitude and duty cycle and it has a 1MHz 1V signal on it. The input impedance should be > 100kOhm and the output goes into an ADC without a load.
I went through some theory of opamps. Understand the half wave rectifier, the peak detector and the first order low pass filter. It all seems useful. But I was wondering what best way to do this. I know the duty cycle. Those are fixed values of either 4%, 50% and 96%. The amplitude is either around -5 or -10 at the negative side and around 5 or 10V on the positive side. Any change in voltage I would like to detect within 10 periods (10ms). I would like to measure at better than 100mV accurately.
The only thing I know that works is making a buffer with gain 1, a diode, and R and C that settle at the average of the positive duty. And then divide that voltage by the (known) duty cycle. But the voltage drop of the diode was less constant than expected. For the negative value I could do something similar.
But I am quite sure there is a more elegant way. Before you know it, getting rid of the 1MHz in negative feedback RC combined with the diode of the peak detector works. Thanks!