Excerpt

## Table of Contents

Acknowledgment

Abstract

Objective

Table of Figures

1 Introduction

2 Theoretical Concepts

2.1 Finite Impulse Response – FIR

2.2 Infinite Impulse Response – IIR

3 Procedure

4 Analysis

5 Discussion

6 Conclusion

7 References

## Acknowledgment

I would like to express my very great appreciation to **ASSOC. PROF. DR. THANG KA FEI** for his valuable and productive suggestions during the planning and development of this research work **. ASSOC. PROF. DR. THANG KA FEI** provided me with very valuable guidance and monitoring regarding the development and the design of the Filters. I would also like to extend my thanks to the technicians of the laboratory of APU for offering me the resources in running the program.

## Abstract

Digital filters provide an important role in the world of communication. This lab report will discuss the steps taken to develop and design IIR and FIR filters of two filters types which are the Low-pass and the Band-pass filters. The main objective of this lab report to compare and analyze the IIR and FIR filters. At first, a background about the topic of the report would be made. Then, the theoretical concept of the filters is being discussed. After that, the procedure and the steps taken to design the filters are to be explained. Then, the results would be displayed and analyzed. A discussion about the observations and findings made are to be stated. At last, a conclusion about the achievements made and the major outcomes of the investigation are stated.

## Objective

The main objectives of this lab report is:

1. Generate frequency-domain analysis of discrete-time signals.

2. Design appropriate Infinite-Impulse Response (IIR) and Finite-Impulse Response (FIR) filters.

## Table of Figures

Figure 1 Main Block Diagram

Figure 2 Signal from Workspace

Figure 3 IIR Low-pass filter

Figure 4 FIR Low-pass filter

Figure 5 IIR Band-pass filter

Figure 6 FIR Band-pass filter

Figure 7 Spectrum Analyzer

Figure 8 Original Signal

Figure 9 IIR Lowpass

Figure 10 FIR Lowpass

Figure 11 IIR Bandpass

Figure 12 FIR Bandpass

## 1 Introduction

One of the most dynamic areas of digital systems today is in the field of digital signal processing or DSP. A DSP is a very specialized form of microprocessor that has been optimized to perform repetitive calculations on stream of digitized data. (Dhar, 2019) The digitized data are usually being fed to the DSP from an ADC (Analog to Digital converter). A calculation is performed by the DSP to process these digitized data that come in. This calculation involves the most recent data point as well as several of the preceding data samples. The result of the calculation produces a new output data point, which is usually sent to a DAC (Digital to Analog) converter. A major application of DSP is in filtering and conditioning of analog signals. Filtering of a signal can be done by taking samples of the signal with an ADC, performing mathematical operation on the samples with a microcomputer and output the result to a DAC. This digital filter approach can easily produce filter response. The digital approach has the further advantage in that the filter response can be changed under program control.

Speech is the most basic and preferred means of communication among humans. In speech processing, a filter removes the unwanted signal and allows the desired signal. Filters may be analog or digital. Digital filtering is one of the important tools for digital signal processing applications. Digital filters can perform that specifications which are extremely difficult to achieve with an analog implementation. Multiple filtering is possible, and it can be operated over wide range of frequencies, because the characteristics of digital filters can be easily changed under software control. Digital filters are classified either as Finite duration impulse response (FIR) filters or Infinite duration impulse response (IIR) filters, depending on the form of impulse response of the system.

This assignment will include the development of a Lowpass filter and a Bandpass filter by using both IIR and FIR filters to a specific given signal. A comparison between both filters will then be made by comparing the achieved results based on the observations made.

## 2 Theoretical Concepts

