Allpass Transformations

Lecture 3 · Mapping the frequency axis: lowpass to lowpass, highpass and bandpass

Dr.-Ing. Maximilian Schäfer · Prof. Dr.-Ing. Sebastian J. Schlecht

Where we are

One question, asked of every method

Block Representation Generator
Filters and effects LTI and time-varying systems hand-designed
Classical synthesis samples, partials, modes, physical state hand-designed
DDSP the same structured models parameters learned
Reverberation a recursive dynamical system hand-designed, fittable
Diffusion a learned representation learned

 

The four questions

  1. How is the sound represented?
  2. What are the controllable parameters?
  3. What structure is built in?
  4. What is fixed by design, and what is learned?

Filters and effects, part 2 of 5. Last time: analog prototypes and the bilinear transformation. Today: allpass transformations, which warp the frequency axis of a discrete filter by one or two coefficients.

Allpass Transformations

Allpass Transformations From the bilinear to the allpass transformation

Bilinear transformation:

\[\begin{array}{rcl}\displaystyle \text{continuous-time} &\displaystyle \rightarrow &\displaystyle \text{discrete-time}\\[0.5ex]\displaystyle s^{-1} &\displaystyle \rightarrow &\displaystyle \dfrac{T}{2}\,\dfrac{z+1}{z-1}\\[1ex]\displaystyle \text{integrator} &\displaystyle \rightarrow &\displaystyle \text{discrete approximation with trapezoidal rule} \end{array}\]

Allpass transformations:

\[\begin{array}{rcl}\displaystyle \text{discrete-time} &\displaystyle \rightarrow &\displaystyle \text{discrete-time}\\[0.5ex]\displaystyle z^{-1} &\displaystyle \rightarrow &\displaystyle A(z)\\[0.5ex]\displaystyle \text{delay} &\displaystyle \rightarrow &\displaystyle \text{allpass} \end{array}\]

Reactance transformations:

\[\begin{array}{rcl}\displaystyle \text{continuous-time} &\displaystyle \rightarrow &\displaystyle \text{continuous-time}\\[0.5ex]\displaystyle s^{-1} &\displaystyle \rightarrow &\displaystyle A(s)\\[0.5ex]\displaystyle \text{integrator} &\displaystyle \rightarrow &\displaystyle \text{continuous allpass} \end{array}\]

(historical procedure to design analog filters)

Allpass Transformations Mapping the \(z\)-plane onto itself

Allpass Transformations

Mapping of the complex \(z\)-plane
onto itself

according to \(\displaystyle z=\frac{1}{A\left(\zeta\right)}\)

Unit circles of the z-plane and the zeta-plane.

unit circle of the \(z\)-plane \(\displaystyle z=e^{j\Omega_z}\:,\) \(\displaystyle 0\le\Omega_z<2\pi\)
unit circle of the \(\zeta\)-plane \(\displaystyle \zeta=e^{j\Omega_\zeta}\:,\) \(\displaystyle 0\le\Omega_\zeta<2\pi\)

