MEE 0828
SOFTWARE IMPLEMENTATION
OF DIGITAL FILTERS
Satish kumar Are Manoranjan Reddy Thangalla Saikrishna Gajjala
This thesis is presented as part of Degree of Master of Science in Electrical Engineering
Blekinge Institute of Technology August 2008
Blekinge Institute of Technology School of Engineering Department of Signal Processing Supervisors: Nedelko Grbic Mikael Swartling
2
ABSTRACT This thesis proposes to create a MATLAB GUI (Graphical User Interface) to replace an existing laboration exercise in signal processing at Blekinge Institute of Technology. MATLAB is a matrix-based technical computing language widely used throughout the scientific, engineering and mathematical communities. A GUI provides a graphical interface between the program and the user, facilitating ease and frequency of use. Development of a MATLAB GUI for this laboration exercise will benefit the students and increase the awareness towards designing of digital filters.
The developed software provides an interface between audio recording and playback hardware and the user when exploring filter design parameters. This software is designed for analyzing digital filter characteristics such as amplitude, phase and pole/zero locations which are useful in designing an appropriate filter. This can be achieved by entering arbitrary filter parameters.
3
4
ACKNOWLEDGMENTS We would like to express our sincerest thanks and gratitude to Mikael Swartling for being our mentor on this journey. His guidance, patience and support throughout this project have been a blessing. We would also like to thank our teacher of signal processing Nedelko Grbic for providing such a good project and interesting lectures on signal processing. Finally we would like to thank Mikael Åsman for support and suggestions towards the project.
5
Table of Contents Introduction ...... 7 Chapter 1: DIGITAL FILTERS ...... 8 1.1 Background ...... 8 1.2 FIR filters ...... 9 1.3 Types of windows ...... 10 1.3.1 Rectangular window ...... 10 1.3.2 Bartlett window ...... 11 1.3.3 Hanning window ...... 12 1.3.4 Hamming window...... 13 1.3.5 Blackman window ...... 14 1.4 Design considerations ...... 15 1.5 Observations ...... 16 1.6 IIR filters...... 17 1.6.1 Bilinear transformation ...... 17 1.6.2 Butterworth approximation ...... 17 1.6.3 Chebyshev approximation ...... 18 1.7 Design considerations ...... 19 1.8 Observations ...... 20 Chapter 2 : Developed Software ...... 21 2.1 Digital filter software GUI ...... 21 2.1.1 Filter selection panel ...... 22 2.1.2 Input Selection panel ...... 22 2.1.3 Filter specifications panel ...... 23 2.2 Digital filter analysis ...... 24 2.2.1 Plot panel ...... 24 2.2.2 Pole/zero plot ...... 25 Conclusion ...... 26 Appendix ...... 27 References ...... 29
6
Introduction
Existing problem For analysis of digital filters, DOS based software was developed years back at Blekinge Institute of Technology for students of signal processing. However, this software have drawbacks such as portability, inefficient use of computer resources, less accessibility and bulk hardware system due to floating point DSP which requires extra hardware for floating point operations. The developed software has some constraints as it is not user friendly.
Possible solution With extensive advancements in scientific software, a user friendly graphical user interface was developed using MATLAB graphical user interface for the analysis of digital filters. This GUI will overcome the complexities mentioned earlier. The developed software will help the user to analyze the filters in an efficient manner due to the availability of input signals, windows, various types of filters such as lowpass, highpass, bandpass, and bandstop filters, and pole/zero plot with filter coefficients.
7
Chapter 1: Digital Filters
1.1 Background The term ‘filter’ is frequently used in signal processing. A filter is a frequency selective device that removes unwanted information from the original message signal. Unwanted signals can be noise or other undesired information. Digital filters are more versatile when compared to the analog filters in their characteristics such as programming flexibility, ability to handle both low as well as high frequency signals accurately. Also the hardware requirement is relatively simple and compact. In real world signals are analog in nature. A simple signal flow block diagram that explains how the signal is processed to acquire desired output signal is shown in figure 1.1.
ADC PROCESSOR DAC unfiltered sampled digitally filtered analog digitised filtered analog signal signal signal signal
Figure 1.1: Signal flow block diagram.
Analog to digital conversion is an engineering process that enables digital processor to interact with real world signals. The input to the processor should be properly sampled and quantized. Sampling and quantization restrict the amount of information a digital signal contain. In the figure 1.1 an interface is provided between analog signal and the digital signal processor called analog to digital converter (ADC). The output from ADC is input to the processor. In applications output from the processor is to be given to user in analog form such as speech communications, for this an interface is provided from digital domain to the analog domain. This interface is called digital to analog converter (DAC). Thus the signal is provided in analog for to the user as shown in figure 1.1. The processor in figure 1.1 can be anywhere from a large programmable digital computer to a small microprocessor which contains digital filters.
8
The digital filters are two types based on their impulse response; finite impulse response (FIR) and infinite impulse response (IIR) filters. FIR filters have same time delay for all frequencies (linear phase), relatively insensitive to quantization and are always stable. FIR filters can be designed in different ways, for example window method, frequency sampling method, weighted least squares method, minimax method and equiripple method. Out of these methods, the window technique is most conventional method for designing FIR filters.
1.2 FIR filters A finite impulse response filter of length with input and output is described by the difference equation