Detection of a wanted signal may be impossible if unwanted signals and noise are not removed sufficiently by filtering. Electronic filters allow some signals to pass but stop others. To be more precise, filters allow some signal frequencies applied at their input terminals to pass through to their output terminals with little or no reduction in signal level. An ideal filter can be described as a brick wall. However, this kind of filter does not exist in real world application. A further relationship between the time and frequency domains can be used to explain why the “brick wall” filter cannot exist. The reason why the “brick wall” filter cannot be built is because of the relationship between the time and frequency domains. Just as a voltage step function (a sudden change in the time domain) has frequency components that extend across a wide band, a step function in the frequency domain has voltage components that extend across a wide period of time. The frequency domain can be considered to cover both positive and negative frequencies, so a 1 kHz sine wave can be represented by a pair of spectral lines at +I kHz and -1 kHz. (Winder, 2002) The step frequency response will, by reciprocity, have time domain components at positive and negative time, relative to the event. Since a response cannot occur before an event has taken place (i.e., negative time), the step frequency response cannot exist.

An important relationship between the time domain and the frequency domain occurs when two signals are multiplied together. This relationship is important in digital filter design. Digital filters operate on digitized analog signals, so the digitization process is important and can be critical in the system design. Digitization requires the analog signal to be sampled and then converted into a digital value, based on the amplitude of the sample. A digital filter is a filter that works by performing digital mathematical operations on an intermediate form of a signal. It takes a digital input, gives a digital output and consists of digital components.

Digital filters are classified into two types depending on the duration of the impulse response. For finite-duration impulse response (FIR) digital filter, the operation is governed by linear constant-coefficient difference equations of a non-recursive nature. The transfer function of a FIR digital filter is a polynomial in z-[1]. Infinite-duration impulse response (IIR) digital filters whose input-output characteristics are governed by linear constant-coefficient difference equations of a recursive nature. The transfer function of an IIR digital filter is a rational function in z-[1].

### 2.1 Finite Impulse Response – FIR

A FIR filter comprises an array of delay elements connected in series. A tap is taken after each element, and, at any sample instance, the value of the sample is multiplied by a filter coefficient. Thus, a multiplier is needed for each delay element. Finally, the outputs of all the multipliers are added together to give the output. The number of taps is given by N, but there are N-1 delay elements; the term N-1 is sometimes referred to as the filter order. It is common to use an odd number of taps, which results in an even number of delay elements. Often, the filter coefficients are symmetrical. This allows us to design a hardware-reducing configuration where the delayed signal is fed back to halve the number of multipliers required. The circuit is folded around so that the first and last outputs from the delay line are added together and then multiplied by a common coefficient. Extra summing circuits are required, but the output stage adder has only half the number of inputs and therefore is simpler to implement. The duration or sequence length of the impulse response of these filters is finite. Therefore, the output can be written as a finite convolution sum by:

FIR is designed by truncating the impulse-response of an ideal IIR filter. Truncating the envelope, by limiting its extent to a certain time limit, causes ripple in the frequency response passband and stopband, and limits the achievable stopband attenuation. Truncation can be applied gradually using specially designed window functions; these reduce the ripple effects and improve the stopband attenuation. Windows are applied by multiplying the window coefficients by the impulse response of the IIR filter. This would produce the impulse response of the FIR filter.

where h[n] is the impulse response of FIR filter, is the impulse response of IIR filter and w[n] represents a rectangular window of length N. w[n] equals to one for 0 ≤ n ≤ N-1 and zero otherwise. Different window functions can be used according to the application of the filter. Some of the most known window functions are Rectangular window, Bartlett window, Hamming window and Blackman window.

### 2.2 Infinite Impulse Response – IIR

