Learn how to derive and use the bilinear transform to convert analog systems into digital ones.
To design and implement a parametric filter, 4 steps are needed:
- Decide on the filter type you want to implement.
- Design an analog prototype.
- Digitize the analog prototype using the bilinear transform.
- Implement the digital filter in code.
In this article, we’ll explain the second step of that process: how to go from an analog prototype to a digital form of the parametric filter. This is shown on the diagram below.
Figure 1. In this article, we discuss the bilinear transform.
System Digitization Methods
There are many methods of digitalization (discretization) of analog (continuous) systems. The most popular ones are [OppenheimSchafer10]:
- impulse-invariant transformation (IIT): sampling the impulse response of the continuous system,
- bilinear transformation (BT): mapping the transfer function of the continuous system from the
-plane to the -plane.
Because the impulse-invariant transformation may introduce aliasing, in the music domain, we usually use the bilinear transform. So how is it defined?
The Bilinear Transform
The bilinear transform is a change of variables, mapping the
frequency axis of the -plane to the unit circle of the -plane.
Given an analog transfer function
where
We can go back from the discrete transfer function to the analog transfer function by substituting
what can be directly derived from Equation 1.
The bilinear transform formulas are summarized in Figure 2 (with
Figure 2. Bilinear transform formulas.
Derivation of the Bilinear Transform
How is the bilinear transform derived? How to come up with the mapping in Equation 1?
Below, I give you a simple, intuitive explanation. If you are not interested in it, you can skip to the properties of the bilinear transform.
The
An integrator is a system at whose output the integral of the input signal may be observed
where
The Laplace transform of Equation 4 yields
where
Figure 3. A diagram of the analog integrator system.
We want to obtain a discrete system described by a discrete transfer function
We can now approximate the last integral in Equation 6 via the trapezoidal rule
Inserting Equation 7 into Equation 6 yields
We now transform Equation 8 with the
After rearranging Equation 9 we obtain the transfer function formulation
Since
which after inversion gives Equation 1, i.e., the bilinear transform.
The bilinear transform can also be derived by representing a signal as a series of impulses, calculating its Laplace transform and
Properties of the Bilinear Transform
In the following, we assume that
(with in Hz) denotes the analog frequency in radians per second (value on the axis of the -plane) and (with in Hz) denotes the digital frequency in radians per second (corresponding to the angle of a point on the unit circle of the -plane).
The bilinear transform has a number of useful properties [ParksBurrus87].
First of all, it is called bilinear because the numerator and the denominator are linear in
Second of all, the bilinear transform maps the left half-plane of the
Figure 4. Bilinear transform maps the left half-plane of the
As a consequence, the poles from the left half-plane of the
In the same way, the
The above mappings mean that the bilinear transform is a nonlinear mapping of the phase and the frequency. The former results in the nonlinear phase of the resulting IIR filters [OppenheimSchafer10]. The latter manifests itself in the form of frequency warping as discussed later in the article.
Other properties of the bilinear transform are:
- the obtained digital filter has the same order as the analog prototype,
- optimality is preserved (e.g., maximally flat analog prototypes become maximally flat discrete filters),
- a cascade of systems transformed with the bilinear transform is equivalent to the bilinear transform of a cascade of these systems.
Frequency Warping
The bilinear transform maps the full, infinite analog frequency axis to a finite-length discrete frequency axis (the unit circle). That results in frequency warping: “equal increments along the unit circle in the
The mathematical relation between the analog frequencies
Therefore,
From Equation 13, we can obtain the inverse relation
The visualization of Equation 14 on Figure 5 shows what is frequency warping.
Figure 5. Plot showing how analog frequencies are mapped to digital frequencies by the bilinear transform.
Prewarping
In order to account for frequency warping of the bilinear transform in filter design, we need to perform the so-called prewarping. The prototype filter frequency scale must be prewarped so that after the bilinear transform the critical frequencies are in the correct places.
In other words, we want to have
where we choose
This goal can be easily achieved by simply scaling the analog frequency axis with a proper scalar before the bilinear transform.
In the context of parametric filters, our critical frequency will typically be the cutoff frequency of a filter, because that’s the frequency for which we want to have a specific transfer function value. But let’s derive the general scaling.
Prewarping Factor Derivation
Given critical frequencies
and
where
From Equation 13, we know that without scaling by
Here
Solving for
allows us to independently change
So the bilinear transform combined with prewarping gives the following formula for
Cutoff Frequency from Prewarping
As you might recall from the analog prototype design tutorial, we design our analog filters to have the cutoff frequency equal to 1. Since thanks to prewarping, we can independently change
So prewarping actally lets us set the cutoff frequency of the filter we design 🙂
Example: Digitization of the Butterworth Low-Pass
Finally, let’s put to practice all that we’ve learned.
Let us digitize the analog prototype Butterworth low-pass of order 2 that we designed in the previous article.
It’s transfer function in the
The cutoff frequency was set to 1.
To obtain a digital filter with the digital cutoff frequency equal to
After very simple but tiresome derivations, we obtain
where
We thus obtained a stable IIR filter of order 2 with controllable cutoff frequency. Yay!
Efficiency
The filter in Equation 24 is efficient during processing but setting its cutoff frequency requires calculating the value of 5 coefficients (after normalization). That parameter-to-coefficient mapping is not efficient at all. Therefore, we need to turn to allpass-based filters… But that will be a topic of a different article. 😉
Summary
In summary, in this article we learned that the bilinear transform is a great method that allows us to digitize analog prototype filters.
We learned how to derive the bilinear transform by approximating a continuous-time integrator. We learned the properties of the bilinear transform such as stability and optimality preservation. We also counteracted the frequency warping with prewarping.
We learned that with prewarping we can set the cutoff frequency of analog prototypes to 1 because prewarping alters it anyway.
Finally, we discretized the second-order analog Butterworth low-pass with the bilinear transform and prewarping and obtained an IIR filter.
Thanks for reading! If you have any questions, don’t hesitate to ask them in the comments below 🙂
Bibiliography
Maximilian Schäfer, Music Processing - Synthesis lecture notes, Friedrich-Alexander-Universität Erlangen-Nürnberg, Winter Semester 2020/2021.
[OppenheimSchafer10] Alan V Oppenheim, Ronald W. Schafer, Discrete-Time Signal Processing, 3rd Edition, Pearson 2010.
[ParksBurrus87] T. W. Parks, C. S. Burrus, Digital Filter Design, John Wiley & Sons, Inc., 1987.
[Smith07] Julius O. Smith, Introduction to Digital Filters with Audio Applications, http://ccrma.stanford.edu/~jos/filters/, online book, 2007 edition, accessed November 26, 2021.
Links above may be affiliate links. That means that I may earn a commission if you decide to make a purchase. This does not incur any cost for you. Thank you.
Comments powered by Talkyard.