Filters and Feedback

Transforms

To analyze circuits there are several commonly used mathematical transforms used, which are all related to the Fourier transform. There are several slightly different common definitions of the Fourier transform; we prefer the more symmetric one:

\hat{f}(w) = \frac{1}{\sqrt{2 \pi}}\int_{\infty}^{\infty} f(t) e^{-i w t} dt

which has the inverse

f(t) = \frac{1}{\sqrt{2 \pi}}\int_{\infty}^{\infty} \hat{f}(w) e^{i w t} dt

For discrete signals, which EE people often denote as x[n] instead of the mathematician's x_n, the z-transform is

X(z) = \sum_{-\infty}^{\infty} x[n] z^{-n}

which can be viewed as a kind of generating function. The variable z is considered to be in the complex plane, and it is useful to consider it in an exponential form: z = e^{sT} where s is complex and T is real and positive. One reason exponentials are useful in this context is that they are eigenvectors (eigen-sequences?) of the delay operator: if x[n] = e^{n s T}, then x[n-1] = e^{(n-1) s T} = e^{-sT} x[n] = z^{-1} x[n], just as exponentials are eigenfunctions of the differentiation operator in the continuous case (i.e. $\frac{d}{dt} e^{kt} = k e^{kt}).

In many applications we mainly care about the magnitude of each frequency component, in which cases it can be helpful to know that the spectral power density S(f) = |\hat{f}|^2 is the Fourier transform of the autocorrelation function R(f) = \int_{\infty}^{\infty} \bar{f}(\tau) f(\tau + t) d\tau.

Although we could consider complex frequencies w in the Fourier transform it is customary to instead use the Laplace transform:

\mathcal{L}(f(t)) = F(s) = \int_0^{\infty} e^{-st} f(t) dt

where s is viewed as a complex variable. The above definition is the one-sided Laplace transform, but we could instead integrate from -\infty to \infty instead. In signal processing applications we often consider the past values of a signal to be zero, in which case the two definitions given the same results.

Audio filters in subtractive synthesis

In the subtractive synthesis model of sound design, we start with a periodic signal that has significant amplitudes of component sinusoids (harmonics), and then carve out or amplify some portions of the frequency spectrum using filters. The most common periodic signals to use are triangle waves, square waves, and sawtooth waves (ramps), in increasing order of harmonic density. The Fourier expansion of unit amplitude waves of these types are show below along with animations showing the first 40 approximating sums

x_{tri} = \frac{8}{\pi^2} \sum_{k=1}^{\infty} (-1)^k \frac{\sin((2k-1) w t)}{(2k-1)^2}
Triangle wave approximations
Triangle wave approximations by sinusoids
x_{sqr} = \frac{4}{\pi} \sum_{k=1}^{\infty} \frac{\sin((2k-1) w t)}{2k-1}
Square wave approximations
Square wave approximations by sinusoids
x_{saw} = \frac{2}{\pi} \sum_{k=1}^{\infty} (-1)^k \frac{\sin(k w t)}{k}
Saw wave approximations
Saw wave approximations by sinusoids

For the square and saw waves we can see the Gibbs phenomenon in which the discontinuities produce a consistent over- and under-shooting no matter how many approximating sines are used (although the width shrinks).

The Moog Ladder Circuit

In 1966 the engineer and inventor Robert Moog filed a patent for a new resonant lowpass filter design, which is now known as the Moog ladder filter. Note the core low-pass filter section from the main diagram of his patent shown below.

Moog ladder circuit
Circuit diagram from the original Moog patent

The circuit is somewhat complicated because of its use of the eight transistors and four capacitors. However, in the regime of currents and voltages in which it is used it is possible to obtain a fairly good linearization.

The linearized equations for the voltages y_i in each stage, with input x(t), cutoff parameter \alpha, and resonance parameter r are

y_1' = \alpha (x - y_1 - r y_4)
y_2' = \alpha (y_1 - y_2 )
y_3' = \alpha (y_2 - y_3 )
y_4' = \alpha (y_3 - y_4 )

or in matrix form

y' = \alpha \left( \begin{array}{rrrr} -1 & 0 & 0 & -r \\ 1 & -1 & 0 & 0 \\ 0 & 1 & -1 & 0 \\ 0 & 0 & 1 & -1 \end{array} \right ) + \alpha \left( \begin{array}{r} x \\ 0 \\ 0 \\ 0 \end{array} \right )

When the resonance parameter r is zero, the coefficient matrix A has only one eigenvalue \lambda equal to -\alpha, of multiplicity four.

The characteristic equation is (\lambda + \alpha)^4 + r \alpha^4, so

\lambda_k = -\alpha (1 + r^{1/4} e^{\frac{i k \pi}{4}} )

As the resonance parameter r is increased, the four eigenvalues (poles of the transfer function) separate, and two of them approach the complex axis. This creates a strong amplification of some frequencies, while the lowest frequencies become farther from the poles and their amplitude drops.

Comb filters and Karplus-Strong synthesis

With digital signals it is not difficult to use a relatively long delay in a feedback loop. This results in a comb filter with many resonances at multiples of some fundamental frequency. If the feedback loop is given a brief pulse of noisy input, the resulting reinforcement of the resonances over time resembles the sound of plucked string instruments. The simplest implementations of this are known as Karplus-Strong string synthesis. The timbre of the sound can be further refined and manipulated by putting a filter (usually a lowpass filter) in the delay line.

License

Creative Commons License


This work (text, mathematical images, and javascript applets) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Biographical images are from Wikipedia and have their own (similar) licenses.