## From Analog to Digital

Because analog filters are well-studied, a common way of designing a digital filter is to start with an analog filter, then transform it to a digital filter. To achieve this, we must find a function that maps the imaginary axis onto the unit circle, as we must have the frequency response of the analog filter be similar to the frequency response of its digital incarnation.

One such function is the *bilinear transform*. We substitute
$s$ in the transfer function of the analog filter $H(s)$ with

Rearranging gives

Let us call this map $B$. By inspection, if $s$ is the point at infinity, then $z=-1$. Also, $0$ maps to $1$, $i$ to $i$ and $-i$ to $-i$, which suggests it does map the imaginary axis to the unit circle. More generally,

which makes it clear that it does map the imaginary axis to the unit circle. (Since $\mid B(i\omega )\mid =1$.)

Applying the bilinear transform to the transfer function ${H}_{a}(s)$ of some analog filter gives the transfer function ${H}_{d}(z)$ of some digital filter. If ${H}_{d}(z)$ is of the correct form we can read the coefficients off and implement the digital filter. However, even though the frequency response of the digital filter is based on that of the analog filter, the relationship is not straightforward. As $\omega $ increases from 0 to infinity, $B(i\omega )$ rotates counterclockwise around the unit circle starting from 1 and approaching -1, but the imaginary axis gets more and more "compressed" as it approaches infinity.

To gain more control over the conversion, we examine how the distance of a point $i\omega $ from the origin, namely $\mid \omega \mid $, relates to the angle of the point to which it maps, namely $\angle B(i\omega )$. (Recall ${H}_{a}(i\omega )$ determines the frequency response of an analog filter, while ${H}_{d}({e}^{i\theta})$ determines the frequency response of a digital filter.)

Let $a=\angle B(i\omega )$. Then $\mathrm{tan}a=\frac{2\omega}{1-{\omega}^{2}}$, and hence

(So $a=2\mathrm{arctan}(\omega )$.)

Now consider how the sampling rate is involved in a discrete system. As an example, let the sampling frequency be ${f}_{s}=44100$. Let $a=2\pi /{f}_{s}$. Then $x[n]=\mathrm{cos}(an)$ represents a sinusoid of frequency 1Hz; after 44100 samples, exactly one cycle has completed.

In general, for a digital system, we have that a sinusoid of frequency $f$ is represented by $\mathrm{cos}(an+b)$ where

From above, ${H}_{d}({e}^{ia})={H}_{a}(i\mathrm{tan}(a/2))={H}_{a}(i\mathrm{tan}(\pi f/{f}_{s}))$

Suppose we wish to construct a digital filter that amplifies a particular frequency $f$ by a particular amount $G$, that is, we want ${H}_{d}({e}^{\mathrm{ia}})=G$, where $a=2\pi f/{f}_{s}$. Then the analog filter we transform from must have its transfer function satisfying ${H}_{a}(i\mathrm{tan}(a/2))=G$.

In the next section we design analog filters with particular gains at particular frequencies.