EE 422G - Signals and Systems Laboratory

Similar documents
Designing Filters Using the NI LabVIEW Digital Filter Design Toolkit

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #8: Filter Design of FIR Filters

B.Tech III Year II Semester (R13) Regular & Supplementary Examinations May/June 2017 DIGITAL SIGNAL PROCESSING (Common to ECE and EIE)

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

Electrical & Computer Engineering Technology

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

1 PeZ: Introduction. 1.1 Controls for PeZ using pezdemo. Lab 15b: FIR Filter Design and PeZ: The z, n, and O! Domains

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

George Mason University Signals and Systems I Spring 2016

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

Discrete Fourier Transform (DFT)

Discrete-Time Signal Processing (DTSP) v14

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

Digital Filtering: Realization

Signal Processing Toolbox

ijdsp Workshop: Exercise 2012 DSP Exercise Objectives

Digital Filters FIR and IIR Systems

Lecture 17 z-transforms 2

Experiment 2 Effects of Filtering

EE 470 Signals and Systems

Design of FIR Filter for Efficient Utilization of Speech Signal Akanksha. Raj 1 Arshiyanaz. Khateeb 2 Fakrunnisa.Balaganur 3

EE 422G - Signals and Systems Laboratory

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual.

Signals and Systems Using MATLAB

DFT: Discrete Fourier Transform & Linear Signal Processing

DSP First Lab 08: Frequency Response: Bandpass and Nulling Filters

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

Basic Signals and Systems

Signals. Continuous valued or discrete valued Can the signal take any value or only discrete values?

EE 462G Laboratory #1 Measuring Capacitance

ECE 4213/5213 Homework 10

Design of FIR Filters

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

The University of Texas at Austin Dept. of Electrical and Computer Engineering Final Exam

Laboratory Assignment 5 Amplitude Modulation

Chapter 5 Window Functions. periodic with a period of N (number of samples). This is observed in table (3.1).

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

EEM478-DSPHARDWARE. WEEK12:FIR & IIR Filter Design

2.1 BASIC CONCEPTS Basic Operations on Signals Time Shifting. Figure 2.2 Time shifting of a signal. Time Reversal.

4. Design of Discrete-Time Filters

Brief Introduction to Signals & Systems. Phani Chavali

ECEN 325 Lab 5: Operational Amplifiers Part III

Question 1 Draw a block diagram to illustrate how the data was acquired. Be sure to include important parameter values

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY DIGITAL SIGNAL PROCESSING UNIT 3

Design Digital Non-Recursive FIR Filter by Using Exponential Window

System analysis and signal processing

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Laboratory Assignment 4. Fourier Sound Synthesis

Lecture 3 Review of Signals and Systems: Part 2. EE4900/EE6720 Digital Communications

Lab S-8: Spectrograms: Harmonic Lines & Chirp Aliasing

Digital Signal Processing

Digital Filter Design using MATLAB

Lakehead University. Department of Electrical Engineering

EECS 216 Winter 2008 Lab 2: FM Detector Part I: Intro & Pre-lab Assignment

Laboratory Project 4: Frequency Response and Filters

ELEC3104: Digital Signal Processing Session 1, 2013 LABORATORY 3: IMPULSE RESPONSE, FREQUENCY RESPONSE AND POLES/ZEROS OF SYSTEMS

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

Experiments #6. Convolution and Linear Time Invariant Systems

Infinite Impulse Response Filters

Spring 2014 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #2. Filter Analysis, Simulation, and Design

Lab S-5: DLTI GUI and Nulling Filters. Please read through the information below prior to attending your lab.

EECS 216 Winter 2008 Lab 2: FM Detector Part II: In-Lab & Post-Lab Assignment

BME 3512 Bioelectronics Laboratory Two - Passive Filters

Comparison of Signal Attenuation of Multiple Frequencies Between Passive and Active High-Pass Filters

DIGITAL SIGNAL PROCESSING (Date of document: 6 th May 2014)

EE 233 Circuit Theory Lab 3: First-Order Filters


EE 470 BIOMEDICAL SIGNALS AND SYSTEMS. Active Learning Exercises Part 2

Problem Set 1 (Solutions are due Mon )

Lab 3 FFT based Spectrum Analyzer

SGN Bachelor s Laboratory Course in Signal Processing Audio frequency band division filter ( ) Name: Student number:

L A B 3 : G E N E R A T I N G S I N U S O I D S

ELT COMMUNICATION THEORY

Frequency Domain Representation of Signals

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

Digital Signal Processing

Review of Filter Types

IIR Filter Design Chapter Intended Learning Outcomes: (i) Ability to design analog Butterworth filters

EE 4440 Comm Theory Lab 5 Line Codes

UNIVERSITY OF SWAZILAND

Fourier Signal Analysis

Multirate Digital Signal Processing

Laboration Exercises in Digital Signal Processing

Linear Time-Invariant Systems

Lab 0: Introduction to TIMS AND MATLAB

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

4 Experiment 4: DC Motor Voltage to Speed Transfer Function Estimation by Step Response and Frequency Response (Part 2)

