[sdiy] Fast envelope follower circuit needed..

Tom Wiltshire tom at electricdruid.net
Fri Mar 29 22:14:41 CET 2013


Hi Damian,

> I'm afraid I have to disagree with you on several points here.

I thought this might run for a while yet ;)

The key thing for me here is that flopping the bottom part of the signal up to the top doesn't change any of the peak levels, whatever happens to the frequency spectrum, and it's primarily the peaks I'm interested in. However, it does obscure which peaks are positive ones and which are negative, so maybe that's a problem. 

Perhaps I don't even need to bother rectifying the signal. Why not just keep a check on the negative peaks like the positive ones, and then use some average of the two as the final output. JP said his signal might well be asymmetric (which is not at all uncommon), so we can't assume the two envelopes will be the same.

It seems to me that most of your complaints about filtering rectified signals apply pretty much equally to analog as digital. Ok, so you haven't got aliasing to worry about, but you still converted a lot of low frequency energy in the signal into high frequency spikes which then get filtered away - after all, that's the point. And there will be some residual ripple - that's a fact, and that's something we see in the analog implementations.

Also it's worth pointing out that we don't have to follow the rectifier (if we use one) with some kind of filter.
Harry Bissel's analog envelope follower that Tim posted gives some clues to the sort of techniques I'd think about using:

http://www.edn.com/design/analog/4344656/Envelope-follower-combines-fast-response-low-ripple

This takes the highest output from three peak detectors and uses that as the output.
I'd adopt some similar idea - check for highest peaks, and store them, and then draw a straight line between those peak points. Do the same for the negative peaks. Invert the negative envelope so that it's positive, and then average the two to get your final output.

There you go! No rectification, no filters*, no problem!

Ok, so it isn't perfect, but neither is the analog solution we're trying to replace. In fact, far from it. The bar is pretty low here. Furthermore, the proposed digital solution won't need any multiplies, it's dead simple to code, it'll fit in an 8-pin PIC, and it'll probably do at least as good a job as an analog solution that needs many more chips. Ultimately, that's what counts. I could worry about aliasing and the frequency domain representation of a full-wave rectified signal, but I don't think it'll get it done quicker or cheaper.

Tom

*Some of these stages could be represented by filters of various types, but that wouldn't be the best way to implement them or think about them, so I choose not to refer to them as filters.






More information about the Synth-diy mailing list