\(A(\zeta)\) allpass: \(\bbox[#eef2f8,6px,border:1.5px solid #215293]{\displaystyle \left|A\left(e^{j\Omega_\zeta}\right)\right|=1}\)

Which region of the \(z\)-plane is mapped to the unit circle of the \(\zeta\)-plane?
\(\dfrac{1}{\left|A\left(e^{j\Omega_\zeta}\right)\right|} = \left|z\right|=1\): the unit circle of the \(z\)-plane is mapped to the unit circle of the \(\zeta\)-plane!

Warping of the frequency axis \(\displaystyle\Omega_z\rightarrow\Omega_\zeta\)

\(\displaystyle A\left(e^{j\Omega_\zeta}\right)=e^{-jb\left(\Omega_\zeta\right)}\), \(\displaystyle e^{j\Omega_z}=\frac{1}{A\left(e^{j\Omega_\zeta}\right)}=e^{jb\left(\Omega_\zeta\right)}\)

Mapping of the unit circle: \(\bbox[#eef2f8,6px,border:1.5px solid #215293]{\displaystyle \Omega_z=b\left(\Omega_\zeta\right)}\)

Allpass Transformations Allpass of degree 1 (lowpass-lowpass-transformation)

\(\displaystyle A(\zeta)=\frac{\alpha\zeta+1}{\zeta+\alpha}=\alpha\frac{\zeta+\frac{1}{\alpha}}{\zeta+\alpha}\),

The following relations are equivalent:

\(\displaystyle z = \frac{\zeta+\alpha}{\alpha\zeta+1}\:,\qquad\zeta=\frac{z-\alpha}{1-\alpha z}\:,\qquad\frac{z-1}{z+1}=\frac{1-\alpha}{1+\alpha}\cdot\frac{\zeta-1}{\zeta+1}\)
fix-points: \(\displaystyle z=\zeta=\pm 1\)

\[\begin{array}{rcl}\displaystyle \Omega_z=0 &\displaystyle \rightarrow &\displaystyle \Omega_\zeta=0\\\displaystyle \Omega_z=\pi &\displaystyle \rightarrow &\displaystyle \Omega_\zeta=\pi \end{array}\]

Mapping of the unit circle \[\begin{aligned} \dfrac{e^{j\Omega_z}-1}{e^{j\Omega_z}+1} &= \dfrac{1-\alpha}{1+\alpha}\cdot \dfrac{e^{j\Omega_\zeta}-1}{e^{j\Omega_\zeta}+1} & \tan\dfrac{\Omega_z}{2} &= \dfrac{1-\alpha}{1+\alpha}\; \tan\dfrac{\Omega_\zeta}{2} \\[2ex] \Omega_z &= 2\arctan\left(\dfrac{1-\alpha}{1+\alpha}\tan\dfrac{\Omega_\zeta}{2}\right) & \Omega_\zeta &= 2\arctan\left(\dfrac{1+\alpha}{1-\alpha}\tan\dfrac{\Omega_z}{2}\right) \end{aligned}\]

Allpass Transformations Illustration

Unit circle with the frequencies Omega_z and Omega_zeta and their tangent values tan(Omega_z/2) and (1+alpha)/(1-alpha) tan(Omega_z/2).

Designation lowpass-lowpass-transformation because \(\displaystyle \Omega_z=0\rightarrow\Omega_\zeta=0\)

The parameter \(\alpha\) controls the frequency warping \[\begin{array}{rcl}\displaystyle \alpha>0 &\displaystyle \Omega_\zeta\ge\Omega_z &\displaystyle \\\displaystyle \alpha<0 &\displaystyle \Omega_\zeta\le\Omega_z &\displaystyle \\\displaystyle \alpha=0 &\displaystyle \zeta=z \end{array}\]

The frequency mapping, plotted

Frequency mapping of the lowpass-lowpass allpass transformation: Omega_zeta over Omega_z for alpha = -0.7, -0.5, 0 and 0.5.

 

The lowpass-lowpass transformation moves every frequency \(\Omega_z\) of the prototype to \[\tan\frac{\Omega_\zeta}{2} = \frac{1+\alpha}{1-\alpha}\,\tan\frac{\Omega_z}{2}\]

  • \(\alpha > 0\): \(\Omega_\zeta \ge \Omega_z\)
  • \(\alpha < 0\): \(\Omega_\zeta \le \Omega_z\)
  • \(\Omega = 0\) and \(\Omega = \pi\) stay where they are: a lowpass stays a lowpass

The polar plots on the next slides show the same curves: points equally spaced on the \(z\) circle crowd together where the curve is flat.

Allpass Transformations Lowpass-lowpass: the whole unit circle

Polar plots: equally spaced points on the whole unit circle of the z-plane and their images in the zeta-plane for alpha = -0.5, 0.5 and -0.7.

Allpass Transformations Lowpass-lowpass: the passband \(|\Omega_z| \le \pi/2\)

Polar plots: points of the passband of the unit circle of the z-plane (|Omega_z| up to pi/2) and their images in the zeta-plane for alpha = -0.5, 0.5 and -0.7.

Allpass Transformations Allpass of degree 1 (lowpass-highpass-transformation)

\(\displaystyle A(\zeta)=-\frac{\alpha\zeta+1}{\zeta+\alpha}\),

The following relations are equivalent:

\[\displaystyle z=-\frac{\zeta+\alpha}{\alpha\zeta+1}\:,\qquad \zeta=-\frac{z+\alpha}{\alpha z+1}\:,\qquad \frac{z+1}{z-1}=\frac{1-\alpha}{1+\alpha}\cdot\frac{\zeta-1}{\zeta+1}\]

\[\begin{array}{rcl}\displaystyle z=1 &\displaystyle \rightarrow &\displaystyle \zeta= -1\\\displaystyle z=-1 &\displaystyle \rightarrow &\displaystyle \zeta=1 \end{array}\]

\[\begin{array}{rcl}\displaystyle \Omega_z=0 &\displaystyle \rightarrow &\displaystyle \Omega_\zeta=\pi\\\displaystyle \Omega_z=\pi &\displaystyle \rightarrow &\displaystyle \Omega_\zeta=0 \end{array}\]

Mapping of the unit circle \[\begin{aligned} \frac{e^{j\Omega_z}+1}{e^{j\Omega_z}-1} &= \frac{1-\alpha}{1+\alpha}\cdot \frac{e^{j\Omega_\zeta}-1}{e^{j\Omega_\zeta}+1} & \frac{1}{j}\cot\frac{\Omega_z}{2} &= j\frac{1-\alpha}{1+\alpha}\tan\frac{\Omega_\zeta}{2} \\[2ex] \Omega_z & = 2\,\mathrm{arccot}\left(-\frac{1-\alpha}{1+\alpha}\tan\frac{\Omega_\zeta}{2}\right) & \Omega_\zeta & = 2\arctan\left(-\frac{1+\alpha}{1-\alpha}\cot\frac{\Omega_z}{2}\right) \end{aligned}\]

Allpass Transformations Lowpass-highpass transformation

Polar plots of the lowpass-highpass transformation: points of the z-plane unit circle and their images for alpha = -0.5, 0.5 and -0.7.

Allpass Transformations Allpass of degree 2 (lowpass-bandpass-transformation)

\[\displaystyle z=-\frac{\zeta^2+c_1\zeta+c_0}{c_0\zeta^2+c_1\zeta+1}=-\frac{\zeta^2+\beta(1-\alpha)\zeta-\alpha }{-\alpha\zeta^2+\beta(1-\alpha)\zeta+1}\] Interpretation as two stages of transformations

  1. lowpass-lowpass-transformation
    \(\displaystyle z=\frac{\zeta_1+\alpha}{\alpha\zeta_1+1}\:,\qquad |\alpha|<1\:,\qquad\Omega_{\zeta_1}=2\arctan\left(\frac{1+\alpha}{1-\alpha}\tan\frac{\Omega_z}{2 }\right)\)

  2. transformation of degree 2
    \(\displaystyle \zeta_1=-\frac{\zeta\left(\zeta+\beta\right)}{\beta\zeta+1}\:,\qquad |\beta|<1\)

\[\begin{array}{l}\displaystyle \displaystyle \beta\zeta_1\zeta+\zeta_1 = -\zeta^2-\beta\zeta\\[2mm]\displaystyle \zeta^2+\zeta_1 = -\beta\zeta_1\zeta-\beta\zeta\qquad\big|\zeta^{-1}\zeta_1^{-1/2}\\[2mm]\displaystyle \zeta\zeta_1^{-1/2}+\left[\zeta\zeta_1^{-1/2}\right]^{-1}=-\beta\left[\zeta_1^{1/2}+\left(\zeta_1^{1/2}\right)^{-1}\right]\end{array}\]

Allpass Transformations Lowpass-bandpass: center frequency

On the respective unit circles \[\begin{array}{rcl}\displaystyle e^{j\left(\Omega_\zeta-\frac{1}{2}\Omega_{\zeta_1}\right)}+e^{-j\left(\Omega_\zeta-\frac{1}{2} \Omega_{\zeta_1}\right)} &\displaystyle = &\displaystyle -\beta\left[ e^{j\frac{1}{2}\Omega_{\zeta_1}}+e^{-j\frac{1}{2}\Omega_{\zeta_1}}\right]\\\displaystyle \cos\left(\Omega_\zeta-\frac{\Omega_{\zeta_1}}{2}\right) &\displaystyle = &\displaystyle -\beta\cos\frac{\Omega_{\zeta_1}}{2}\\\displaystyle \Omega_\zeta-\frac{\Omega_{\zeta_1}}{2} &\displaystyle = &\displaystyle \pm\arccos\left(-\beta\cos\frac{\Omega_{\zeta_1}}{2}\right) \end{array}\]

\(\pm\) :

\(\cos\) period \(2\pi\)
\(\arccos\) period \(\pi\)

\[\begin{array}{l}\displaystyle \displaystyle \Omega_\zeta=\frac{\Omega_{\zeta_1}}{2}\pm\arccos\left(-\beta\cos\frac{\Omega_{\zeta_1}}{2} \right)\\[1ex]\displaystyle \Omega_z=0\rightarrow\Omega_{\zeta_1} =0\rightarrow\Omega_\zeta=\pm\arccos(-\beta)\end{array}\] The lowpass turns into a bandpass, the parameter \(\beta\) controls the center frequency

\[\displaystyle \Omega_z=\frac{\pi}{2}\rightarrow\Omega_{\zeta_1}=2\arctan\left(\frac{1+\alpha}{ 1-\alpha}\right)\rightarrow\Omega_\zeta=\ldots\] \(\alpha\) controls the bandwidth, \(\beta\) the center frequency

Allpass Transformations Lowpass-bandpass: varying \(\beta\)

Polar plots of the lowpass-bandpass transformation for alpha = -0.7 and beta = 0, 0.707, -0.707.

Allpass Transformations Lowpass-bandpass: varying \(\alpha\)

Polar plots of the lowpass-bandpass transformation for beta = 0 and alpha = -0.5, 0.5, -0.7.

Allpass Transformations Calculation of the coefficients

Lowpass-lowpass-transformation:

\[\begin{array}{rcl}\displaystyle H(z) &\displaystyle = &\displaystyle \frac{b_1z+b_0}{z+c_0}\\\displaystyle \bar{H}(\zeta) &\displaystyle = &\displaystyle H\left(\frac{1}{A(\zeta)}\right) = \frac{b_1\left(\frac{\zeta+\alpha}{\alpha\zeta +1}\right)+b_0}{\left(\frac{\zeta+\alpha}{\alpha\zeta+1}\right)+c_0} = \frac{\left(b_1+\alpha b_0\right)\zeta+\left(b_0+\alpha b_1\right)}{\left(1+\alpha c_0\right)\zeta + \left(c_0+\alpha\right)} \end{array}\]

\[\bar{H}(\zeta) = \frac{\bar{b}_1\zeta+\bar{b}_0}{\zeta +\bar{c}_0}\]

\[\mbox{with}\qquad\bar{b}_1=\frac{b_1+\alpha b_0}{1+\alpha c_0}\:,\qquad \bar{b}_0=\frac{b_0+\alpha b_1}{1+\alpha c_0}\:,\qquad \bar{c}_0=\frac{c_0+\alpha}{\alpha c_0+1}\]

Allpass Transformations Transition continuous \(\rightarrow\) discrete

Transition continuous \(\rightarrow\) discrete

Commutative diagram: H_c(s) to H_d(z) by the bilinear transformation equals normalization, bilinear transformation to H_dn(zeta), and allpass transformation.

\[\hspace{1cm} \sigma=\dfrac{1}{\pi}\cdot\dfrac{\omega_\mathrm{s}}{\omega_\mathrm{c}}s= \dfrac{1}{\omega_\mathrm{c}T/2}s\:,\qquad \omega_\mathrm{s}=2\pi f_\mathrm{s}=\dfrac{2\pi}{T}\] \[\hspace{1cm}\dfrac{\sigma T}{2}= \dfrac{1}{2\pi}\cdot\dfrac{\omega_\mathrm{s}T}{\omega_\mathrm{c}}s= \dfrac{s}{\omega_\mathrm{c}}\hspace{2cm}s= j\omega_\mathrm{c}\rightarrow\dfrac{\sigma T}{2}=j\:\: !\] \[\hspace{1cm}\dfrac{\sigma T}{2}=\dfrac{s}{\omega_\mathrm{c}}=\dfrac{\zeta-1}{\zeta+1}\:, \qquad\zeta=\dfrac{ 1+\sigma T/2}{1-\sigma T/2}\]

Allpass Transformations Express \(\alpha\) by \(\omega_\mathrm{c}\) and \(\omega_\mathrm{s}\) or \(T\)

Express \(\alpha\) by \(\omega_\mathrm{c}\) and \(\omega_\mathrm{s}\) or \(T\):

\[\begin{array}{rcl}\displaystyle s &\displaystyle =&\displaystyle \omega_\mathrm{c}\,\frac{\zeta-1}{\zeta+1}\\[3ex]\displaystyle s &\displaystyle = &\displaystyle \omega_\mathrm{c}\,\frac{\frac{z+\alpha}{\alpha z+1}-1}{\frac{z+\alpha}{\alpha z+1}+1}\qquad=\qquad\omega_\mathrm{c}\frac{z+\alpha-\alpha z-1}{z+\alpha+\alpha z+1}\qquad=\\[1ex]\displaystyle &\displaystyle = &\displaystyle \omega_\mathrm{c}\,\frac{z(1-\alpha)-(1-\alpha)}{z(1+\alpha)+(1+\alpha)} \qquad=\qquad\omega_\mathrm{c}\frac{1-\alpha}{1+\alpha}\cdot\frac{z-1}{z+1}\\[2ex]\displaystyle s &\displaystyle = &\displaystyle \omega_\mathrm{c}\,\frac{1-\alpha}{1+\alpha}\cdot\frac{z-1}{z+1}\qquad{=^{\!\!\!\! !}}\qquad\frac{2}{T}\cdot\frac{z-1}{z+1} \end{array}\]

\(\bbox[#eef2f8,6px,border:1.5px solid #215293]{\displaystyle \frac{\omega_\mathrm{c}T}{2}=\frac{1+\alpha}{1-\alpha} }\) \(\bbox[#eef2f8,6px,border:1.5px solid #215293]{\displaystyle \alpha = \frac{\omega_\mathrm{c}T/2-1}{\omega_\mathrm{c}T/2+1} }\)

Allpass Transformations Example

\[\displaystyle H_\mathrm{c}(s)=\frac{\omega_\mathrm{c}}{s+\omega_\mathrm{c}}\qquad\qquad H_\mathrm{cn}(\sigma)=\frac{\omega_\mathrm{c}}{\omega_\mathrm{c} T/2\;\sigma+\omega_\mathrm{c}}=\frac{1}{\sigma T/2+1}\]

cutoff frequency normalized to \(\frac{1}{\pi}\omega_\mathrm{s}=\frac{2}{T}\)
\[\displaystyle H_\mathrm{dn}(\zeta) =\frac{1}{\frac{\zeta-1}{\zeta+1}+1}= \frac{1}{2}\left[1+\zeta^{-1}\right]\]

discrete system with simple structure

Discrete first-order lowpass structure: input plus input delayed by zeta^-1, times one half.

\[H_\mathrm{d}(z) = \frac{1}{2}\left[1+\frac{\alpha z+1}{z+\alpha}\right]\: = \: \frac{1+\alpha}{2}\cdot\frac{z+1}{z+\alpha}\:,\qquad\alpha\:=\:\frac{\omega_\mathrm{c} T/2-1}{\omega_\mathrm{c}T/2+1}\]

check at selected frequency points

\[\displaystyle \begin{array}{llll}\displaystyle \qquad &\displaystyle \omega=0\qquad &\displaystyle H_\mathrm{c}(0)=1\qquad\qquad &\displaystyle H_\mathrm{d}(1)=1\\[1ex]\displaystyle &\displaystyle \omega=\omega_\mathrm{c} &\displaystyle H_\mathrm{c}\left(j\omega_\mathrm{c}\right)=\dfrac{1}{1+j} &\displaystyle H_\mathrm{d}\left(\dfrac{1+j\omega_\mathrm{c}T/2}{1-j\omega_\mathrm{c}T/2} \right)=\dfrac{1}{1+j}\\[3ex]\displaystyle &\displaystyle \omega\rightarrow\infty &\displaystyle H_\mathrm{c}(\infty)=0 &\displaystyle H_\mathrm{d}(-1)=0 \end{array}\]

Allpass Transformations Example: continuous and discrete lowpass

Magnitude responses of the continuous and discrete lowpass, unnormalized and normalized, over frequency up to 30 kHz.

Wrap-up

Check yourself

Move a cutoff

A discrete lowpass prototype has its cutoff at \(\Omega_z = \pi/2\). Which \(\alpha\) of the lowpass-lowpass transformation moves it to \(\Omega_\zeta = \pi/4\)? Is \(\alpha\) positive or negative?

Take away

Unit circle onto itself

Replacing \(z\) by \(1/A(\zeta)\) with an allpass \(A\) keeps every magnitude value and only moves it along the frequency axis.

 

Degree 1 and 2

Degree 1: lowpass to lowpass (\(\alpha\) moves the cutoff) and lowpass to highpass. Degree 2: lowpass to bandpass (\(\beta\) sets the center frequency).

 

Design once, tune cheaply

One normalized prototype, then one coefficient \(\alpha\) per cutoff: cheap enough to recompute while a knob turns.

Next lecture: the same idea builds shelving and peak filters with one structure for boost and cut, and lets them move in time.

Further reading

  • U. Zölzer, Digitale Audiosignalverarbeitung, 3. Auflage, B.G. Teubner, Stuttgart, 2005
  • H. W. Schüßler, Digitale Signalverarbeitung 2, Springer, 2010
  • A. G. Constantinides, “Spectral transformations for digital filters,” Proc. IEE 117(8), 1970
  • U. Zölzer (ed.), DAFX: Digital Audio Effects, 2nd ed., Wiley, 2011

Slides 1:1 from the LMS/FAU lecture notes (R. Rabenstein, M. Schäfer); figures redrawn in TikZ (slides/filters_tikz/), plots re-plotted from the original Matlab scripts, added examples by the slides/make_filters_*.py scripts in the course repository.