# Op amp problem - unexpected simulation results

I am referring to the accepted answer in this question

The answer has 25 votes, and is picked as the best answer but after carefully reviewing it, I could only come to a conclusion that it is not accurate or that I am missing something.

Here is the original Circuit: A, What is the point of this so-called super-diode, where the last stage has already been off-set to vcc/2? (meaning the signal from last stage are all positive)

Here is my simulation. Clearly it's different than the simulation from the original answer. B, That is a just differential amplifier however, it seems to be stretching the signal. It seems to me that in first stage, he adds (off-set) vcc/2 to the signal, and the last stage, he subtracts vcc/2 from the signal.

I am wondering whether I am missing something. Otherwise, I am wondering what the correct answer to the original question is.

Update: Here is a complete simulation.  Update 2: I think I got it now. The circuit requires a real sound wave as input. • The linked answer looks good to me. I'm not sure what you don't understand about it. For the precision rectifier ("super-diode"), do you understand why we want an envelope follower? For the differential amplifier, of course it amplifies ("stretches") the signal, that's literally its name. Apr 29 '18 at 8:36
• Your circuit is NOT the same as the original. Duplicate the original, then see if it works as it should.
– JRE
Apr 29 '18 at 8:42
• A diode lets current pass if the voltage is higher from anode to cathode. It doesn't matter if the voltage at both ends is positive - there just has to be a difference.
– JRE
Apr 29 '18 at 8:45
• Also, if you can't trust a given answer, how could you trust that a new answer is trustworthy?
– JRE
Apr 29 '18 at 8:46
• ::Boggle:: The output isn't supposed to look like the input. It is supposed to represent the peak voltage of the input. So, an (approximately) DC voltage proportional to the 0.05 V of the signal generator. Which is what the red trace shows.
– JRE
Apr 29 '18 at 10:21

A: The linked article explains that the op-amp / diode combination eliminates the normal voltage drop associated with rectification. For a small signal a regular diode's $V_f$ is too high and would either distort or block the signal. Putting it into an amplifier with feedback eliminates the effect of diode voltage drop.

What is the point of this so-called super-diode, where the last stage has already been off-set to vcc/2? (meaning the signal from last stage are all positive).

The purpose of section A is not signal rectification but rather peak envelope detection in conjunction with C3. The signal is at positive voltage all the way through. The peak detector will be biased above $V_{cc}/2$.

B: This is a standard non-inverting amplifier operating around $V_{cc}/2$. This is standard practice in audio circuits powered from a single-ended supply.

• You are, of course, correct. But, I think part of the problem is an understanding of how a diode works. Atmega328 seems to believe that a diode only lets current flow if one side had a positive voltage and the other a negative voltage. The bit with eliminating the forward voltage seems to have gotten through.
– JRE
Apr 29 '18 at 8:51
• It's a bit difficult to tell what exactly the problem is other than attitude. (See question revision history.) Apr 29 '18 at 8:59
• Yeah, I saw it "real time."
– JRE
Apr 29 '18 at 9:22

The original circuit is a peak detector (aka envelope detector) with a hold capacitor of 10 uF and a discharge resistor of 26.7 kohm ($\tau$ of 267 ms).

Your circuit's hold capacitor in 10 nF and of course it won't perform correctly with your input stimulus of 1 kHz because 10 nF || 22 kohm has a $\tau$ of 0.22 ms whereas the original has a $\tau$ of 267 ms.

• I know it's a 10uf, but I didn't get the expected result, so I changed it to 10nf. Here I updated a complete and "correct" simulation, and the result is more than disappointing, or what should I say, expected? Apr 29 '18 at 9:50
• @Atmega328 It looks like your new simulation hits the spot precisely. The envelope detector appears to function rather well. Maybe you were expecting something else to happen? Apr 29 '18 at 9:56
• the result (out) doesn't seem right to me. The input is a sin-wave, but the output is NOT. Apr 29 '18 at 10:01
• The circuit is designed to capture the peak of the sinewave i.e. it is an envelope (or peak) amplitude measurement circuit. For a sine wave of peak value 1 in you get 1 volt (possibly scaled) out. I think you think the circuit is intended to perform some other function yes? Apr 29 '18 at 11:19
• I got it now, although the responsive result from my simulation is not ideal. Apr 29 '18 at 12:00