Published on International Journal of Engineering & Industry

Publication Date: June 21, 2019

**Wai Phyo Aung, Khun Kyaw Thet Zaw & Thu Thu San**

Prof. and HOD, Electronic Engineering Department, TU(Loikaw)

Demostrator, Electronic Engineering Department, TU(Loikaw)

Loikaw, Kayah State, Myanmar

Journal Full Text PDF: Design and Simulation of IIR Digital Filter using NI Labview.

**Abstract**

The main objective of this paper present the design and analysis of various Infinite Impulse Response (IIR) Filter using NI labview as the simulation processess. Digital Filter Design is a portion of Digital Signal Processing and it is essential needed to simulate before application or for the purpose of studying. All the types of IIR filters like Butterworth filters, Chebyshev filters,inverse Chebyshev filters, and Elliptic filters can be designed to generate their magnitude response and filter coefficients. The LabVIEW software is used to develop virtual instrument (VI) that includes a front panel and a functional diagram.In this paper Butterworth filters, Chebyshev filters and Elliptic filters of IIR types are designed and compared.

**Keywords:** Digital Filters, IIR filters, Butterworth, Chebyshev, Elliptic, LabVIEW software, design and analysis.

**1. INTRODUCTION TO LabVIEW DIGITAL SIGNAL PROCESSING**

The LabVIEW based digital filter system involves the concept of Virtual Instrumentation. A

virtual instrumentation system is computer software that a user would employ to develop a computerized test and measurement system, for controlling from a computer desktop an external measurement hardware device, and for displaying test or measurement data collected by the external device on instrumentlike panels on a computer screen.

The design of IIR filters proceeds through a vastly different set of steps than those followed by FIR filter design algorithms. The design of IIR filters is closely related to the design of analog

filters, which is a widely studied topic. An analog filter is usually designed and a transformation is carried out into the digital domain. Two transformations exist – the impulse invariant transformation and the bilinear transformation. In this paper, the focus is on designing minimum order IIR filters to meet a set of specifications using LabVIEW functions. Each design is accompanied by a plot of its frequency response, impulse response and pole-zero diagrams.

In signal processing, the function of a filter is to remove unwanted parts of the signal, such as random noise, or to extract useful parts of the signal, such as the components lying within a certain frequency range. There are two main kinds of filter, analog and digital. Infinite impulse response (IIR) filter, also known as recursive filter (a recursive filter is one which in addition to input values also uses previous output values). IIR filters have the advantages of providing the higher selectivity for a particular order. IIR filters can achieve the same level of attenuation as FIR filters but with far fewer coefficients. Therefore, an IIR filter can provide a significantly faster and more efficient filtering operation than an FIR filter.

**2. FUNCTIONS USED FOR DESIGNING IIR FILTERS IN VIs**

**2.1. Stacked Sequence Structure**

A Stacked Sequence structure consists of one or more subdiagrams, or frames, that execute sequentially. Right-click the structure border to add and delete frames or to create sequence locals to pass data between frames. Use the Stacked Sequence structure to ensure a subdiagram executes before or after another subdiagram.

Fig.1-a

To create a Stacked Sequence structure, place a Flat Sequence structure on the block diagram, right-click the Flat Sequence structure, and select Replace with Stacked Sequence.

**2.2. Unbundle By Name Function**

Owning Palette: Cluster, Class, & Variant VIs and Functions

Returns the cluster elements whose names you specify.We don’t have to keep track of the order of the elements within the cluster. This function does not require the number of elements to match the number in the cluster. After you wire a cluster to this function, you can select an individual element from the function.The connector pane displays the default data types for this polymorphic function.

Fig. 1-b

**2.3. Impulse pattern.vi**

Samples is the number of samples of the Impulse Pattern. samples must be greater than delay. The default is 128. If samples is negative or zero, the VI sets Impulse Pattern to an empty array and returns an error.Amplitude is the amplitude of Impulse Pattern. The default is 1.0. Delay is the index within Impulse Pattern at which the impulse occurs. delay must be greater than or equal to 0. If delay is less than zero, or greater than or equal to the number of samples, the VI sets Impulse Pattern to zero and returns an error.

Fig. 1-c

Impulse Pattern is the output array containing the impulse pattern. The largest Impulse Pattern the VI can generate depends on the amount of memory in your system and is theoretically limited to 2,147,483,647 (231 – 1) elements. Error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

**2.4. Butterworth coefficients.vi**

Filter structure option specifies the order of the IIR cascade filter in IIR Filter Cluster.

0: IIR 2nd Order—Returns IIR second-order filter stages.

1: IIR 4th Order—Returns IIR fourth-order filter stages.

2:Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the filter type. If filter type is Lowpass or Highpass, this VI returns IIR second-order filter stages. If filter type is Bandpass or Bandstop, this VI returns IIR fourth-order filter stages.

Fig. 1-d

**2.5. Filter type specifies the passband of the filter.**

0 Lowpass

1 Highpass

2 Bandpass

3 Bandstop

