Eurorack, Modular

Designing an Envelope Detector for Bass and Bass Drum Signals

The neat thing about rolling yer own eurorack modules is that any niche requirement you can dream of can be realised (with the required time, effort and aptitude of course!). I almost always send my kick drum signal to my l-1 compressor sidechain to ‘duck’ my bass voice(s). The l-1 has 2 CV outs that can be processed (invert +offset + gain) to ‘duck’ other signals too. This approach works fine but is an awful waste of a good compressor. I’d like to experiment more with controlling the synth with my bass so an envelope detector design that can handle 50Hz+ signals to a decent approximation seemed like a good idea.

The classic analogue Envelope Follower/Detector is a precision full-wave rectifier followed by a low-pass filter. The rectifier gets rid of the negative portion of the input signal and is usually full-wave rather than half-wave because the frequency doubling effect eases the filter design at very little extra cost. I’ve linked an excellent precision rectifier study from Elliot Sound below – I used the circuit in figure 6. The low pass filter averages the signal and it is in the design of the filter that a trade-off must be made between a fast response and minimal 3rd harmonic ‘ripple’ that could distort the vca or filter signal that is being modulated by the envelope. A filter with a fast time constant (say 10 ms) will respond rapidly to transients but is likely to have unacceptable levels of ripple especially at lower frequencies (doh); a slow time constant (say 110 ms) solves the ripple issue but may not keep up well with the input signal. Is it possible to achieve acceptably low ripple (~20 mV at 50 Hz for a 5 Vp input) and fast attack (>50% in 20 ms) using a small handfull of common parts…well yes A’bhalaich! Introducing the Non Linear Capacitor (NLC) – an adaptive time constant approach in which the capacitance of the capacitor in a 1st order low pass filter appears larger to lower frequency signals by exploiting the Miller Effect. To the engineer(s) at THATcorp who seem to have invented this circuit I say Slainte! After simulating various filters I thought the NLC offered a good complexity/component count/performance trade-off compared with higher order filters.

In simulation I found that some additional low pass filtering was required to smooth the waveform, so a 2nd order Sallen-Key Butterworth filter with a cutoff of 32 Hz was added in series with the ‘NLC’ filter. Also it’s often desirable to manually play with the attack and release times which is what the diode steering circuitry following the 32Hz filter is for. This feature has the added benefit of getting me out of jail if the adaptive filtering doesn’t perform as well as in the simulator. Output ‘VenvOut’ is the standard envelope out, after attack and release controls. Output ‘VenvDuckCV’ is the inverted and offsetted ‘duck’ CV out, included to avoid needing additional processing before feeding a vca (or 2). The dc offset level is adjustable using the pot connected to the non-inverting input of the Invert and Offset pot. The final output is a gate that goes high whenever the signal at the attack/release output exceeds the adjustable dc threshold level. The status LED lights up when the gate signal is high.

The Spice plot below compares three different filter responses to a rectified bass drum sample: the adaptive NLC filter; a single order ‘slow’ filter and a single-order ‘fast’ filter.

I looked at using a fourth order filter, which could offered similar attack and ripple performance with only one additional opamp however the err sharper overshoot looked like a potential issue unless even higher order Bessel filters were used.

Here’s the build; I used the eurorack format prototype boards by D.Hailant now available at Thonk. These are good and although this is about as large a circuit you can fit on one without getting silly I can see myself using 2 or 3 of these for a more complex module, they’re cheap enough and the design, hole placement and footprints for pots, jacks etc well thought out.

‘Scope Measurements

So how does the performance of the build compare with the simulation results? Well the rise, fall, overshoot and ripple were all a bit better in simulation, but not massively – measurements are included beneath each plot. Perhaps some tweaking of the NLC circuit could tighten things up but it’s not too shabby as is.

Input: 2Vpp Sine, 50 Hz
Output: Env Out
Att/Rel: Fully CCW

Input: 2Vpp Sine, 2.5 kHz
Output: Env Out
Att/Rel: Fully CCW

Input: 2Vpp Sine, 660 Hz
Output: Env Out
Att/Rel: Both ~50%

Input: 2Vpp Sine, 330 Hz
Output: Env Out
Att/Rel: Fully CCW

Input: 6V Sine, 400 Hz
Output: Duck CV out
Att/Rel: Fully CCW

Input: 10Vpp Sine, 660 Hz
Output: Gate Out

Suggested Improvements

There are alternative envelope follower designs out there – one of them by Harry Bissel is linked below and is likely to have a better response and possibly less ripple, by using (min) 3 peak detectors and some clock/reset CMOS to reset them. I might try this one in the future.

The performance of the detector could be improved by tweaking the NLC circuit – try different diodes and capacitor values. See the THATcorp link for more info on this.

An i put and/or output gain control would be useful, particularly for better control if you intend to fully (/properly) use this for ducking.

I used a polymer electrolytic for the first time here, although forgot to buy them for the power filtering. Having recently replaced over a ton of dried up and leaky caps in an old Boss Multi FX I like the idea of not having to repeat this for all my modules in the future!

Precision rectifiers.
The non-linear capacitor circuit
Eurorack format prototyping board allows you not only to specify a wav file as a signal source but will also write signals to a wav. This is really neat for analogue effects simulation!

Peak detector based Envelope Detector for fast response and low ripple


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s