HIGH-SPEED RECURSIVE FILTER STRUCTURES FOR INTERPOLATION AND DECIMATION WITH FACTORS OF TWO Håkan Johansson and Lars Wanhammar Department of Electrical Engineering, Linköping University, S-581 83 Linköping, Sweden E-mail:
[email protected],
[email protected]
A b s t r a c t – In this paper we propose high-speed recursive filter structures for interpolation and d e c i m a t i o n w i t h f a c t o r s o f t w o . The structures are c o m p o s e d o f identical allpass subfilters and mult i p l i e r s t h a t interconnect these subfilters. In the simplest case, the overall transfer function corresponds to several half-band IIR filters in cascade. It can also be designed to have a s m a l l e r passband ripple than for the cascade approach. Recurrence formulas for computation of the multipliers from the overall transfer function, are g i v e n . O n e m a j o r advantage of the new structures over the corresponding single-stage structure is that the maximal sample frequency can be subs t a n t i a l l y i n c r e a s e d . F u r t h e r , the arithmetic complexity can be reduced in comparison with both the single-stage and the straightforward cascade structures. Examples are included which compare the new structure with the two above mentioned structures.
I. INTRODUCTION In terms of arithmetic operations per sample, Nth-band IIR filters are, in general, the most efficient filters for interpolation and decimation with factors of N [1]. In this paper we are concerned with the special case where N = 2, in which half-band IIR filters are obtained. A half-band IIR filter is a parallel connection of two allpass subfilters. The overall transfer function can be written in polyphase form H(z )= H0 (z 2 ) + z −1 H1 (z 2 )
(1)
When using half-band filters for sample rate conversions with factors of two it is possible to use the corresponding polyphase interpolators and decimators as shown in Figs. 1 and 2. The filtering is performed at the lower of the two sample rates involved, which results in a low arithmetic workload. Further, the allpass subfilters can be realized as a cascade of first- and second-order sections. This results in highly parallel and modular filter algorithms which is advantageous from an implementation point of view. In addition, by using wave digital filters (WDFs) for the allpass subfilters it is possible to maintain stability under finite-arithmetic conditions [2, 3]. In this case we have the well-known bireciprocal lattice WDF [3, 4, 5]. However, filters composed of allpass subfilters in parallel have a high coefficient sensitivity in the stopband.
The required coefficient word length is, roughly, proportional to the required stopband attenuation [1]. For stringent requirements on the stopband attenuation this implies very long coefficients. This has a large effect upon the performance of an implementation of these filters. In VLSI implementations where it is possible to benefit by short data word lengths and simple coefficients, the cost to implement the coefficients increases as the word lengths increase. Further, recursive filters have a major drawback in that they restrict the sample frequency due to their recursive parts. The maximal sample frequency for a recursive algorithm, described by a fully specified signal-flow graph, is N fmax = min i i Topi
(2)
where T opi is the total latency of the arithmetic operations, and N i is the number of delay elements in the directed loop i [6]. The latency is highly dependent upon the coefficient word lengths of the filters. For example, using bit-serial arithmetic, the latency of a multiplication is proportional to the coefficient word length [7]. For bitparallel arithmetic it depends on the types of multipliers that are used, but it is still largely dependent upon the coefficient word lengths. Recursive filters with high maximal sample frequencies have potential advantages not only for high-speed applications, but also for low power applications. The reason for the latter is that the excess speed can be converted into low power consumption via voltage scaling techniques [8]. With the increasing demand for high-speed and low power applications, such as mobile communication systems, it will become more important to use filters with very high maximal sample frequencies as well as low arithmetic complexities. For filters composed of two allpass subfilters in parallel, the coefficient sensitivity can be substantially reduced by using several low-order filters in cascade, or more generally, a tapped cascaded interconnection of the allpass subfilters [9]. However, in the context of interpolation and decimation, problems arise due to the different sample rates involved. Using a straightforward cascade realization it is only possible to exploit the efficient polyphase structure for the first stage. For the following stages the filtering takes place at the higher of
the two sample rates involved, which increases the workload. By exploiting the fact that a filter with a transfer function of the form H(z2) can be realized according to Fig. 3, it is possible though to perform the filtering even for the following stages at the lower sample frequency, but then a doubling of the hardware is necessary, which means that the number of filter operations per sample remains the same. To our knowledge this latter approach is hitherto the only one that has utilized the benefits of cascaded half-band filters in the context of sample rate conversions, see for example [10]. Using M stages in the straightforward cascade approach results in a realization requiring 4M – 2 allpass subfilters. In this paper we propose structures which reduce this number significantly. Using these structures the required number of allpass subfilters is reduced to 2M, for M odd, and 2M + 1, for M even. The price for this reduction is that extra adders and multipliers have to be introduced to interconnect the allpass subfilters. The extra multipliers are parts of non-recursive paths only, and therefore they do not affect the maximal sample frequency. Using the proposed structures, it is also possible to design the overall filter to have a smaller passband ripple than what is possible when using a straightforward cascade realization.
cascade realization. We will first consider the simplest cases of two and three cascaded half-band filters before going into the general case. Structure Derived From Two Cascaded HalfBand Filters The overall transfer function of two cascaded half-band filters can be written as H(z )= ( H 0 (z 2 ) + z −1 H1 (z2 )) = 2
= H02 (z 2 ) + z −2 H12 (z 2 ) + 2z − 1H0 (z 2 )H1(z 2 )
which clearly is in polyphase form. By exploiting the fact that both branches of the overall polyphase filter contain the factor H0(z2) and H1(z2), it is now possible to derive two different realizations that yield the same minimal number of allpass subfilters. The final structures for interpolation are shown in Figs. 4 and 5. Three copies of one of the subfilters, and two of the other, are needed. The corresponding decimation structures can easily be derived from the interpolation structures by using the transposition theorem. Therefore, we do not show them here explicitly.
H0 (z) x(n) fsample
H1 (z)
y(m) 2fsample
x(n)
H0 (z)
H0 (z)
H1 (z)
H1 (z)
y(m) H1 (z)
H0 (z) x(m) 2fsample
y(m) H1 (z)
z–1
fsample
Figure 1: Polyphase interpolator.
(3)
2
2fsample
Figure 4: Interpolator derived from two cascaded halfband filters
fsample H0 (z)
H0 (z)
H1 (z)
H1 (z)
Figure 2: Polyphase decimator. x(2n)
x(2n+1)
H(z)
H(z)
y(2n)
x(n)
z –1 y(m)
fsample H0 (z)
y(2n+1)
Figure 3: Realization of H(z2). II. FILTER STRUCTURES The proposed filter structures are based on two observations. First, the overall transfer function of M cascaded half-band filters can always be restated in polyphase form. The filtering can thus always be performed at the lower sample frequency. Second, the two branches of the overall polyphase filter contain common factors. By adding extra multipliers, adders, and delay elements it is therefore possible to reduce the number of realized subfilters compared with using a straightforward
2
2fsample
Figure 5: Interpolator derived from two cascaded halfband filters. (Alternative to the interpolator in Fig. 4). Structure Derived From Three Cascaded HalfBand Filters For three cascaded half-band filters the overall transfer function is
(
H(z )= H 0 (z 2 ) + z −1H1(z 2 )
)
3
=
= H03 (z2 ) +3z −2 H0 (z 2 )H12 (z2 ) +
(
)
+z −1 z −2 H13(z 2 )+ 3H02 (z 2 )H1 (z 2 )
(4)
H0 (z)
H0 (z)
H0 (z) 3
x(n)
y(m)
3
fsample
H1 (z)
H1 (z)
2fsample
H1 (z)
z –1
Figure 6: Interpolator derived from three cascaded half-band filters. k0
x(n)
N1
k1
NP
y(m)
T
fsample
2fsample
Figure 7: General structure for interpolation. Here, the two branches contain the common factors H02 (z 2 ) and H12 (z2 ) It is therefore possible in this case to use a realization that contains only six subfilters in total. The structure for interpolation is shown in Fig. 6. General Structure Composed of Cascaded Interconnected Allpass Subfilters The general structure for interpolation is shown in Fig. 7. This structure consists of P + 1 cascaded sections, where P = (M–1)/2 for odd values of M, and P = (M–2)/2 for even values of M. For each of the first P sections a structure according to Fig. 8 is used. For the terminating section T, different structures are used depending on whether M is even or odd. For the case in which M is odd, the section in Fig. 9 is selected. If M is even, one of the structures in Fig. 10 and Fig. 11 can be selected. The overall transfer function of the structure in Fig. 7 can be written as [11] M
H(z )=
M−i
∑ ci z− i [H1(z2 )] [ H0 (z2 )] i
(5)
i =0
where the coefficients ci are determined by the design of the overall filter. In the simplest case, the overall transfer function corresponds to M half-band IIR filters in cascade. To reduce the passband ripple of the overall filter, it can be designed using an approach that earlier has been used for single-rate filters [9]. These two cases will be considered in more detail in section IV. xp1 (n)
H0 (z)
H0 (z)
H1 (z)
H1 (z)
yp1 (n) k2 p k2 p+1
xp2 (n)
yP2 (n)
H0 (z)
H1 (z)
H0 (z)
H0 (z)
yP2 (n)
H1 (z)
H1 (z)
y1 (n)
z –1 kN
H0 (z)
y2 (n)
Figure 10: Realization of section T, for M = even. yP1 (n)
H0 (z)
H0 (z)
yP2 (n)
H1 (z)
H1 (z)
y1 (n)
z –1 kN
H1 (z)
y2 (n)
Figure 11: Alternative realization of section T, for M = even. III. COMPUTATION OF THE INTERCONNECTING MULTIPLIERS In this section we give recurrence formulas for computation of the interconnecting multipliers. For the derivation of these formulas we refer to [11]. Given the coefficients ci of the overall filter, the coefficients, k 2p and k 2p+1 can be computed iteratively by varying p from P downto 1 and using the following recurrence formula:
yp2 (n)
z –1
Figure 8: Realization of section Np. yP1 (n)
yP1 (n)
k2p =
m(0 p) l0( p)
, k2 p +1 =
lp( p ) m(pp)
(6a)
y1 (n)
y2 (n)
Figure 9: Realization of section T, for M = odd.
) mi( −p−1 = 1 ) m p( p−1 −1
mi( p) − k2 p li( p) , 1 ≤ i ≤ p −1 1− k 2 p+1k2 p ( p)
= mp
(6b)
(
l(0 p−1) = l 0( p) l ( p) − k2 p+1m i( p) li( p−1) = i , 1 ≤ i ≤ p −1 1− k 2 p+1k2 p
H(z )= H 0 (z 2 ) + z −1H1(z 2 ) (6c)
,
k1 = m1(1)
(6d)
Case 1, M = odd. For M odd we use the terminating stage in Fig. 9. The parameters are here given by li( P) = c 2i , 0 ≤ i ≤ P
(7a)
mi( P ) = c2i +1 , 0 ≤ i ≤ P
(7b)
Case 2, M = even. In this case we use the terminating stage in Fig. 10. The parameters, and k M , are given by c M−1 cM
l0(P) = c0 li(P) = c 2i − mi(P) −1 , 1≤ i ≤ P m( P ) i
) m (P P
c = 2i +1 , 0 ≤ i ≤ P −1 kM = cM
=
M
=
∑ Mi z− i [H1(z2 )]i [ H0 (z2 )]M − i
(10)
Thus, ci are here given by
The parameters li( P) and m(i P ) , 0 ≤ i ≤ P are derived from the coefficients, ci , of the overall filter. There are consequently three cases for which these parameters will be different.
kM =
M
i =0
Finally, the coefficients, k 0 and k 1, are computed as k 0 =l0(1)
)
(8a)
(8b)
M ci = i ,
0≤i≤ M
(11)
The coefficients k 0 and k 1 are in this case equal to one. For M = odd the coefficients of each of the blocks N p are equal, i.e., k 2p = k 2p+ 1. For M = even we can use two different terminating sections. Using the one in Fig. 10 k 2p equals one for all blocks Np. Using instead the terminating section of Fig. 11, k 2p+ 1 equals one for all blocks. The coefficient k 2p+ 1 has in the latter case the same value as the coefficient k 2p has in the former case, and vice versa. For both cases k M is always equal to cM / 2. The coefficients ci are here integers, which has the effect that all the coefficients k j will be rational numbers. As a consequence thereof, it is possible to replace each section N p by a section according to Fig. 12. This replacement does not change the overall transfer function, but only the signal levels within the filter. All the extra multipliers in the resulting filter are consequently integers which means that only the coefficients belonging to the allpass subfilters H0(z) and H1(z) are subject to quantization under finite-arithmetic conditions. x1 (n)
b
y1 (n) a/b
(8c) x2(n)
b
a/b
z
y2 (n)
–1
Case 3, M = even. In this case the terminating stage in Fig. 11 is used. The parameters, and k M , are given by kM =
c1 c0
l(0 P) = c0 c li( P) = 2i+1 , 1 ≤ i ≤ P kM mi( P ) = c2i +2 − li( +P)1 , 0 ≤ i ≤ P− 1 ) m (P P = cM
(9a)
b
x1 (n) a
x2 (n)
(9b)
(9c)
IV. DESIGN OF THE OVERALL FILTER Cascading M Half-Band Filters Cascading M half-band filters, the filter coefficients, ci , of the overall filter are easily identified from the resulting overall transfer function which becomes
y1 (n)
a
z –1
b
y2 (n)
Figure 12: Two equivalent structures. Design for Reduced Passband Ripple Recursive half-band filters have extremely small passband ripples if their stopband attenuations are reasonably high. For the approach of cascading M identical half-band filters, each individual half-band filter is required to have an attenuation which is M times less than that of the overall filter. This has the effect that for larger values of M, the passband ripple of the overall filter may become unreasonably large. One way to reduce this is to employ the design method that was introduced in [9]. When using this approach, the design is separated into a design of a prototype FIR filter and of a half-band IIR filter. The coefficients ci of the overall filter as given by (5) are then
directly given by the impulse response of the prototype FIR filter. The passband ripple and stopband attenuation of the overall filter is determined by the passband ripple and stopband attenuation of the prototype FIR filter, while the passband and stopband edges of the overall filter is determined by the passband and stopband edges of the individual half-band IIR filter. The passband and stopband edges of the prototype filter, s , must be chosen as (12) c = 1 – cos( c/2), s = cos( s /2) where s and s are the passband and stopband ripples of the half-band IIR filter. The edges are here always related as c + s = . For more details we refer to [9, 11]. V. EXAMPLES Example 1: We consider the following specification: s T = 95°, A min = 60 dB. We use the structure in Fig. 7 for M = 2, M = 3, and M = 6. We assume that the transfer function of the overall filter corresponds to M cascaded half-band filters. The overall filter will then meet the original specification if the stopband attenuations of the individual half-band filters in each case are at least A min /M. Using Cauer approximation, the orders of the individual half-band filters become, for the three different cases, 7, 5, and 3, respectively. As a comparison, we also use a straightforward cascade realization and a single halfband IIR filter. The order of the single filter that meets the requirements is 13. All allpass sections are realized using a cascade of first-order sections. For each first-order section, a symmetric-two port adaptor according to Fig. 13 is used. In this case all half-band filters correspond to bireciprocal lattice WDFs [3, 4, 5]. The adaptor coefficients are easily computed using the design procedure in [5]. Table 1 summarize the number of adaptors, the number of adders, the required coefficient word length after rounding, and the maximal sample frequency for each case. The coefficient word lengths indicate the number of bits that is required to keep the stopband attenuation above 60 dB. The design margin in the stopband for the single half-band filter is, in the stopband, about 7 dB. For the three individual half-band filters, the margins are about 3, 2, and 1 dB, respectively. We assume that bit-serial arithmetic, dynamic logic, and a latency model referred to as model 1 in [12] are used. In this case the addition and multiplication latencies are Tadd = TCL (13a) Tmult = TCL (Wcf + 1)
(13b)
where W cf is the number of fractional bits of the coefficient. With these assumptions, the maximal sample frequency for the first-order allpass section of Fig. 13 becomes 1 fCL fmax = = (14) Tmult + 2Tadd Wcf + 3 The figures for the number of adders indicate the total number of adders that is needed for all additions and
multiplications. The number of adders required for a multiplication is estimated as a third of the word length of the multiplier (multiplications by two are not counted since these can be implemented as a shift operation). Using bit-serial arithmetic and canonic signed digit code (CSDC) this is, in average, the required number of adders for a multiplication by a constant value [7]. From Table 1 we see that the maximal sample frequency is substantially higher for the new structures and for the straightforward cascade realizations than for the single half-band filter. Compared with the single filter, the new structures need extra adders, integer multipliers, and one extra adaptor in one of the cases. However, since their coefficients are much shorter, the hardware cost will be less for these coefficients than for the coefficients of the single filter. This can also be concluded by comparing the total number of required adders in Table 1. We can also conclude that the straightforward cascade realizations require more adders due to the larger amount of adaptors. By using the new structures the number of adders can be reduced by between 14-39% for the three cases, compared with using the single filter or the straightforward cascade realizations. Naturally, it is difficult to accurately predict the final cost of an implementation, but these examples clearly show that the new structures have potential advantages. Example 2: For the case where M = 6 in example 1, the overall transfer function corresponds to six half-band filters in cascade, resulting in a large passband ripple, as shown in Fig. 14. To reduce the ripple we use the procedure outlined in section IV. We use the same third-order halfband filter as was used above, with the adaptor coefficient quantized to three bits (α = –0.75). The stopband attenuation of this third-order filter, with a quantized coefficient, is then 11.126 dB. Using (12), the passband and stopband edges of the prototype FIR filter can then be computed as 32.26° and 147.74°, respectively. We use a 6th-order minimum-phase FIR filter for the prototype filter designed with the procedure in [13]. The magnitude response of the overall filter then becomes as shown in Fig. 15. The extra multipliers, k j , are in this case not rational numbers. It is therefore not possible to use the equivalence of Fig. 12 in order to obtain integer multipliers. Consequently, the magnitude response of the overall filter will be affected also by rounding of these coefficients. However, these are parts of non-recursive parts only and do not affect the maximal sample frequency. The required number of bits to keep the stopband attenuation above 60 dB is for these coefficients 11 (8 fractional bits). For 11 bits, the passband ripple is only slightly increases from the realization using non-quantized coefficients (from 0.109 dB to 0.113 dB). The required number of adders becomes in total 51. Compared with, for example, the realization where M = 3 in example 1 (which has about the same passband ripple) this is an increase by about 65 %. On the other hand, the maximal sample frequency is here approximately 40 % higher. Hence, there is a clear trade-off between the hardware resources and the maximal sample frequency.
VI. CONCLUSIONS In this paper we have proposed high-speed recursive filter structures for interpolation and decimation with factors of two. The structures use identical allpass subfilters and extra multipliers for interconnection of these subfilters. Given the overall transfer function, the extra multipliers can be computed using simple recurrence formulas. In the simplest case, the overall transfer function corresponds to a number of half-band IIR filters in cascade. It can also be designed to have smaller passband ripple than what is possible when using a straightforward cascade realization. Examples showed that the proposed structures have potential advantages over the corresponding single halfband IIR filters in terms of speed and arithmetic complexity, and over the corresponding straightforward cascade realizations in terms of arithmetic complexity.
α1
x(n)
y(n)
[2]
x(n)
y(n)
[3]
Figure 13: A first-order allpass section.
[4] 10
Magnitude [dB]
0
0
[5]
-10
-1
-20
-2 0
20
40
60
80
[6]
-30 -40 -50
[7]
-60 -70 -80 0
[8] 20
40
60
80 100 Angle [deg]
120
140
160
180
[9]
Figure 14: Magnitude response of the overall filter corresponding to six cascaded third-order half-band IIR filters. [10]
10
Magnitude [dB]
0
0
-10
-0.05
-20
-0.1 0
20
40
60
[11]
80
-30 -40 -50
[12]
-60 -70 -80 0
[13] 20
40
60
80 100 Angle [deg]
120
140
160
180
Figure 15: Magnitude response of the overall filter after using a design for reduced passband ripple.
Nadd
Wc
f max /f CL
6
42
12
0.0714
9 10 11
47 51 54
6 5 3
0.125 0.143 0.200
7 6 6
36 31 36
6 5 3
0.125 0.143 0.200
References
α1
-
Nadapt
Table 1: Results of Example 1.
[1]
T
T
s T = 95° A min = 60 dB Single Cascade M=2 M=3 M=6 Proposed M=2 M=3 M=6
Renfors M. and Saramäki T.: Recursive Nth-Band Digital Filters-Part I: Design and Properties, IEEE Trans. on Circuits and Systems, Vol. CAS-34 No. 1, pp. 24-39, Jan. 1987. Fettweis A. and Meerkötter K.: Suppression of Parasitic Oscillations in Wave Digital Filters, IEEE Trans. on Circuits and Systems, Vol. CAS-22, No. 3, pp. 239-246, March 1975. Fettweis A.: Wave Digital Filters: Theory and Practice, Proc. IEEE, Vol. 74, No. 2, pp. 270-327, Feb. 1986. Wegener W.: Wave Digital Directional Filters with Reduced Number of Multipliers and Adders, Arch. Elek. Ubertragung., Vol. 33, pp. 239-243, June 1979. Gazsi L.: Explicit Formulas for Lattice Wave Digital Filters, IEEE Trans. on Circuits and Systems, Vol. CAS32, No. 1, pp. 68-88, Jan. 1985. Renfors M. and Neuvo Y.: The Maximum Sampling Rate of Digital Filters Under Hardware Speed Constraints, IEEE Trans. on Circuits and Systems, Vol. CAS-28. No. 3, pp. 196-202, March 1981. Wanhammar L.: DSP Integrated Circuits, Linköping University, 1997. Chandrakasan A.P. and Brodersen R.W.: Low Power Digital CMOS Design, Kluwer Academic Publ., 1995. Saramäki T.: A Novel Approach for the Design of IIR Filters as a Tapped Cascaded Interconnection of Identical Allpass Subfilters, IEEE Intern. Conf. on Circuits and Systems, pp. 629-632, Philadelphia, May 4-7, 1987. Kale I., Morling R.C.S., Krukowski A., and Tsang C.W.: A High-Fidelity Decimator Chip for the Measurement of Sigma-Delta Modulator Performance, IEEE Trans. on Instrumentation and Measurement., Vol. 44, No. 5, pp. 933-939, Oct. 1995. Johansson H. and Wanhammar L.: High-Speed Recursive Filter Structures for Interpolation, Decimation, and Filter Banks, submitted to IEEE Trans. on Circuits and Systems-II. Vesterbacka M., Palmkvist K., and Wanhammar L.: On Implementation of Fast, Bit-Serial Loops, Midwest Symp. on Circuits and Systems, Iowa, Aug. 1996. Herrman O. and Schussler H.W.: Design of Nonrecursive Digital Filters with Minimum Phase, Electronics Letters, Vol. 6, No. 11, pp. 329-330, May 1970.