Professional Documents
Culture Documents
Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
DAFX-1
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
in
Vo
out
− 9V 4.5V
bjt buf
Saturating nonlin Tone filter
it in the form shown in (1) allows the poles and zeros to be seen
more easily:
Figure 1: Non-inverting op amp gain
Zf Zs
Av (s) = +1 (1)
Zs Zf
2.2. Continuous time pole-zero analysis
2.4. Bilinear Transform of low order transfer functions
Linear circuits are described by rational transfer functions. For
Once a continuous time transfer function is obtained either by anal-
most low-cost audio circuits such as guitar effects, the transfer
ysis or by inspection of the magnitude response, the bilinear trans-
functions are typically low order. The poles and zeros can be iden-
form can be used to digitize this filter. First- and second-order
tified on a log-frequency plot of magnitude in dB. In dB, it can
continuous time systems are common, so their mappings are given
be seen that the magnitude contributions of poles subtract and the
below.
magnitude contributions of zeros add. For the low pass filter, at
The continuous time system,
the pole frequency, the magnitude is 3 dB lower than at its low
frequency asymptote. For the high pass filter, the magnitude at bn sn + ... + b1 s + b0
the pole frequency is 3 dB lower that at its high frequency asymp- H(s) = , (2)
an sn + ... + a1 s + a0
tote. Therefore, well separated pole and zero frequencies can be
identified from the decibel magnitude response by looking for the results in
3-dB points. These frequencies can then be used to reconstruct the
rational expression for the transfer function. B0 + B1 z −1 + ... + Bn z −n
H(z) = , (3)
A0 + A1 z −1 + ... + An z −n
2.3. Analysis of operational amplifier circuits where for a second order system, coefficients of H(z) are
Transfer functions can be easily found analytically for circuits with B0 = b0 + b1 c + b2 c2 , (4)
operational amplifiers (op amps). 2
B1 = 2b0 − 2b2 c , (5)
2
B2 = b0 − b1 c + b2 c , (6)
2.3.1. Ideal op amp approximation
A0 = a0 + a1 c + a2 c2 , (7)
The ideal op amp approximation states that if negative feedback is 2
present, A1 = 2a0 − 2a2 c , (8)
2
1. V+ = V− , A2 = a0 − a1 c + a2 c , (9)
2.3.2. Non-inverting configuration Here c = 2/T is chosen as typical for the bilinear transform.
An example of this analysis is done for the non-inverting op amp 3. CIRCUIT ANALYSIS OF DISTORTION PEDAL
configuration shown in Fig. 1. The ideal op amp rule gives V− =
Vi , so the current through Zs is Is = Vi /Zs . Because I− = 0, The block diagram of the Boss DS-1 Distortion pedal [12] is shown
all the current flows across Zf , so V0 = Vi + Is Zf = Vi + in Fig. 2. It is basically gain with a saturating nonlinearity sand-
Vi /Zs . After algebraic manipulation, the transfer function is found wiched between filters. However, distortion from the bipolar tran-
Z +Z
to be VVoi = sZs f . This results in a continuous time transfer sistor (BJT) emitter follower buffers and first gain stage are not
function if complex impedances are used for Zf and Zs . Writing negligible.
DAFX-2
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
−30
Figure 3: Input buffer: Emitter follower circuit.
−40
0 2 4 6
10 10 10 10
9V Frequency (Hz)
470k gainout
The bilinear transform applied to H(s) with a sampling rate
fs = 44.1 kHz gives a second order digital filter whose coeffi-
0.047u Q2
gainin cients can be found using (9).
2SC732TM This stage introduces significant nonlinearity at large inputs,
but this is neglected for now.
100k 22
DAFX-3
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
0.47u
op_in +
op_out
0.6
−
250p
100k
100k 0.4
Vo (Volts)
Zf
4.5V 4.7k
0
1u DC curve
Zs −0.2 tanh
atan
−0.4
Figure 6: Operational amplifier gain stage tanh approx
−0.6
30
first order D=1 −4 −2 0 2 4
Vi (Volts)
25
actual
Magnitude response (dB)
10
the device are model parameters that can be extracted from mea-
surement.
The nonlinear ODE of the diode can be derived from Kirch-
5
hoff’s laws:
0 1 dVo Vi − Vo Is
10
2
10 10
3 D=0
10
4 5
10
= − 2 (sinh(Vo /Vt )), (18)
dt RC C
Frequency (Hz)
where Vi , Vo are the input and output signals respectively.
Figure 7: Frequency response of op amp gain stage, D = 0 : 0.1 : This is not a memoryless nonlinearity because it is a low-pass
1 filter whose pole location changes with voltage. Fig. 10 depicts
the input-output characteristic, which can be described as a “clip-
R ping” function, along with various analytic approximations based
Vi Vo on hyperbolic tangent and arctangent. At high amplitude levels,
2.2k the differences between different clipping functions is subtle.
C For efficiency, this nonlinearity is approximated as static, and
N914 the DC transfer curve is computed by setting dV o
= 0 in (18),
0.01u dt
and tabulating the function Vo = f (Vi ) by Newton iteration. A
nonuniform sampling of the input to output transfer curve is used
that utilizes a constant error percentage or signal to quantization
noise ratio. The rationale for this is that at small amplitudes, the
Figure 8: RC low pass filter with diode limiter curve is most linear with the highest gain, and most susceptible to
quantization noise. At high levels, the nonlinearity is compressive,
reducing the gain and quantization error. A logarithmic sampling
with a floor about zero is chosen. Linear interpolation is used to
black box approach, the macromodeling technique emulates the
further reduce quantization noise.
input/output behavior of the op amp instead of simulating the be-
Alternatively an approximation such as
havior of its internal devices.
x
(19)
3.4. Diode clipper (1 + |x|n )1/n
Following the op amp clipper is a RC low pass filter with a diode can be used to compute the nonlinearity. This formula (19) well
limiter across the capacitor (Fig. 8). The diode clipper limits the approximates hyperbolic tangent when n = 2.5. The transfer
voltage excursion across the capacitor to about a diode drop in curve of the tabulated function is compared with that of tanh, arc-
either direction about signal ground. tan, and (19) in Fig. 9. The curves are normalized so that the slope
The model of the pn diode is about Vi = 0 matches visually and Vo at the extremes match. The
formula (19) can be seen to be a good approximation of tanh. Arc-
Id = Is (eV /Vt − 1), (17) tan looks like a close approximation to the actual DC nonlinearity
but it is not as linear about Vi = 0. The approximation (19) has the
where the reverse saturation current Is , and thermal voltage Vt of advantage of an additional parameter n that can be varied to better
DAFX-4
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
Vi R
Vo 0
because a user would not likely notice the difference in filter re-
match the actual function. In this work, the tabulated nonlinearity sponse.
is chosen. The magnitude response of the original circuit is compared
with the Matlab approximation in Fig. 12. The responses are very
3.5. Tone stage similar with < 1 dB error in most cases.
DAFX-5
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
1u 4.5V 4.5V
Vi + JRC4580
Vo 10k 100k
1k LEVEL out
10k Vi − Vi
Vi +
Vo
0.22u (1-T)20k Vi −
Cc 1u 1k
T*20k
0.22u
51p
Cz R2 220 1k
0.047u
51k + D*500k
4.7k R1 Figure 15: Overdrive tone circuit.
5
0
Figure 14: Clipping stage of overdrive pedal. −5
DAFX-6
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
1
0
Meas (dB)
0.5 −20
−40
0
−60
−0.5
−80
0 5 10 15 20
−1 Frequency (kHz)
0 2 4 6 8 10 0
Time (ms)
−20
Sim (dB)
Figure 17: Time response to 220 Hz sine, measured distortion −40
pedal (dashed) and algorithm (solid) −60
−80
0 5 10 15 20
0 Frequency (kHz)
Meas (dB)
−20
−40 Figure 20: Normalized spectrum of response to 220 Hz sine, over-
drive pedal (top), algorithm (bottom)
−60
−80
0 5 10 15 20 0
Frequency (kHz)
4 −10
0
−20 −20
Sim (dB)
3.5
−40 −30
Freq (log10)
−60 3
−40
−80
0 5 10 15 20 2.5 −50
Frequency (kHz)
2 −60
Figure 18: Normalized spectrum of response to 220 Hz sine, dis-
−70
tortion pedal (top), algorithm (bottom)
1.5
−80
0 1 2 3 4 5
Time (sec)
1
0.5 Figure 21: Measured distortion pedal, sine sweep log spectrogram
0
0
−0.5
4 −10
−1
−20
0 2 4 6 8 10 3.5
3
Figure 19: Time response to 220 Hz sine, measured overdrive −40
2 −60
DAFX-7
Proc. of the 10th Int. Conference on Digital Audio Effects (DAFx-07), Bordeaux, France, September 10-15, 2007
0
7. ACKNOWLEDGMENTS
4 −10
This work has been supported by the NSF and NDSEG graduate
−20 fellowships. Thanks to Digidesign for their critique and insightful
3.5
comments. Thanks to Boss and Ibanez for producing these unique
−30 music processing circuits and their impact on the guitar playing
Freq (log10)
3 world.
−40
DAFX-8