"Geometric" Filters
I'm not sure what to call the type of filter we've examined in previous posts, so let's just call them Geometric All-pass Pairs - or GAP filters. Because the world needs another acronym.If you'll recall, we used a geometric mathematical sequence to arrange the poles and zeros in the complex plane, in order to produce some desired phase difference between a pair of filter cascades.
For the Hilbert transformer configuration, having -pi/2 phase difference (see previous posts),
the relevant generator equations which produce the appropriate pattern of poles and zeros can be written as:
Filter A: exp(+/- pi*(2^-x))
Filter B: exp(+/- pi*(2^-x) + i*pi)
{x:0..n; n odd (equal to filter order, o-1)}
[- for the poles; + for the zeros]
Figure 1 shows a plot of the phase difference of the Hilbert configuration:
A closer look at the pi/2 phase mark reveals that the response is not flat - we see a distinct ripple in-band, with a larger oscillation at either side of the pi/2 frequency:
Tweaking the phase response
It so happens that we can adjust the characteristics of the ripple by varying the significand in our generator function. For example, let's increase pi to 4 and re-examine the phase plot close-in.
The equations become:
Filter A: exp(+/- 4*(2^-x))
Filter B: exp(+/- 4*(2^-x) + i*pi)
Notice how the limits of the ripple are now confined to a tighter range.
We can further improve matters by this time changing the base of the generator function.
Let's reset the significand to pi and decrease the base from 2 to pi/2:
Filter A: exp(+/- pi*(0.5*pi^-x))
Filter B: exp(+/- pi*(0.5*pi^-x) + i*pi)
Again the close-up:
Now you can see we have a completely smooth response curve. However, as usual in signal processing, there is a trade-off: the effective bandwidth of the Hilbert transformer has been somewhat reduced.
We can reverse this bandwidth constriction by increasing the number of terms in the generator function:
Now the response is almost flat! But of course the trade-off has only been shifted elsewhere as we now need more sections to create the filter.
Second Order Coefficients
Talking of filter sections, we commonly construct filter banks using second-order sections (SoS) or 'biquads' (A biquad has a maximum of 2 poles and 2 zeros). Until now we have been thinking in terms of basic first-order pole and zero coefficients. What we'd like is a way to generate second order coefficients, which will make it more efficient to construct the filter with standard biquad building blocks.
Fortunately, due to the quadratic nature of biquads (whence the name), this is just a matter of mutiplying out one real or conjugate pole-pair and one real or conjugate zero-pair for each SoS.
Our Hilbert configuration has only real poles and zeros, and it can be shown the biquad coefficient generator equation corresponding to the first-order pole/zero generator is:
Filter B: exp(-2*significand*((base)^-(2*x)))
Filter A: exp(-2*significand*((base)^-(2*x+1)))
{x:0..m; m=(n-1)/2 }
[We have also made the equation more generic.]
This gives the Feed-Forward z-0 or 'ff0' biquad coefficients, which is all we need because,
as luck would have it, all of the z-1 (ff1) and z-2 (ff2) coefficients can be set to 0 and 1
respectively.
So, using our example of base=2 and significand=4 from figure 3, we get the biquad
numerator (feed-forward) coefficients:
(filter cascade A: order o=18; n=17; m=9)
ff0 ff1 ff2
===========================
-0.01832 0.00000 1.00000
-0.36788 0.00000 1.00000
-0.77880 0.00000 1.00000
-0.93941 0.00000 1.00000
-0.98450 0.00000 1.00000
-0.99610 0.00000 1.00000
-0.99902 0.00000 1.00000
-0.99976 0.00000 1.00000
-0.99994 0.00000 1.00000
(filter cascade B: order o=18; n=17; m=9)
ff0 ff1 ff2
===========================
-0.00034 0.00000 1.00000
-0.13534 0.00000 1.00000
-0.60653 0.00000 1.00000
-0.88250 0.00000 1.00000
-0.96923 0.00000 1.00000
-0.99222 0.00000 1.00000
-0.99805 0.00000 1.00000
-0.99951 0.00000 1.00000
-0.99988 0.00000 1.00000
Now apply the standard all-pass trick of reversing the feed-forward coefficient in order to get the feedback coefficients:
fb0(n) = ff2(n); fb1(n) = ff1(b); fb2(n) = ff0(n)
And remember we need a unit-delay in series with filter B. This can also be implemented with a biquad all-pass section (with reversed fb coefficients as above):
ff0 ff1 ff2
===========================
0 1 1
Simply add the delay biquad in series with filter B, and voila! an IIR Hilbert Transformer.
Conclusion
In this post we discovered a mathematical formula for the generation of coefficients for Hilbert transformers of arbitrary filter order, trading acceptable in-band ripple against maximum effective bandwidth.The next time we will learn how to generate the biquad coefficients for the low-pass and high-pass filters which we previously obtained from the basic Hilbert configuration (see the post entitled "Transforming the Transformer" for the necessary background.)
RAW~
No comments:
Post a Comment