40 KHz Envelope detector.

Welcome all. I need to built envelope detector for analogue modulated signal with 40 KHz carrier wave. Ideally it would be based on op-amp precision rectifier as signal has low amplitude therefore large potion would be wasted on rectifying diode. My issue is finding right value for resistor and capacitor on the output of my rectifier. So far, I built precision rectifier based on small signal diode and lt032 op-amp. I looked at similar circuits and usually output of the diode is connected to RC circuit with 100kOhm and 10nF. So, time constant of it is 1ms compare to carrier period of 25 us. So, I guess in ratio 40 to 1 we can say that charging time is negligible. However, in case of my circuit I do not see any smoothing of the carrier peak. Not sure what could cause it op-am unable to charge cap wrong time constant or incorrect approach.

Doing a quick calculation in my head I'm getting an RC time constant of 1 millisecond. Do you agree? What kind of envelope speed/smoothing do you want?

Note that the resistor is only in-effect for the discharge. The capacitor is charged through the much-much lower impedance of the op-amp. So what you actually have is a peak detector (although I don't know if it's fast-enough to "detect" the peak of a single-cycle at 40kHz).

If you follow the precision rectifier with an op-amp voltage follower, you can follow that with a regular low-pass filter if you want a moving-average of the envelope with equal charge & discharge times.

You need a "pull down" resistor at the output of the precision rectifier (or input of the voltage follower) to prevent the voltage from floating-up.

If your op-amp doesn't have a negative-voltage power supply, the output may not go down to ground.

However, in case of my circuit I do not see any smoothing of the carrier peak

The circuit you have diagrammed is a peak detector, and you certainly should see "smoothing" of the carrier peak.

What do you see instead? Post a photo of an oscilloscope trace, or whatever other evidence that you have.

Of course, the circuit you posted has a gain of 1, so in the input voltage has to be greater than about 1.5 Vrms to see anything.

You might try something like this:

Have a look at page 11 of the LM3915 datasheet.
Leo..

Wintermuteldn:
So far, I built precision rectifier based on small signal diode and lt032 op-amp.

LT032 - Google finds no data about that - have you got the right part number?

For 40kHz envelope detection you'll need an opamp thats fast enough, some are not.

Thank you all for replies.

DVDdoug: Yes you are right I meant 1 ms also yes, I used wrong name as never used “peak detector” but noticed some similarities with envelope detector and made wrong assumption.

Jremington: Massive thank you for your circuit! I tried to build it in LTSpice as I believe it is software you used with mixed results, I attached my simulation. Also, would like to ask how did you label power supply so clearly outside of circuit?
Good news is I managed to rewire my breadboard and use solution you provided with good effects. Still having some ripple that I will have to improve but over all performance is spectacular compare to my previous attempts. Please see picture below illustrating new results.

MarkT: Sorry my fault it is TL032IP.

I also added some measurement to pinpoint cause of distortion but have no clue how to improve performance.

Some ripple is unavoidable. The diodes or op amp might not be fast enough* and the op amp might be current limiting, as the capacitor on the output appears to be a dead short when discharged. You could follow the output stage with an RC filter, at the expense of rise time.

But your other post suggested you are interested to time an ultrasonic pulse echo return, so why do you care? The first peak is all you need.

Also, would like to ask how did you label power supply so clearly outside of circuit?

I used node names ("label net" button) P15 and M15 to indicate the connections.

*The OP77 used in the simulation is slow -- I just randomly picked it. Here is what happens when you use a reasonably fast op amp:

Jremington: Thank you for your hint with LT spice. I followed your modifications and got same result in LTSpice.
Yes, I am interested in time of flight between transmitter and receiver. Trouble is that I think due to mechanical inertia my signal oscillates with small amplitude slowly rising in middle to fall again. (Picture: PWM_1).
I have seen some solutions with op-amps cutting anything below certain amplitude as “threshold detection”. However perhaps I am wrong here, but I thought of phase shift detection in my circuit. I tried some signal schemes and got some results. (Picture: Phase_shift_modulation).
However, phase shift modulated signal its far from perfect its difficult to find ratio of in pahes to antiphase impulses to gain nice flat line on the output like in picture “phase_shift_modulation.
To be honest at this point I am looking for easiest and robust way to achieve fairly accurate measurement between start of transition and signal being received.
I added extra capacitors now having 400nF capacitance there ( 4 times 104 ). This improved ripple and smoothed thing out and circuit performs beautify. (picture: peak_detaector_NEW)
Also I Am not sure how useful it will be in current state (heaving peak detector) but I am going to also build zero crossing detector to sample my signal at the peak of 40 KHz signal so with delay of 6.25 us (first peak) and every 12.5 us (peak to peak delay).
Also I noticed spikes shooting low and high prior to my “smoothed signal” I it cause by small signal not great enough to be rectified and large op-amp gain?

Wintermuteldn:
MarkT: Sorry my fault it is TL032IP.

Slow part for working with 40kHz, won't handle 40kHz full output swing.

Its for split-supply use, not rail-to-rail - what are you power rail voltages?

They are + 5V and – 5V. I believe TL032IP has slew rate of 3V/us so yes its noticeable when used as Zero crossing detector hence I used TL3016 very high-speed comparator fo ZCD.

Also not too sure about speed is there anything particular you noticed in my wave forms ? So far apart from ZCD TL032 seem to be ok or perhaps I overlooked any issues.

If the opamp is struggling it may never properly settle to the input signal voltage. There are plenty of
better performing opamps out there, even the good old NE5532 will handle 100kHz full swing.

MarkT Thank you very much for the hint. At the beginning of this project I received LM741. This was absolute waste of time. Now I got some results however I will investigate what are you saying as it might be working but improvement can be made. Regarding speed as I mention before I used TL032IP for ZCD. So you are right saying that speed might be issue as it was twice so far. Do you think it would be good practice to change all tl032IP for NE5532 as I noticed their slew rate is 9V/us compare to my current 3V/us. I guess if I want to put something close to max amplitude swing on to ADC lets say 4.5V it would currently mean it takes 1.5us with period of signal (after full wave rectification) of 80 KHz that gives me 12.5us period. Not to sure about practical aspect (first major project) would that really be unwise ?

Think of it this way - the amp's gain-bandwidth-product indicates the maximum frequency that can be
handled in any fashion at unity gain, but that's almost never useful, you want to know the distortion-free maximum
frequency. For large signals that means checking the large signal performance (slew rate limited),
and in general use you might want >= 10dB of gain headroom for anything like low-distortion behaviour,
as that gain headroom is available for the feedback to use, or perhaps 20 to 30dB of gain head room for
anything precision. Feedback is essential to how an opamp functions, and lots of feedback is good.

This is why a good audio opamp will have a GBP of 5-20MHz, not 20kHz, and the lower the distortion,
the higher the bandwidth, some of the best audio opamps have 40MHz or more.