# How to output average value of an envelope detector

#### Suriyel

Joined Jul 13, 2017
16
Hello, I'm not from Power electronics but I think the solution of this question might be Power electronics. Following is partial of the circuit. I want the value of Vreference to be the average value of the "Out" signal. The green signal is the output of (AM)envelope detector, this signal has 20kHz and 20mV peak-to-peak. How can I change the circuit between the green and blue circle, so that I can make the blue signal an average value of the green signal?

#### MrChips

Joined Oct 2, 2009
30,823
If your signal is an AC voltage, you need to firstly feed it into a precision rectifier circuit.
According to the graph you have provided, the green waveform does not go negative and hence does not require rectification.
To find the envelope, feed it into a low-pass filter (integrator).

#### Suriyel

Joined Jul 13, 2017
16
If your signal is an AC voltage, you need to firstly feed it into a precision rectifier circuit.
According to the graph you have provided, the green waveform does not go negative and hence does not require rectification.
To find the envelope, feed it into a low-pass filter (integrator).
I forget to mention, the Vdet go through a precision rectifier then a LPF, then it outputs this green signal, so it is already the envelope, I now need to distinguish the modulation points. I use a comparator to compare the Vreference (the average value I try to obtain) and the green signal to demodulate it.

#### crutschow

Joined Mar 14, 2008
34,464
So you run the signal through another LP filter with a longer time-constant to get the long-term average.

It's not at all clear what you are trying to do.
What is the characteristic of the signal you are trying to "demodulate"?
What are modulation points?

#### Suriyel

Joined Jul 13, 2017
16
So you run the signal through another LP filter with a longer time-constant to get the long-term average.

It's not at all clear what you are trying to do.
What is the characteristic of the signal you are trying to "demodulate"?
What are modulation points?
Thanks, I solved it, cos the majority of the schematic I did not upload. Sry for confusions.