Next  |  Prev  |  Up  |  Top  |  REALSIMPLE Top


Phasing with First-Order Allpass Filters

The block diagram of a typical inexpensive phase shifter for guitar players is shown in Fig. 1.5It consists of a series chain of first-order allpass filters,6 each having a single time-varying parameter $ g_i(n)$ controlling the pole and zero location over time, plus a feedforward path through gain $ g$ which is a fixed depth control.

\begin{figure}\centering
\input fig/allpass1phaser.pstex_t
\\ {\LARGE Structure of a phaser based on four first-order allpass filters.}
\end{figure}

In analog hardware, the first-order allpass transfer function [#!JOSFP!#, Appendix C, Section 8]7is

$\displaystyle \hbox{AP}_{1}^{\,\omega_b} \mathrel{\stackrel{\Delta}{=}}\frac{s-\omega_b}{s+\omega_b}. \protect$ (4)

In discrete time, the general first-order allpass has the transfer function

$\displaystyle \hbox{AP}_{1}^{\,g_i} \mathrel{\stackrel{\Delta}{=}}\frac{g_i + z^{-1}}{1 + g_i z^{-1}}.
$

We now consider the analog and digital cases, respectively.

Classic Analog Phase Shifters

Setting $ s=j\omega$ in Eq.$ \,$(4) gives the frequency response of the analog-phaser transfer function to be

$\displaystyle H_a(j\omega) = \frac{j\omega-\omega_b}{j\omega+\omega_b}.
$

The phase response is readily found to be

$\displaystyle \Theta_i(\omega) = \pi - 2\tan^{-1}\left(\frac{\omega}{\omega_b}\right).
$

Note that the phase is always $ \pi$ at dc ($ \omega=0$), meaning each allpass section inverts at dc. Also, at $ \omega=\infty$ (remember we're talking about analog here), we get a phase of zero. In between, the phase falls from $ \pi$ to 0 as frequency goes from 0 to $ \infty$. In particular, at $ \omega=\omega_b$, the phase has fallen exactly half way, to $ \pi/2$. We will call $ \omega=\omega_b$ the break frequency of the allpass section.8

Figure [*]a shows the phase responses of four first-order analog allpass filters with $ \omega_b$ set to $ 2\pi[100,200,400,800]$. Figure [*]b shows the resulting normalized amplitude response for the phaser, for $ g=1$ (unity feedfoward gain). The amplitude response has also been normalized by dividing by 2 so that the maximum gain is 1. Since there is an even number (four) of allpass sections, the gain at dc is $ 1+(-1)(-1)(-1)(-1) = 1$. Put another way, the initial phase of each allpass section at dc is $ \pi$, so that the total allpass-chain phase at dc is $ 4\pi$. As frequency increases, the phase of the allpass chain decreases. When it comes down to $ 3\pi$, the net effect is a sign inversion by the allpass chain, and the phaser has a notch. There will be another notch when the phase falls down to $ \pi$. Thus, four allpass sections give two notches. For each notch in the desired response we must add two new allpass sections.

\epsfig{file=eps/phaser1a.eps,width=\textwidth }
(a) Phase reponses of first-order analog allpass sections with break frequencies at 100, 200, 400, and 800 Hz. (b) Corresponding phaser amplitude response.

From Fig. [*]b, we observe that the first notch is near $ f=100$ Hz. This happens to be the frequency at which the first allpass pole ``breaks,'' i.e., $ \omega=g_1$. Since the phase of a first-order allpass section at its break frequency is $ \pi/2$, the sum of the other three sections must be approximately $ 2\pi + \pi/2$. Equivalently, since the first section has ``given up'' $ \pi/2$ radians of phase at $ \omega=g_1=2\pi100$, the other three allpass sections combined have given up $ \pi/2$ radians as well (with the second section having given up more than the other two).

In practical operation, the break frequencies must change dynamically, usually periodically at some rate.

Classic Virtual Analog Phase Shifters

To create a virtual analog phaser, following closely the design of typical analog phasers, we must translate each first-order allpass to the digital domain. Working with the transfer function, we must map from $ s$ plane to the $ z$ plane. There are several ways to accomplish this goal [#!RabinerAndGold!#]. However, in this case, an excellent choice is the bilinear transform (see §[*]), defined by

$\displaystyle s \leftarrow c\frac{z-1}{z+1} \protect$ (5)

where $ c$ is chosen to map one particular frequency to exactly where it belongs. In this case, $ c$ can be chosen for each section to map the break frequency of the section to exactly where it belongs on the digital frequency axis. The relation between the analog and digital frequency axes follows immediately from Eq.$ \,$(5) as

\begin{eqnarray*}
j\omega_a &=& c\frac{e^{j\omega_d T}-1}{e^{j\omega_d T}+1}\\
...
...sin(\omega_dT/2)}{\cos(\omega_dT/2)}\\
&=& jc\tan(\omega_dT/2).
\end{eqnarray*}

Thus, given a particular desired break frequency $ \omega_a=\omega_d=\omega_b$, we can set

$\displaystyle c = \omega_b\cot(\omega_bT/2).
$

Recall from Eq.$ \,$(4) that the transfer function of the first-order analog allpass filter is given by

$\displaystyle H_a(s) = \frac{s-\omega_b}{s+\omega_b}
$

where $ \omega_b$ is the break frequency. Applying the general bilinear transformation Eq.$ \,$(5) gives

\begin{eqnarray*}
H_d(z) &=& H_a\left(c\frac{1-z^{-1}}{1+z^{-1}}\right)
= \frac...
...
&\mathrel{\stackrel{\Delta}{=}}& \frac{p_d-z^{-1}}{1-p_dz^{-1}}
\end{eqnarray*}

where we have denoted the pole of the digital allpass by

$\displaystyle p_d\mathrel{\stackrel{\Delta}{=}}\frac{c-\omega_b}{c+\omega_b} = ...
.../2)-1}{\cot(\omega_bT/2)+1}
= \frac{1-\tan(\omega_bT/2)}{1+\tan(\omega_bT/2)}.
$

