I'm trying to implement the RMS block in analog, i think doing only a peak detector would be way easier but perhaps the RMS would be more interesting.
Other sources online suggest this:
A squaring circuit followed by an average circuit. Keep in mind that this topology has everything in digital while i'm doing mine in analog.
Right now i'm trying to implement the square circuit but i'm having some trouble.
I stumble into this, a multiplier using op amps and diodes:
The output voltage of this circuit is in the form (-K * V1V2) / IsR , where Is is the saturation current of the diode used.
So i implemented that circuit in ltspice:
The values used in R where obtained from the equation above knowing that Is = 31.7e-6
I used 0.6V and 1.5V as an input and obtained this (top corresponds to input 0.6V and bottom 1.5V):
The output isnt what i expected (0.36V and 2.25V). if i have voltages bigger than 1.5V the output seems to be always around 4V, something must be wrong.
This type of square circuit already has been questioned here and people told that this is not really a very practical implementation of a multiplier. It's single quadrant and the theoretical output voltage has a multiplier factor of 1/(Is*R), which is a large and poorly controlled number.
Even after this is done i still need to worry about the average, below seems to give some ideas but i still need to do some more research.
So i'm not sure what to do, if there is an easier way or just scrap this idea and go for the peak detetor only which involved more simple circuitry.