[sdiy] Fast envelope follower circuit needed..

Dave Manley dlmanley at sonic.net
Fri Mar 29 17:53:04 CET 2013

What's the simplest peak detector/hold circuit?   In each sample period don't we really want the peak value?

-------- Original Message --------
 From: Mattias Rickardsson <mr at analogue.org>
 Sent: Fri, Mar 29, 2013 08:08 AM
 To: rsdio at sounds.wa.com
 CC: Synth-Diy List <synth-diy at dropmix.xs4all.nl>
 Subject: Re: [sdiy] Fast envelope follower circuit needed..

>Speaking of half-wave vs. full-wave rectification... does half-wave
>rectification capture the true amplitude envelope? Most waveforms are
>unsymmetrical and have higher peaks towards one direction than the
>other. The human voice being a good example. I'd argue that the peaks
>are not what should be detected in an envelope follower, but even when
>detecting the true "volume" of a signal - is it enough to just look at
>the positive half of the signal, discarding the negative one?
>Speaking of peaks... sample rate vs short spikes was mentioned, but if
>a spike appears between the samples, isn't there a good chance that it
>wouldn't contribute to the amplitude much at all? If it would happen
>over and over again, like in classic aliasing, it's another problem of
>course, so the upper frequencies should be limited.
>Den 29 mar 2013 02:05 skrev <rsdio at sounds.wa.com>:
>> Yes, you can do half wave, and many analog circuits do this. It's mostly about saving costs of components. Software is generally free, though, except for the cost of cycles at run time.
>> However, to answer your question about "why bother," the answer is that half wave will put less energy into your LPF, and thus the output level will be less than with full wave.
>> In additional, the half wave version will either be less smooth, or it will be approximately half as fast as a full wave.
>> The original request asked for 5 V output, and I meant to point out earlier that you'd need at least 2x gain to get 5 V output from an envelope follower that's being fed a 5 V peak-to-peak signal. That's because the signal's average value is around the mid point, and thus the envelope peaks will be half of the peak-to-peak range. Theoretical maximum would be 2.5 V, and in practice it will be less than that with analog implementations because it's difficult to get the capacitor to fully charge after a diode voltage drop and the time constant delay. Digital implementations might be able to produce a peak envelope of 2.5 V for a brief impulse, even for half wave. There's nothing wrong with boosting this by a gain factor of 2, or more, if you really want 5 V envelope output.
>> A half wave solution would merely need additional gain to reach 5 V output. However, there is no solution to make the half wave as fast as the full wave.
>> Brian Willoughby
>> Sound Consulting
>> On Mar 28, 2013, at 17:43, Dave Manley wrote:
>>> You could also discard all negative samples (half wave).  The output goes thru LPF smoothing anyway,  why bother with full wave?
>>> -------- Original Message --------
>>>  From: rsdio at sounds.wa.com
>>>> On Mar 28, 2013, at 11:24, Tom Wiltshire wrote:
>>>>> On 28 Mar 2013, at 13:55, Dan Snazelle <subjectivity at hotmail.com>
>>>>>> Though i work with c//arduino/AVRS not pics, this sounds very
>>>>>> appealing! Can anyone recommend a place to learn about writing C
>>>>>> code for an envelope follower? How do you do it? Shift signal to
>>>>>> 0-5, then......
>>>>> The first thing after that would be to do the full wave
>>>>> rectification. Either dump the sign bit, if you've got signed data,
>>>>> or invert the data if the highest bit is clear if it's not signed -
>>>>> same thing, different representation. Half-wave rectification just
>>>>> makes the signal more "lumpy" and isn't significantly easier
>>>>> digitally anyway.
>>>> You can't dump the sign bit, at least not with twos-complement data,
>>>> which is what all digital signed data is. Maybe you're thinking of
>>>> conceptually dumping the negative symbol, but that's not the same as
>>>> dumping the sign bit. If you were to dump the sign bit, then the
>>>> negative part of the signal would not be inverted, as needed, but
>>>> would merely be shifted up into the positive range. That would make
>>>> an ugly, spiked signal that would introduce significant errors in
>>>> your envelope.
>>>> The easiest thing to do with signed data is use abs() to get the
>>>> absolute value. Many 8-bit processors even have a native opcode to
>>>> compute abs(), but they're not merely masking out the sign bit as
>>>> would be done by and'ing with 0x7F.
>>>> You are correct that inverting the data below the midpoint will work
>>>> with unsigned data.
>>>> You can probably use almost exactly the same code for either signed
>>>> or unsigned.
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>Synth-diy mailing list
>Synth-diy at dropmix.xs4all.nl

More information about the Synth-diy mailing list