Department of Electrical and Electronics Engineering Institute of Technology, Korba Chhattisgarh, India

Fall 2009 ElEn 256 Analog and Digital Signal Processing

Experiment # 4. Frequency Modulation

Signal Processing for Digitizers

2) How fast can we implement these in a system

Bibliography. Practical Signal Processing and Its Applications Downloaded from

Advanced Digital Signal Processing Part 5: Digital Filters

Introduction to Signals and Systems Lecture #9 - Frequency Response. Guillaume Drion Academic year

Transcription:

EE 422G - Signals and Systems Laboratory Lab 3 FIR Filters Written by Kevin D. Donohue Department of Electrical and Computer Engineering University of Kentucky Lexington, KY 40506 September 19, 2015 Objectives: Use filter design and analysis tools to create FIR filters based on general filter specifications. Implement a real-time graphic equalizer in LabVIEW 1. Background Digital filters are used in a wide variety of signal processing applications, such as spectrum analysis, digital image processing, and pattern recognition. Digital filters eliminate a number of problems associated with their classical analog counterparts, and thus are often used in place of analog filters. The most common digital filters belong to the class of discrete-time LTI (linear time invariant) systems, which are characterized by the properties of causality, recursive operation, and stability. They can be characterized in the time domain by the unitimpulse response and in the z-transform domain by the transfer function. A unit-impulse response sequence of a causal LTI system can be either finite or infinite in duration. This property determines their classification as either a finite impulse response (FIR) or an infinite impulse response (IIR) systems. To illustrate this, consider the most general case of a discrete time LTI system with the input sequence denoted by x(kt) and the resulting output sequence y(kt) given by: M 1 0 N 1 y ( kt ) = b x(( k m) T ) a y(( k n) T ) (1) m The corresponding transfer function in the Z-domain is given by: M 1 n= 1 n= 1 n m bm z ˆ Yˆ( z) 0 H ( z) = = (2) ˆ N 1 X ( z) n 1+ a z n If at least one denominator coefficient an is nonzero, then system is recursive (its current output depends on previous output values), and as a result, its impulse response has an infinite duration (IIR system). If all denominator coefficients are zero (polynomial of order 0), the corresponding system is non-recursive (FIR system), and its impulse response is of finite duration. The transfer function of Eq. (2) in this case becomes a polynomial of finite order M-1:

Yˆ( z) M 1 ˆ m H ( z) = = ˆ b z (3) m 0 X ( z) The corresponding FIR difference equation in time domain is: M = 1 0 y ( kt ) b x(( k m) T ) (4) m As with analog filter design, the shape of the magnitude frequency response is often the criteria in discrete filter design. Recall the frequency response for continuous-time systems was obtained by evaluating its transfer function on the jω axis, similarly for the discrete case the transfer function in z is evaluated over the unit circle. In this case substitute z = exp(jω/ωs) where ωs is the sampling frequency in radians per second. Therefore, the frequency response of an FIR filter is given by: Hˆ M 1 mω = b m exp j (5) ω = 0 ωs ( ) z z exp j ωs Note that even though the time domain is discrete, the frequency response is continuous (defined for all ω); however, the frequency response is periodic with period ωs (due to the periodic behavior of the complex exponential, consistent with the concept of aliasing). The design of digital filters involves determining the filter order (M) and computing coefficient values (bi s in the above equations) to achieve the desired filter response. The desired response can be specified in the frequency domain in terms of the magnitude response and/or the phase response. It can also be specified in terms of the impulse response in the time domain. Once filter coefficients are computed, the filter performance is analyzed to verify the filter meets the specifications. In this lab you will design FIR filters using 2 popular methods impulse response windowing and the Parks-McClellan algorithm. See help files in Matlab for fir1() and firpm() for a more detailed explanation of the 2 methods and algorithms used in each of these approaches. For the analysis of the filter, see help on transfer function evaluations tools like fft() (this takes the DFT of the signal) and freqz() (this implements the frequency response computation of Eq. (5)). There are 2 useful scripts posted on the class web site, which are winlook and firlook that show examples of using these functions. To better understand the behavior of the filters and the design process, it is useful to have a working knowledge of the sinc function, as well as tapering window functions. These are used in the impulse response windowing method. 2. Pre-Laboratory Assignment 1. Sketch a rectangular function with height A and width T seconds symmetric about 0. Sketch its Fourier transform (sinc function) and label the axis to identify the width of its mainlobe (distance between the first null points on the frequency axis), height of the

