Op-amp rails and headroom: why it clips
An op-amp's output can't swing past its supply rails, so running a pedal at 18 V instead of 9 V doubles its swing, from ±4.5 V to ±9 V: 6 dB more headroom before it clips. With a gain of 10, clipping moves from 0.45 V in to 0.9 V.
circuit Headroom setting input: 0.5 V, from 0.05 V to 2 V setting output: 12 V setting gain: 90k, from 10k to 470k Cin in b 100n Rb b gnd 1M U1 b m o opamp rails 4.5V Rg m gnd 10k Rf o m gain Cout o out 1u Rl out gnd 100kendPress Play to see the wave after the circuit, at out.
What you're hearing
An op-amp's output stops at its rails. The rails are the highest and lowest voltages its output can reach, set by its power supply. This stage is the non-inverting amp from the op-amp's two rules: its gain is 1 + Rf/Rg = 1 + 90 kΩ / 10 kΩ = 10, 20 dB. Rule 1 says the op-amp drives its output until its inputs match, but it can't drive past a rail. With ±4.5 V rails, the most it can put out is 4.5 V, so anything over 4.5 V / 10 = 0.45 V in comes out flat-topped. Above that, more input changes the shape, not the height.
Headroom is the room left above the peaks. It's the gap between a signal's peak and the rail, in dB: 20 log (rail / peak). At the input's setting, 0.5 V, the clean output would peak at 5 V. The ±4.5 V rails are 0.9 dB short of that, so the 9 V version clips: its output sits flat on a rail for over a quarter of each cycle. The ±9 V rails leave 20 log (9 / 5) = 5.1 dB to spare, so the 18 V version stays clean.
Doubling the supply adds 6 dB. Twice the rail is 20 log 2 = 6.0 dB more headroom at any gain: everything clips at twice the input. Where each version starts to clip:
| gain (Rf) | 9 V: ±4.5 V | 18 V: ±9 V | 9 V off-centre: −3 V, +6 V |
|---|---|---|---|
| 2, 6.0 dB (10 kΩ) | 2.25 V in | 4.5 V in | 1.5 V in (bottom first) |
| 10, 20.0 dB (90 kΩ) | 0.45 V in | 0.9 V in | 0.3 V in |
| 48, 33.6 dB (470 kΩ) | 93.8 mV in | 187.5 mV in | 62.5 mV in |
The input knob stops at 2 V, so at a gain of 2 neither centred version clips. This is the op-amp shown as ideal, swinging all the way to its supply, which is called rail-to-rail. Many op-amps stop short of their supply, so a 9 V pedal's often swings more like ±4 V (the figure the hard and soft clipping page uses). The gain from 18 V is then still about 6 dB.
Hitting the rails is hard clipping. The output runs straight up to the rail and stops, with a sharp corner. That corner makes strong high harmonics, the buzzy, fizzy sound of hard clipping. The engine rounds the last few millivolts: at 0.45 V in, the output is 4.492 V, 8 mV short of the rail, and by 0.46 V it's within 0.05 mV. To the ear it's a hard ceiling. The 18 V version at 1 V in clips in exactly the same shape as the 9 V version at 0.5 V, twice as big.
Why bias at 4.5 V. A 9 V pedal has one supply, 0 V to 9 V, but a sound swings both ways. So the circuit sits the op-amp at half the supply, 4.5 V, usually from two equal resistors across the battery, the sum on the voltage divider page. From there it has 4.5 V of room up and 4.5 V down: ±4.5 V. At 18 V the bias is 9 V, and the room is ±9 V. The parts list is drawn around that bias point: its ground stands for the 4.5 V. The capacitors on the way in and out, 100 nF and 1 µF, keep the bias off the input and output jacks while the sound passes. With 1 MΩ and 100 kΩ after them, each one's corner is 1/(2π × 1 MΩ × 100 nF) = 1/(2π × 100 kΩ × 1 µF) ≈ 1.6 Hz, far below any note.
Off-centre, the nearer rail decides. Bias the same 9 V pedal at 3 V instead (say, 20 kΩ over 10 kΩ across the battery: 9 V × 10 / 30 = 3 V). It now has 6 V of room up but only 3 V down, and the bottom of the wave clips first, at 0.3 V in: 20 log (3 / 4.5) = 3.5 dB less headroom than biased at the centre. At 0.5 V in, only the bottom flattens, and the two halves of the wave no longer match. That adds even harmonics, 2, 4 and 6 times the note's frequency, which clipping both halves alike never makes. The flattened bottom also lifts the wave's average, and the output capacitor takes it back out: at 0.5 V in the peaks come out at about +4.6 V and −3.4 V.
So does 18 V give more headroom? Yes, for a stage like this one: 6 dB more before the op-amp clips. A pedal that's meant to break up at the rails breaks up less, and a clean boost stays clean for louder playing. If a pedal clips with diodes instead, as in op-amp overdrive, the diodes cap the output long before the rails, and the supply mostly changes little. Only run a pedal at 18 V if it's made for it. The op-amp here is ideal in everything but its rails: a real one also can't change its output instantly, as slew rate and the real-world op-amp shows.
Try this
- Switch between "9 V pedal" and "18 V pedal" on a held note. The 9 V version's tops are flat on the Scope and it sounds a little rougher; the 18 V version is round and clean. Turn input up to 0.9 V and the 18 V version starts to flatten too.
- Turn gain to 470 kΩ, then input down to about 0.1 V. At a gain of 48 the 9 V version clips from 93.8 mV in, the 18 V one from 187.5 mV. More gain eats headroom just as a louder input does.
- Press "9 V, biased off-centre" and watch the Scope. Only the bottom flattens, and the sound gets a thicker, warmer edge from the even harmonics. Open it in SynthMaker to change the parts: try
rails -2V 7Vfor a bias nearer the bottom rail still.
The parts list
circuit Headroom setting input: 0.5 V, from 0.05 V to 2 V setting output: 12 V setting gain: 90k, from 10k to 470k Cin in b 100n Rb b gnd 1M U1 b m o opamp rails 4.5V Rg m gnd 10k Rf o m gain Cout o out 1u Rl out gnd 100kendThe other two versions change only the rails: rails 9V, and rails -3V 6V. setting output: 12 V makes 12 V at the output full volume, so even the ±9 V version has room.
How we checked it
Checked against ngspice, a standard circuit simulator: the whole circuit, coupling capacitors included, with each of the three supplies, driven by a 1 kHz sine, is within 0.05% of ngspice across the audible band at the 2× rate it runs at.
Build it step by step
- The lesson: A screaming synth filter, built from parts (opens in a new tab). Its amplifier is a gain stage of about 58 with
rails 12V, and two diodes in its feedback catch the filter's resonance. - The video: Build a screaming 70s synth filter from 11 parts: a real circuit, simulated. It loads only when tapped.
Next and previous
Further reading
- An op-amp's output limits and its gain: Wikipedia: Operational amplifier.
- Headroom in dB: Wikipedia: Headroom (audio signal processing)).
- What clipping does to a wave: Wikipedia: Clipping (audio)).
- Running op-amps from one supply around a middle point: Wikipedia: Virtual ground.
- Capacitors that pass the sound and block the bias: Wikipedia: Capacitive coupling.
- D. T. Yeh, "Digital Implementation of Musical Distortion Circuits by Analysis and Simulation", PhD thesis, Stanford University, 2009 (the DK method, used to simulate this circuit). PDF