]> Sound and music - From Analog to Digital

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

s=z1 z+1

Rearranging gives

z=1 +s1 s

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,

B(iω)=1 +iω1 iω=1 ω 2 1 +ω 2 +2 ω1 +ω 2 i

which makes it clear that it does map the imaginary axis to the unit circle. (Since B(iω)=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 ω increases from 0 to infinity, B(iω) 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ω from the origin, namely ω, relates to the angle of the point to which it maps, namely B(iω). (Recall H a(iω) determines the frequency response of an analog filter, while H d(e iθ) determines the frequency response of a digital filter.)

Let a=B(iω). Then tana=2 ω1 ω 2 , and hence

ω=tan(a/2 )

(So a=2 arctan(ω).)

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 π/f s. Then x[n]=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 cos(an+b) where

a=2 πf/f s

From above, H d(e ia)=H a(itan(a/2 ))=H a(itan(π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 ia)=G, where a=2 πf/f s. Then the analog filter we transform from must have its transfer function satisfying H a(itan(a/2 ))=G.