mainlobe, and height of the first sidelobe (absolute value of the peak between first and second null points on either the positive or negative frequency axis) in terms of A and T. 2. For the tapering window functions listed below, write a script to plot each window function on the same graph (use different line styles for each window function plot). Create another graph and plot their DFT magnitudes on a linear scale, and finally create another graph and plot their DFT magnitudes on a db scale. Comment on how the general window shape (steepness of taper) affects the spectral magnitude (impact on width of mainlobe and height of sidelobes) a) Boxcar b) Triangular c) Hamming 3. The Kaiser window is also very popular because the degree of the taper can be adjusted parametrically with parameterβ. Repeat number 2 for a Kaiser window of length 128 and with β values of 2, 6, and 10. (see help kaiser in Matlab). 4. Become familiar with the template scripts winlook.m and firlook.m, posted on the course web site. Read through the comments so you know how they relate to the laboratory exercises. There is nothing to hand in on the prelab for this exercise. 3. Laboratory Assignment FIR Filter Design Methods (Assume sampling frequency of 44.1kHz, unless otherwise specified) 1. Design a 127 th order linear-phase FIR low-pass filter with a cut-off at 10kHz using the windowing method (fir1). Design a filter using each of the following windows: a. rectangular (boxcar) b. triangular (triang) c. Hamming (hamming) On a single graph, plot all the impulse responses together, and on another graph plot all the (frequency) magnitude responses together. In individual graphs plot the pole-zero locations of the 3 filters. Show these to the TA and indicate the impact window shape has on the filter characteristics (impulse response, Spectral magnitude, and zero placements). Refer to the window plots of the prelab (in discussion use language such as mainlobe width, sidelobe, taper ) and make a general statement about the impact of window characteristics on the filter characteristics. 2. Repeat Exercise 1 using a Kaiser window with β = 2, 6, and 10 a cut off of 10kHz. Plot the impulse response, magnitude response, and zero-pole locations. Show the TA and point out any differences with the windows in Exercise 1. How does the trade-off between transition bandwidth and ripple vary with β.

3. Repeat Exercise 2 for a 31 at order linear-phase FIR low-pass filter. Plot impulse response, magnitude response, and zero-pole locations. Show the TA and describe the impact of filter order. 4. Design an optimal 31-order low-pass FIR filter using the Parks-McClellan algorithm (firpm). Use a pass-band cutoff of 9kHz and a stop-band cutoff of 13kHz. Plot the impulse response, magnitude response, and zero-pole locations. Examine the plots to ensure the filter meets these specifications. Then generate a square wave signal of 528.2 Hz and determine its approximate bandwidth (i.e. the frequency range that contains significant energy) by using the fft() command and plotting its spectral magnitude. Use the Parks-McClellan algorithm (firpm) to design a 151-order FIR low-pass filter, such that frequencies starting with the 3 rd harmonic (i.e. at 3*528.2 =1584.6Hz) are suppressed by 10 db or more with minimal impact on the fundamental and 2 nd harmonic. Plot the magnitude response of the filter and also the filtered output. Produce a graph to demonstrate how well the filter achieved the specification. Use soundsc to play the sound before and after filtering and plot a few cycles of the input and output waveforms. Present the final result for the TA (both aurally and graphically) and demonstrate the effect of suppressing the higher harmonics. LabVIEW Real-Time Graphic Equalizer 5. Create a real-time 3-band graphic equalizer for an audio waveform sampled at 8kHz. The program should display the average spectrum (PSD) and time waveform. Set the 3 bands to cover the following frequency ranges as shown in Table 1. Table 1. Frequency ranges for 3 band equalizer Low 25 to 450 Hz Mid 450 to 1400 Hz High 1400 to 3200 Hz Demonstrate the filters and displays are working properly by first sending a simulated white noise signal through the system. When activating one filter (zero gain on the other 2 channels), the resulting spectrum should have the same shape as the desired spectrum for the filter. A sample VI is presented in Fig. 1. This uses LabVIEW s Digital FIR Filter.vi and Express VI to simulate white noise and show the spectrum. The dynamic data format from these express vi s will be consistent with the DAQ Assistant. So it should be minimal effort to replace the simulation vi with the actual DAQ acquiring real-time data from the microphone. As a first step build the system in Fig. 1. The express VI settings are shown in Fig. 2a for the Simulate Signal VI. In this case the sampling rate is set and the sample read/block size. While the VI is intended to simulate a sinusoid in additive white Gaussian noise (AWGN), the amplitude of the sine wave is set to 0 so only white noise is produced. Figure 2b shows the settings for the express vi that computes the PSD of the filtered signal. Note that different types of averaging and units are available. You can play around with these to see how they affect the spectral display. Once built, add 2 more FIR channels with variable gains, and set the pass-band parameters to meet the

requirements. When completed, show the TA that energy in each of the filtered bands can be controlled in real-time with your gain controllers. Now plug in the USB DAQ and connected the microphone to the high-impedance input of channel 1 on the amplifier (no phantom power). Connect the output of the amplifier channel to AI0 on the DAQ. Power up the amplifier with the gain set low to begin with (~ ¼ up from zero). Remove the signal simulation VI, and replace with the DAQ assistant VI. Configure for acquiring a signal as done for the simulations (i.e. same sampling rate and samples read values). Speak through the mic with various gains on the 3 bands. Make sure the time waveform appears and is consistent when you speak. You may need to increase the gain on the amp if the signal looks too weak. Demonstrate to the TA that it works.

(a) (b) Figure 1. Sample VI implementing a Digital FIR filter VI and testing with white noise (a) Block diagram, (b) Front panel. FIR band-pass filter from 1200 Hz to 3000 Hz.

(a) (b) Figure 2. Properties window with setting for the (a) Simulate Signal Express VI, and (b) for Spectral Measurements Express VI.