Narrow-Band and Wide-Band Frequency Masking FIR Filters with Short Delay Linnéa Svensson and Håkan Johansson Department of Electrical Engineering, Linköping University SE8 83 Linköping, Sweden linneas@isy.liu.se and hakanj@isy.liu.se ABSTRACT In this paper, we introduce frequency masking (FM) FIR filters with short delay. The overall filter has approximately linear phase, and its delay can be chosen arbitrarily. The paper considers how to design both narrowand wide-band filters.. INTRODUCTION Finite-impulse response (FIR) filters have many good properties []. However, FIR filters need a high order to fulfil a specification with a narrow transition band. The order of an FIR filter is inversely proportional to the width of the transition band [] and the arithmetic complexity grows with the filter order. An FIR filter with order N takes N + multipliers (around N/2 for linear phase) and N adders to implement. To come around this problem occurring for narrow transitions bands, one can use an approach proposed by Neuvo, Cheng-Yu, and Mitra in 984 [2]. We refer to this approach as frequency masking FIR filter design and it gives a filter with lower complexity compared to a linear phase equiripple FIR filter [] [3] for a given specification with narrow transition band and passband. The filter design method in [2] reduces the complexity, but the delay is increased compared to a linear-phase FIR filter [2]. In this paper, we introduce FM FIR filters with short delay. If it is important to have a short delay in an application, the design introduced in this paper is preferable. However, shortening the delay one has to pay with some higher complexity of the design, compared to the original method [2]. Also, the exact linear phase is no longer maintained in this approach. 2. NARROW-BAND FM FIR For a narrow-band FM FIR filter, the transfer function is expressed as H( z) = Gz ( M )Fz ( ) () where M is some positive integer. The corresponding structure is shown in Fig.. The filter G(z) works as a model filter and F(z) as masking filter which extracts the desired passband and eliminates the unwanted images of x(n) G(z M ) F(z) Figure. Structure for narrow-band FM filters. (a) ω c Τ ω s Τ y(n) /M 2/M 4/M 6/M Μω c Τ 2ω s Τ 2/M ω s Τ 2/M Μω s Τ 2ω s Τ 4/M the periodic model filter G(z M ). Typical magnitude responses for the model, masking, and overall filters are as shown in Fig. 2. Further, we let ω c T, ω s T, δ c, and δ s denote the passband edge, stopband edge, passband ripple, and stopband ripple, respectively, for the overall filter H(z). 2. Proposed narrow-band filter design This section introduces the new approach of designing narrow-band FM FIR filters with short delay. The delay K = M K G + K F for the overall filter, where K F and K G are the delays of the masking filters Fz ( ) and Gz ( ) respectively, is fixed. The delays K F and K G are not restricted to be integers, but we only consider this case in this paper in order to limit the number of possible ways to 6/M Figure 2. Illustration of magnitude responses for narrow-band FM lowpass filters. (a) model filter, periodic model filter masking filter, and overall filter.
distribute the total delay K. Equation (2) shows the specification of H( z) where δ c and δ s are the ripples in the passband and stopband, and φ e ( ωt ) = φ H ( ωt ) + KωT is the deviation from linear phase in the pass band. δ c H( e jωt ) + δ c ωt [, H( e jωt ) δ s ωt [ ω s T, ] (2) φ e ( ωt ) φ e, max ωt [, The above requirements can be met by separately optimizing the subfilters Fz ( ) and Gz ( ) according to Section 2... Such an approach leads however to an overdesigned overall filter H( z). To reduce the complexity and/or improve the results one should consider simultaneous optimization of the subfilters (Section 2..3). 2.. Separate optimization of F(z) and G(z) The specification of H( z) must here be translated into specifications for the two subfilters so that they together fulfil the specification of H( z). If second-order effects are neglected, we get the following results. The passband ripple of the overall filter is in the worst case the sum of the ripples of Fz ( ) and Gz ( ) and the maximum deviation from linear phase is the sum of the deviation of the subfilters. That is, δ( F) c + δ( G) c = δ c (3) φ( F) + e, max φ( G) e, max = φ e, max In the stop band, if Fz ( ) and Gz ( ) have certain ripples, then H( z) is ensured to have the same or smaller ripple. This requires that none of the subfilters have a peak in their transition bands which may occur for short delay filters. If this is the case, the ripple requirements must be sharpened slightly to compensate for this. Assuming no peaks in the transition bands the stopband ripples can be chosen as δ( F) s = δ( G) s = δ s This will give us the specifications according to δ( F) c Fe ( jωt ) + δ( F) c ωt [, Fe ( jωt ) δ s ωt Ω s φ( F ) e ( ωt ) φ( F) e, max ωt [, δ( G) c Ge ( jωt ) + δ( G) c ωt [, M Ge ( jωt ) δ s ωt [ Mω s T, ] φ( G e ( ωt ) φ( G) e, max ωt [, M where Ω s is the union of the stopbands for the masking filter according to Fig. 2. A simple way to design the filters to meet the above requirements is to use linear programming for the real and imaginary parts, in a similar way as that described in [4]. (4) () (6) 2..2 Finding M, K G and K F For linear-phase FIR filters there are several formulas giving the approximate filter order needed for a certain specification [], [6]. For non-linear phase FIR filters such formulas do not exist, thus one has to search for the lowest order for which the specification is fulfilled. There is no analytic way to find neither the optimal M nor the optimal distribution of K to K G and K F. Therefore, an exhaustive search over M and K G ( K F ) must be done. In principle, there is an infinite number of different distributions, but in practice this has to be limited (e.g. restricting K G and K F to be integers). Sometimes the optimal filter has a delay less than the specified K. In this case, extra delays are added in the design to achieve the wanted delay. Depending on the application, these extra delay elements can be removed and we get a smaller K for the exact same specification. 2..3 Simultaneous optimization of F(z) and G(z) To reduce the complexity and/or improve the results, the overall filter is further optimized by simultaneously optimizing the subfilters instead of separately. To this end, a standard nonlinear optimization routine may be used. The solution obtained in Section 2.. is a good initial solution for further optimization. To find the minimum-complexity overall filter that meets the requirements in (2), one should start with a relaxed specification, then design the subfilters separately, and finally further optimize the overall filter. 2.2 Design examples As a means of demonstrating the proposed version of narrow-band FM FIR filter design with short delay, a filter with K = 7 is designed. The specification is the following: ω c T =.8 rad, ω s T =. rad, δ c =., δ s =., and δ e, max =.. An equiripple linear-phase FIR filter with this specification (disregarding K) gives a delay of half the filter order, in this case 9 2 = 97.. This delay is too long, so another method must be used to design the filter. To this end, we use the proposed approach given in Section 2.. The optimal M and distribution of K is found by an exhaustive search with M from 3 to 9 and K G from to ( K ) M for every M. The design with the lowest complexity is found for M =, K G = 4 and K F = K MK G =. The filter orders are N G = 48, N F = 24. This corresponds to 74 multipliers in an implementation. The resulting passband and stopband attenuation is.3 db and 4. db respectively, and the phase error is less than.66. The magnitude response and the phase error is plotted in Figs. 3. Because of a peak in the transition band of Fz ( ), δ( G) s had to be lowered somewhat to compensate for this. The requirements on the filter in some regions are even without the final optimization largely fulfilled. The margin of over-design can be used to lower the filter
[db] -2-4 -6-8.2.4.6.8 Figure 3. response of H(z) before further optimization. [db] -2-4 -6-8.2.4.6.8 Figure 6. response of H(z) after further optimization..99.2.4.6.8 Figure 4. response of H(z) in the passband before further optimization...99.2.4.6.8 Figure 7. response of H(z) in the passband after further optimization. x -3.2.4.6.8 Figure. of H(z) before further optimization. x -3.2.4.6.8 Figure 8. of H(z) after further optimization. orders to further reduce the complexity of the filter or it can be left to minimize the ripples and the phase deviation. Here the latter is demonstrated. The overall filter H( z) is optimized with non-linear programming using fminimax.m in MATLAB. The results can be seen in Figs. 6 8. The passband and stopband attenuations are now.4 db and 46. db and the phase deviation is less then.47. As a comparison, one FIR filter with the same specification is designed with linear optimization. To fulfil the specification where the real and imaginary parts of the error were considered separately, an order of 2 was needed. This corresponds to 22 multiplications in an implementation. With further optimization this number could be lowered somewhat, but not so much that it can compete with the proposed design method. 3. WIDE-BAND FM FIR To obtain a wide-band LP filter, a narrow-band HP filter is subtracted from a pure delay filter. The transfer function is expressed as H( z) = z K Gz ( M )Fz ( ) and the structure is shown in Fig. 9. (7) x(n) G(z M ) z _ K F(z) Figure 9. Structure for wide-band FM filters. y(n) The masking filter Fz ( ) is an HP filter and the model filter Gz ( ) must be an LP filter for even M and an HP filter for odd M. Typical magnitude responses of the different filters can be seen in Figs. and. 3. Proposed wide-band filter design This section introduces the new approach of designing wide-band FM FIR filters with short delay. The specification of H( z) is translated into specifications for the two subfilters so that they together fulfil the specification of the overall filter. The second order effects are neglected and we get the following specifications. δ( F) s = δ ( G ) min δ φ s = (, c e, ) max ( φ( F) e, max + φ( G) e, max ) 2 + ( δ ( F ) δ( G) c + ) 2 = δ2 c s _ (8) (9)
(a) (a) ω c Τ ω s Τ ω s Τ ω c Τ /M 2/M (M 2)/M /M (M )/M 2/M H NB (e jωt ) (M 2)/M /M H NB (e jωt ) (M )/M (e) ω c Τ ω s Τ (e) ω c Τ ω s Τ δ( F) c Fe ( jωt ) + δ( F) c ωt [ ω c T, ] Fe ( jωt ) δ s ωt Ω s φ( F ) e ( ωt ) φ( F) e, max ωt [ ω c T, ] δ( G) c Ge ( jωt ) + δ ( G ) ωt ω ( G) c, [, T ] c Ge ( jωt ) δ s ωt [ ω G s, ] φ( G e ( ωt ) φ( G) e, max ωt [, ω( G c T ] () () where Ω s is the union of the stopbands for the masking filter according to Figs. and. For even values of M, Gz ( ) is a lowpass filter with and for odd values, the edges are ω c Τ ω s Τ Figure. Illustration of magnitude responses for wide-band FM lowpass filters with even M. (a) model filter, periodic model filter, masking filter, and (e) overall filter. c T = M( ω s T ) s T = M( ω c T ) c T = M( ω s T ) + s T = M( ω c T ) + (2) (3) As for the narrow-band filters, linear programming for the real and imaginary parts can be used for designing the filters. Also, further optimization should be used in order to reduce the complexity and/or improve the result. ω c Τ ω s Τ Figure. Illustration of magnitude responses for wide-band FM lowpass filters with odd M. (a) model filter, periodic model filter, masking filter, and (e) overall filter. 3.2 Design examples The proposed wide-band FM FIR filter design is demonstrated by means of some examples. The total delay K and the ripple specification are the same as in the previous examples while ω c T =.9 rad and ω s T =.92 rad. Since the only difference between the specifications is the location of the transition band, the equiripple solution would give us the same delay of 97. which is not short enough. To reduce the delay, we use the approach in Section 3.. An exhaustive search is done for M and K G and the design with the lowest complexity fulfilling the specifications (8) () is found with M = 6, K G =, and K F =. The filter orders are N G = and N F = 3. Combining them according to Fig. 9 results in passband and stopband ripples of.64 db and 48.2 db, respectively and a phase error less than.7. See Figs. 2 4. This design results in 88 multiplications per sample which can be compared with the 22 multiplications needed for a single FIR filter. The design margin is used to minimize the ripples and the phase error further in a non-linear optimization of H( z). The phase error is now less than.3 and the passband and stopband ripples are.2 db and 3.2 db respectively. The magnitude of H( z) and its phase error in the passband is plotted in Figs. 7.
[db] -2-4 -6.2.4.6.8 Figure 2. response of H(z) before further optimization. [db] -2-4 -6-8.2.4.6.8 Figure. response of H(z) after further optimization...99.2.4.6.8.9 Figure 3. response of H(z) in the passband before further optimization. x -3.3.6.9 Figure 4. of H(z) before further optimization. There is a peak in the transition band of.76 db, but this is typical for short-delay filters and not specific for our approach. Adding constraints in the transition band to keep down this peak the passband and stopband attenuation and maximal phase error deviation becomes.36 db, 48. db, and.39 respectively. The magnitude response without the peak in the transition band is shown in Fig. 8. With a shorter overall delay, it might not be possible to flatten out the peak and still find a feasible solution. 4. CONCLUSION This paper introduced a new version of the FM technique. Using the proposed method it is possible to design narrow- and wide-band FIR filters with short delay and a lower complexity compared to an ordinary nonlinearphase FIR filter. REFERENCES [] T. Saramäki, Finite impulse response filter design, in Handbook for Digital Signal Processing, eds. S. K. Mitra and J. F. Kaiser, New York: Wiley, 993, ch. 4, pp. 277..2.998.2.4.6.8.9 Figure 6. response of H(z) in the passband after further optimization. 2-2 x -3.3.6.9 Figure 7. of H(z) after further optimization. [db] -2-4 -6.2.4.6.8 Figure 8. response of further optimized H(z) with flattened peak. [2] Y. Neuvo, D. Cheng-Yu, S. K. Mitra, Interpolated Finit Impulse Response Filters, IEEE Trans. on Acoustics, Speech, and Signal Processing, vol. ASSP-32, no. 3, pp. 63 7, June 984. [3] T. Saramäki, Design of computationally efficient FIR filters using periodic subfilters as building blocks, in The Circuits and Filters Handbook, ed. W. K. Chen, CRC Press, Inc., 99, pp. 278-26. [4] L. Svensson and H. Johansson, Frequency-response masking FIR filters with short delay, in Proc. IEEE Int. Symp. Circuits Syst., Phoenix, USA, May 26 29, 22. [] O. Herrmann, L. R. Rabiner, and D. S. K. Chan, Practical design rules for optimum finit impuls response digital filters, Bell Tech. J., vol. 2 no. 6, pp. 769 799, 973. [6] K. Ichige, M Iwaki, R. Rokuya, Accurate estimation of minimum filter length for optimum FIR digital filters, IEEE Trans. Circuits Syst., vol. 47, no., Oct. 2.