Transformations for FIR and IIR Filters' Design
Total Page:16
File Type:pdf, Size:1020Kb
S S symmetry Article Transformations for FIR and IIR Filters’ Design V. N. Stavrou 1,*, I. G. Tsoulos 2 and Nikos E. Mastorakis 1,3 1 Hellenic Naval Academy, Department of Computer Science, Military Institutions of University Education, 18539 Piraeus, Greece 2 Department of Informatics and Telecommunications, University of Ioannina, 47150 Kostaki Artas, Greece; [email protected] 3 Department of Industrial Engineering, Technical University of Sofia, Bulevard Sveti Kliment Ohridski 8, 1000 Sofia, Bulgaria; mastor@tu-sofia.bg * Correspondence: [email protected] Abstract: In this paper, the transfer functions related to one-dimensional (1-D) and two-dimensional (2-D) filters have been theoretically and numerically investigated. The finite impulse response (FIR), as well as the infinite impulse response (IIR) are the main 2-D filters which have been investigated. More specifically, methods like the Windows method, the bilinear transformation method, the design of 2-D filters from appropriate 1-D functions and the design of 2-D filters using optimization techniques have been presented. Keywords: FIR filters; IIR filters; recursive filters; non-recursive filters; digital filters; constrained optimization; transfer functions Citation: Stavrou, V.N.; Tsoulos, I.G.; 1. Introduction Mastorakis, N.E. Transformations for There are two types of digital filters: the Finite Impulse Response (FIR) filters or Non- FIR and IIR Filters’ Design. Symmetry Recursive filters and the Infinite Impulse Response (IIR) filters or Recursive filters [1–5]. 2021, 13, 533. https://doi.org/ In the non-recursive filter structures the output depends only on the input, and in the 10.3390/sym13040533 recursive filter structures the output depends both on the input and on the previous outputs. The Recursive filters have been employed in science and technology for issues like signal Academic Editors: processing, control signals, radar signals, astronomy signals, medical image processing Basil Papadopoulos and Theodore and x-ray enhancements, among others. The Non-Recursive filters are almost everywhere E. Simos in applications where phase linearity has to be ensured. FIR filters are the best choice for Received: 14 December 2020 applications like adaptive filters, averaging filters, speech analysis, spatial beamforming Accepted: 18 March 2021 (spatial filtering), and multirate signal processing, among others. Published: 25 March 2021 In this paper, methods like the Windows and the Bilinear Transformation method have been used to design FIR and IIR digital filters. The design approaches for the case of Publisher’s Note: MDPI stays neutral 2-D IIR filters are based on (a) appropriate 1-D filters and on (b) appropriate optimization with regard to jurisdictional claims in techniques [6–11]. published maps and institutional affil- iations. 2. Finite Impulse Response Filters and Infinite Impulse Response Filters Finite impulse response (FIR) filters and infinite impulse response (IIR) filters are broadly used in signal processing studies and industrial applications. The FIR filter is a filter whose impulse response has a finite duration as a result of settling to zero in finite Copyright: © 2021 by the authors. time. On the other hand, the impulse response of the IIR filter has aninfinite duration due Licensee MDPI, Basel, Switzerland. to the existence of a feedback in the filter [1,2]. This article is an open access article The aforementioned filters can be categorized with respect to the frequency range distributed under the terms and which can pass through them (lowpass, highpass, bandpass and bandstop filters). The ideal conditions of the Creative Commons frequency response D(!) for the cases of lowpass, highpass, bandpass and bandstop filters Attribution (CC BY) license (https:// is presented in Figure1. In the next sections, we describe methods used to design FIR and creativecommons.org/licenses/by/ IIR filters. More specifically, the transfer functions for some filters of special importance e.g., 4.0/). Symmetry 2021, 13, 533. https://doi.org/10.3390/sym13040533 https://www.mdpi.com/journal/symmetry Symmetry 2021, 13, x FOR PEER REVIEW 2 of 10 Symmetry 2021, 13, 533 2 of 9 design FIR and IIR filters. More specifically, the transfer functions for some filters of spe- cial importancehighpass e.g., filtershighpass and filters lowpass and filters lowpass have filters beenstudied have been and havestudied shown and theirhave dependence shown their ondependence system parameters on system (frequencyparameters and (frequency attenuation, and attenuation, among others). among others). Figure 1. Ideal digital filters. Figure 1. Ideal digital filters. 2.1. FIR Filters2.1. FIR Filters The WindowThe method, Window the method,Kaiser Window the Kaiser method, Window the method,Frequency the Sampling Frequency method, Sampling method, the Weightedthe least Weighted squares least design squares and the design Parks–McClellan and the Parks–McClellan method, among method, other among meth- other meth- ods [1,2], areods the [most1,2], arecommonly the most used commonly methods used to design methods digital to design FIR filters. digital The FIR Window filters. The Window methods (Idealmethods filters, (Ideal Rectangular filters, RectangularWindow and Window Hamming and Window Hamming [1]) Window are the simplest [1]) are the simplest methods formethods designing for FIR designing digital filters. FIR digital Here, filters. the design Here, of the FIR design with ofsimple FIRwith frequency simple frequency response shapesresponse filters shapes is presented. filters is The presented. ideal frequency The ideal response frequency D response(ω) is periodicD(!) is in periodic in ! π ω with2 periodπ 2 as shown in Figure1. The Discrete-Time Fourier Transform (DTFT) and the with periodinverse DTFT as shown relationships in Figure are 1. usedThe Disc to estimaterete-Time the Fourier impulse Transform response (DTFT) d = (k) as and the inverse DTFT relationships are used to estimate the impulse response d = (k) ¥ as − ! D(!) = ∑ d(k)e j k , ∞ k=−¥ π (1) D()ω = d(k) e − jRωk D⇔(!)e−j!k d(k) = 2π d! k=−∞ −π π (1) D()ω e − jωk After some algebra,d(k) the= final form ofthe dω impulse response is π −π 2 ej!ck − e−j!ck d(k) = (2) After some algebra, the final form of the impulse response2πjk is ω − ω and, as a result, the impulse responsese j ck − e forj theck ideal FIR filters are given as d(k) = π (2) 8 sin(! k) 2 jk > c with −¥ < k < ¥ (lowpass filter) > πk and, as a result, the impulse<> responsesδ for sinthe(! idealck) FIR filters are given as (k) − πk with −¥ < k < ¥ (highpass filter) d(k) = sin(! k)−sin(! k) (3) > b α with −¥ < k < ¥ (bandpass filter) > πk :> δ sin(!bk)−sin(!αk) (k) − πk with −¥ < k < ¥ (bandpass filter) Symmetry 2021, 13, 533 3 of 9 It is worth mentioning that for the same cutoff frequencies the lowpass/highpass filters and bandpass/bandstop filters are complementary [1], which can be useful for graphic equalizers and loudspeaker cross-over networks. 2.2. IIR Filters The bilinear transformation method is commonly used to design IIR digital filters. This method maps the digital filter into an equivalent analog filter, which can be designed by using one of the well-developed analog filter design methods, such as Butterworth, Chebyshev, or elliptic filter designs. Considering a map of the form s = f(z), (4) where “s” and “z” present the planes of analog filter and digital filter, respectively, the bilinear transformation can be written as 1 − z−1 s = , (5) 1 + z−1 with s = jW and z = ej! (! and W are the digital frequency and the equivalent analog frequency, respectively). The digital frequency and the analog frequency are connected via the following relation ! W = tan (6) 2 Here, we present the transfer function of the first-order lowpass filter. The general form of the transfer function is written as b + b z−1 ( ) = 0 1 H z −1 (7) 1 + α1z The final form of the transfer function for a first-order lowpass filter and the appropri- ate coefficients are given as −1 H(z) = b 1+z 1−αz−1 2 −AC/10 Gc = 10 where Ac is the attenuation (dB) ! (8) α = pGc c 2 tan 2 1−Gc 1−α s α = 1+α ,Hα(s) = s+α For the case of first-order highpass digital filters, the transfer function is given as s Hα(s) = (9) s + α Using the bilinear transformation [1] 1 − z−1 s = (10) 1 + z−1 the transfer function gets the form 1 − z−1 H(z) = b , (11) 1 − αz−1 where the coefficients have the form 1 − α 1 + α α = , b = (12) 1 + α 2 Symmetry 2021, 13, 533 4 of 9 2 Example 1. Let us consider a lowpass filter operating at 10 kHz, with Gc = 0.5 (3-dB frequency is 1 kHz). 2πfc 2π 1 kHz !c = = = 0.5π rads/sample fs 10 kHz ! W = c = 0.3249 c 2 The other coefficients in Equation (8) get the values Gc !c α = q tan = 0.3249 2 2 1 − Gc α = 0.5095 and b = 0.2453. As a result, the transfer function gets the form 1 + z−1 H(z) = 0.2453 1 − 0.5095z−1 2 Following the same procedure, for the case of Gc = 0.9, the transfer function is given by the following form 1 + z−1 H(z) = 0.4936 1 − 0.0128z−1 The magnitude response of the designed filters (lowpass and highpass filters) are presented in Figures2 and3, respectively. As it is shown, the transfer function for both the Symmetry 2021, 13, x FOR PEER REVIEW 5 of 10 first-order lowpass and the first-order highpass filters depends strongly on the parameters 2 !c and Gc. FigureFigure 2. 2. TheThe transfer transfer function function for for first-orderfirst-order lowpass lowpass digitaldigital filters filters as as a a function function of of frequency.