eCircuit  Center


About SPICE | SPICE Basics | Running SPICE | CIRCUIT COLLECTION | SPICE Commands | SPICE Demos and Downloads
About Us | Contact Us | Home



Guitar Effects - Distortion Box


OP_DISTORTION_1.CIR    Download the SPICE file

Whether you're a guitar player or a music appreciator, there's something satisfying about hearing a crunching chord or cutting riff played through a distortion box. But, what does a distorted signal look like? It’s basically the original wave shape with the negative and positive peaks clipped. How is this accomplished? Back in the early days of rock music, you clipped the waveform by cranking up the amplifier volume until the signal peaks would hit the rails of the tube amplifiers. Unfortunately, this required the maximum volume to achieve this awesome effect. Ultimately, circuit designers found ways to create the distorted sound at a very low signal level, allowing the guitarist to achieve their crunch at any level.

In many distortion boxes, waveform clipping is accomplished using back-to-back silicon diodes. These diodes have a gradual turn on characteristic that produces “soft” clipping. The resulting waveform looks like the peaks are gradually compressed as the signal level is increased creating the same sound as an overdriven tube amplifier. One great advantage here is that diodes begin to conduct around 500 mV. This is small enough to be accomplished at low levels before the signal reaches the amplifier!

The amplifier above (based on the Ibanez Tube Screamer) has three main functions

Amplify - Increase the signal amplitude
Filter - Boost the mid frequencies
Clip – Compress the positive and negative peaks of signals

Gain is needed to boost the 100mV signal to a level that will forward bias the diodes at 500mV. The max gain available at mid-band is defined by

K = R2’/R1+1

where R2 represents a fixed resistor and a potentiometer for a total resistance of R2’=R2+R3. The pot is really the “drive” knob on the box. If R3 is fully CCW, then R2’=51k+0=51k. Alternately, if R3 is fully CW, then R2’ = 51k+500k=551k.

The gain versus frequency of the amplifier looks like a high pass filter boosting the mid frequencies. Why? Some musicians found this pre-filtering to the clipping stage gives a pleasing sound. Various distortion boxes distinguish their sound from others by their unique pre and post filtering that shapes the overall sound.

The components C1 and R2’ create a zero fz (high-pass filter) and R1, C1 create a pole fp (low-pass filter) defined by

fz1 = 1/(2*pi*R2’*C1) 
fp1 = 1/(2*pi*R1*C1)

C2 and R2’ create another pole at

fp2 = 1/(2*pi*R2’*C2)

At the adjustment extremes of the drive pot you get

  R3 R2' K (V/V) fz1 fp1 fp2
  Fully CCW 51k 12 66 Hz 720 Hz 61000 Hz
  Fully CW 551k 120 6 Hz 720 Hz 5700 Hz

As you can see, more drive (R3 fully CW) means a gain that's higher and a mid boost that's shifted down in frequency (a lower zero fz1 and pole fp2). The gain versus frequency can be divided into four sections.

  Section Frequency Comment
  Low Frequency Flats f < fz1 A flat gain of 1 (0dB).
  Low Frequency Rise fz1 < f < fp1 Gain rises at +20dB/dec
  Mid-Frequency Flats
 fp1 < f < fp2 Pole fp1 cancels out zero fz1 to create a plateau of high gain K at mid frequencies.
  High Frequency Fall f > fp2 Gain falls at -20dB/dec.

As the amplified signal approaches +/-0.5V, on of the diodes begin to conduct sufficiently to lower the effective resistance in parallel with R2 and R3. This effectively lowers the gain of the amplifier. The greater the signal, the greater the conduction and lower the gain. The overall effect is an output waveform with peaks that appear clipped because of the reduced gain beyond 0.5V.

 CIRCUIT INSIGHT   Let’s check out the frequency response for the min/max settings of the drive pot. With R3=5k (min setting), run an AC_ANALYSIS of the file OP_DISTORTION_1.CIR and plot the output at V(5). You should see the gain follow four distinct areas described in the table above. Where does the gain begin to rise? Is it close to 66 Hz as expected? Check the maximum gain. Did it reach near 12 (22 dB)?

Now set R3=500k (max setting) and rerun the simulation. How does this setting change the response? Did the response begin to rise at a lower frequency (~6 Hz) as expected and did it reach a higher gain (120 or 42dB)?

The first time I ran this I said hold on! Shouldn’t the diodes have clipped the signal at some point? Turns out, SPICE replaces the diode with an AC equivalent circuit - high impedance for an OFF diode at the operating point. This high impedance has little effect on the AC response. And, regardless of the signal’s magnitude at VS, SPICE computes the analysis using the same small signal AC equivalent model.

 CIRCUIT INSIGHT  To see the clipper in action, run a TRANSIENT ANALYSIS by commenting out the AC statement (add an * before the .AC statement) and enabling the transient analysis (removing the * before the .TRAN statement.) Run the simulation with low drive (R3=5k) and set VS to 100 Hz. Then plot the input V(1) and output V(5). Is there any visible clipping of the signal?

Rerun the analysis with VS at 200 Hz and 400 Hz. At what frequency does the high-pass filter boost the signal sufficiently to start the diodes clipping?

Now crank up the drive knob (R3=500k) and repeat the analysis for 100 Hz, 200Hz and 400 Hz? At what frequency does the clipping begin? How does the severity of the clip change at 400 Hz?

 CIRCUIT APPLICATION   One of the coolest features about Linear Technology’s LTSPICE lies in its ability to LOAD and SAVE a WAV file! This gives you the ability load a sound bite, apply your effects processing and then save the output to hear the result. How? Simply add the “wavefile” parameter to your voltage source.
                   VS 1 0 AC 1 wavefile=.\guitar2a.wav chan=0

A resistor divider (RL1, RL2) was added to reduce the output to be approximately equal to the input for sound comparison purposes. To save the divider output at V(7), add the line

                   .wave .\guitar2_out.wav 16 44100 V(7)

to a write the *.wav file using 16 bit resolution and a sampling period of 44100 samples per second. Now you can start your media player and listen to your effects box output.

Here's a sample of a clean and processed guitar sound you can download.




Download the file or copy this netlist into a text file with the *.cir extention.

* op_distortion_1.cir
VS	1	0	AC	1	SIN(0V 100MV 100Hz)
*VS	1	0	AC	1	wavefile=.\guitar2a.wav chan=0
RS	1	3	1K
R1	2	6	4.7K
C1	6	0	0.047Uf
R2	2	4	51K
R3	4	5	5k
C2	2	5	51PF
D1	2	5	D1N4148
D2	5	2	D1N4148
XOP1	3 2	5	OPAMP1
RL1	5	7	5k
RL2	7	0	5k
*.wave .\guitar2a_output.wav 16 44100 V(7)
* Save node V(7) as a *.wav file, 16 bit resolution, 44100 samples per second
.model	D1N4148	D(Is=0.1p Rs=16 CJO=2p Tt=12n Bv=100 Ibv=0.1p)
* connections:      non-inverting input
*                   |   inverting input
*                   |   |   output
*                   |   |   |
.SUBCKT OPAMP1	    1   2   6
RIN	1	2	10MEG
EGAIN	3 0	1 2	1000K
RP1	3	4	1K
CP1	4	0	15.9UF
EBUFFER	5 0	4 0	1
ROUT	5	6	10
* ANALYSIS *************************************
.TRAN 	0.1MS  30MS
*.TRAN 	10MS  5S
*.ac dec 40 1 1000k


© 2012 eCircuit Center