IIR filters are one of two primary types of digital filters used in Digital Signal Processing (DSP) applications (the other type being FIR). IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they have the feedback (a recursive part of a filter) and are known as recursive digital filters. For this reason, IIR filters have much better frequency response than FIR filters of the same order. Digital filters with an Infinite-duration Impulse Response (IIR) have characteristics that make them useful in many applications. Infinite impulse response (IIR) filters are more efficient than FIR filters because, for a given frequency response, they require fewer delay elements, adders, and multipliers. The disadvantage of IIR filters is their nonlinear phase response. The design of an IIR filter can be done by following two steps. The first step is Analogue prototyping where the second step is Discretization. Most IIR filters are designed using an analog filter model. Analog filter models are the familiar Butterworth, Chebyshev, Cauer (Elliptic). Inverse Chebyshev, and Bessel types. The linear frequency response formulae H ( ) can be converted into the digital equivalent using Impulse Invariant, Step Invariant, or Bilinear Transformation. Only the bilinear transform provides a general-purpose conversion function that can be used for low-pass, high-pass, band-pass. and band-stop responses. The impulse invariant and step invariant conversion functions are quite difficult to apply and can only be used for low-pass filters (and band-pass with great care): these conversion functions cannot be used with high-pass or band-stop responses. The bilinear transform is used to convert the analog frequency response into a digital domain response. The advantage of the bilinear transform is that any response, be it low-pass, high-pass, band-pass, or band-stop, can be converted. The digital domain is also known as the Z-domain. The transformation from the analog S-plane into the digital Z-plane is quite simple to visualize. The S-plane frequency axis is wrapped around onto itself into the Z-plane to form a circle. One side of the circle is the zero-frequency point, which is the origin on the S-plane diagram. The other side of the circle is where the +infinity and -infinity points meet. The bilinear transform is a simple mathematical process. Starting with an analog frequency response, H(s), bilinear transformation to produce H(z) is made by substitution of s.

## 3 Procedure

In this section, the steps taken to develop and design the IIR and FIR filters would be discussed. The filters were designed using SIMULINK in MATLAB software. Figure 1 shows the block diagram to be designed in order to develop the system. The system consists of four filters. The four filters are the IIR low-pass filter, the FIR low-pass filter, the IIR band-pass filter and the FIR band-pass filter. The input was gotten from the workspace and its settings were adjusted. Each of the block design filters were obtained from the DSP System Toolbox and their parameters were entered. The output was displayed in the spectrum analyzer. Each of the adjusted settings and all the parameters entered would be explained and showed in detail in this section.

Abbildung in dieser Leseprobe nicht enthalten

Figure 1 Main Block Diagram

At first, the signal given is loaded in the MATLAB software. From the loaded signal in the MATLAB, the sampling frequency is obtained. The obtained sampling frequency is 2000Hz. Also, the samples of the signal are obtained where there were 10,000 samples in the signal. Then, by using SIMULINK, the simulation stop time is made five seconds. This is made as there are 10,000 samples and the sampling frequency is 2000Hz. Therefore, a total of five seconds is needed. After that, a block, from the DSP System Toolbox, is entered. The block to be entered is the ‘Signal from Workspace’. This block would allow the loaded signal from the MATLAB to be used in SIMULINK. To fully utilize this block, there are some parameters to be adjusted. The first parameter is to write the name of the signal as indicated in the workspace. The second parameter is the sampling time. The entered sampling time was 1/fs, as T, which is the sampling time is equal to 1/fs. At last, the number of samples per frame is entered. 512 samples per frame was chosen.

Abbildung in dieser Leseprobe nicht enthalten

Figure 2 Signal from Workspace

After getting the signal into SIMULINK, a ‘Digital Filter Design’ block is to be inserted. This is to be inserted from the DSP System Toolbox. This block is to be used to design the filter. At first, two low-pass filter is to be developed where one of them is the IIR filter and the second is the FIR filter. The IIR low-pass filter is shown in Figure 3. There are some parameters to be changed to obtain the IIR low-pass filter. The first thing to be changed is the response type. Since a low-pass filter is to be designed, the response type is to be changed to lowpass. The design method to be used is the IIR and the analogue filter chosen was Chebyshev Type 2. This type of filter was chosen as it has a steep transition band comparing to other filters. Then, the filter method is to be specified as minimum order. This is specified as that to make the SIMULINK get the most accurate result using the minimum order possible. Then, the frequency specifications are to be specified. The fs is chosen as 2kHz. The passband frequency is chosen as 160 Hz where the stopband frequency is chosen as 220Hz. The passband frequency was chosen as that since the frequency component at 150Hz is chosen to be passed. The stopband frequency is chosen as such to make the order as less as possible and since there is no frequency before 220Hz.

**[...]**

- Quote paper
- Bandar Hezam (Author), Frequency-domain analysis of discrete-time signals and design of Infinite-Impulse Response (IIR) and Finite-Impulse Response (FIR) filters, Munich, GRIN Verlag, https://www.grin.com/document/1321034

Publish now - it's free

Comments