Sampling freq(fs): fs is the sampling frequency in Hz and must be greater than zero. The default is 1.0 Hz. If sampling freq: fs is less than or equal to zero, the VI sets Reverse Coefficients and Forward Coefficients to empty arrays and returns an error.

High cutoff freq fh is the high cutoff frequency in Hz. The default is 0.45 Hz. The VI ignores this parameter when filter type is 0 (Lowpass) or 1 (Highpass). When filter type is 2 (Bandpass) or 3 (Bandstop), high cutoff freq: fh must be greater than low cutoff freq: fl and observe the Nyquist criterion.

Low cutoff freq: fl is the low cutoff frequency in Hz and must observe the Nyquist criterion. If low cutoff freq: fl is less than zero or greater than half the sampling frequency, this VI sets Reverse Coefficients and Forward Coefficients to empty arrays and returns an error. Note All cutoff frequencies must be less than half the sampling frequency.

**2.6. IIR Filter Cluster**

IIR Filter Cluster contains the cascaded form of IIR filter coefficients. Filter structure indicates either IIR second-order or IIR fourth-order filter stages.

**2.7. Reverse/Forward Coefficients**

Reverse Coefficients is the reverse coefficients of the IIR cascade filter. Forward Coefficients is the forward coefficients of the IIR cascade filter.Error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

**2.8. Butterworth Filter.vi**

Filter type specifies the passband of the filter.

0 Lowpass

1 Highpass

2 Bandpass

3 Bandstop

Fig. 1-e

X is the input signal to filter. Filtered X is the output array of filtered samples.Error returns any error or warning from the VI. We can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

**2.9. FFT.vi**

Finite Fourier Transform (FFT) size is the length of the FFT you want to perform. If FFT size is greater than the number of elements in X, this VI adds zeros to the end of X to match the size of FFT size. If FFT size is less than the number of elements in X, this VI uses only the first n elements in X to perform the FFT, where n is FFT size. If FFT size is less than or equal to 0, this VI uses the length of X as the FFT size. FFT {X} is the FFT of X. Error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Fig. 1-f

**2.10. Complex Polynomial Roots.vi**

Fig. 1-g

(* Figure 1: Functions used in VIs)

2.11. Other Functions

complex to real/imaginary, complex to polar, Bundle Function,Build Array,Array Size, Array Subset and Logarithm base 10 Functions are used to design IIR Filters.

**3. THEORY CONCEPTS OF DIGITAL FILTERS DESIGN**

**3.1. Butterworth Filters**

Butterworth filters have the following characteristics:

• Smooth response at all frequencies

• Monotonic decrease from the specified cut-off frequencies

• Maximal flatness, with the ideal response of unity in the passband and zero in the stopband

• Half-power frequency, or 3 dB down frequency, that corresponds to the specified cut-off frequencies.

The transfer function for Butterworth filter is given by:

Equation (1)

Where n is the order of filter .Butterworth filters do not always provide a good approximation

of the ideal filter response because of the slow rolloff between the passband and the stopband.

**3.2. Chebyshev Filters**

Chebyshev filters have the following characteristics:

• Minimization of peak error in the passband

• Equiripple magnitude response in the passband

• Monotonically decreasing magnitude response in the stopband

• Sharper rolloff than Butterworth filters

Compared to a Butterworth filter, a Chebyshev filter can achieve a sharper transition between the passband and the stopband with a lower order filter. The sharp transition between the passband and

the stopband of a Chebyshev filter produces smaller absolute errors and faster execution speeds than a Butterworth filter. The frequency response of the filter is given by:

Equation (2)

Where ε is a parameter of the filter is related to ripple present in the passband andT(x)N is the Nth- order Chebyshev polynomial defined as:

Equation (3)

**3.3. Elliptic Filters**

Elliptic filters have the following characteristics:

• Minimization of peak error in the passband and the stopband

• Equiripples in the passband and the stopband

Compared with the same order Butterworth or Chebyshev filters, the elliptic filters provide the sharpest transition between the passband and the stopband, which accounts for their widespread used.

The transfer function is given by:

Equation (4)

Where UN(x) is the Jacobian is elliptic function of order N and ε is a constant related to passband ripple. They provide a realization with the lowest order for a particular set of conditions.

**4. EXPERIMENTAL RESULTS**

**4.1. Building IIR filters in VIs**

The butterworth filter, chebyshev filter and eliptic filter for IIR type filters are design as simulation by building block diagram in NI LabVIEW as shown in Figure (2) to Figure (4).

**4.2. Test Results**

Figure (5) to Figure (7) show how we can compare, analyze and testing the required parameters or coeficient including pole/zero plot in the front pannel of VIs.

**5. CONCLUSION AND RECOMMENDATION**

In this paper, the design of IIR filters was considered. Several results from theory were verified in the design. characteristics of a number of important approximations Butterworth, Chebyshev, and Elliptic were affirmed from the results obtained. It is also verified that on increasing the order of any filter the transition band decreases for the same parameters. This research paper carried out the analysis of various IIR filter types, studying their desing in LabVIEW . By this research paper ,various order of IIR filters can be analysis for their performance.