Figure [*] shows the digital phaser response curves corresponding to the analog response curves in Fig. [*]. While the break frequencies are preserved by construction, the notches have moved slightly, although this is not visible from the plots. An overlay of the total phase of the analog and digital allpass chains is shown in Fig. [*]. We see that the phase responses of the analog and digital alpass chains diverge visibly only above 9 kHz. The analog phase response approaches zero in the limit as $ \omega_a\to\infty$, while the digital phase response reaches zero at half the sampling rate, $ 10$ kHz in this case. This is a good example of when the bilinear transform performs very well.

\epsfig{file=eps/phaser1d.eps,width=\textwidth }
(a) Phase reponses of first-order digital allpass sections with break frequencies at 100, 200, 400, and 800 Hz, with the sampling rate set to 20,000 Hz. (b) Corresponding phaser amplitude response.

\epsfig{file=eps/phaser1ad.eps,width=\textwidth }
Phase reponse of four first-order allpass sections in series -- analog and digital cases overlaid.

Fig. [*] below 10 kHz can be largely eliminated by increasing the sampling rate by 15% or so. See the case of digitizing the Moog VCF for an example in which the presence of feedback in the analog circuit leads to a delay-free loop in the digitized system [#!StilsonAndSmithMoogVCF!#,#!StilsonT!#].


Next  |  Prev  |  Up  |  Top  |  REALSIMPLE Top

Download DelayVar.pdf
Download DelayVar_2up.pdf
Download DelayVar_4up.pdf

``Time Varying Delay Effects'', by Julius O. Smith III and Nelson Lee,
REALSIMPLE Project — work supported by the Wallenberg Global Learning Network .
Released 2008-06-05 under the Creative Commons License (Attribution 2.5), by Julius O. Smith III and Nelson Lee
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA