Massachusetts Institute of Technology Department of Electrical Engineering & Computer Science 6.341: Discrete-Time Signal Processing Fall 2005

Similar documents
ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

EEO 401 Digital Signal Processing Prof. Mark Fowler

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

Octave Functions for Filters. Young Won Lim 2/19/18

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

Team proposals are due tomorrow at 6PM Homework 4 is due next thur. Proposal presentations are next mon in 1311EECS.

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

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

UNIT-II MYcsvtu Notes agk

Analog Lowpass Filter Specifications

Brief Introduction to Signals & Systems. Phani Chavali

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

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

Digital Filters FIR and IIR Systems

Review of Filter Types

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

ELEC3104: Digital Signal Processing Session 1, 2013

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

EE 470 Signals and Systems

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

Signals and Filtering

GUJARAT TECHNOLOGICAL UNIVERSITY

Chapter 7 Filter Design Techniques. Filter Design Techniques

Multirate Digital Signal Processing

Filters. Phani Chavali

NOVEMBER 13, 1996 EE 4773/6773: LECTURE NO. 37 PAGE 1 of 5

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

Infinite Impulse Response (IIR) Filter. Ikhwannul Kholis, ST., MT. Universitas 17 Agustus 1945 Jakarta

EE 422G - Signals and Systems Laboratory

Performance Evaluation of Mean Square Error of Butterworth and Chebyshev1 Filter with Matlab

Transactions on Engineering Sciences vol 3, 1993 WIT Press, ISSN

Part One. Efficient Digital Filters COPYRIGHTED MATERIAL

ECE 4213/5213 Homework 10

EEM478-DSPHARDWARE. WEEK12:FIR & IIR Filter Design

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

DESIGN OF FIR AND IIR FILTERS

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

Florida International University

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

ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet

Signal processing preliminaries

Copyright S. K. Mitra

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

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

Signal Processing Toolbox

Project 2 - Speech Detection with FIR Filters

CHAPTER -2 NOTCH FILTER DESIGN TECHNIQUES

Multirate DSP, part 1: Upsampling and downsampling

Design of FIR Filters

ECE 5650/4650 Exam II November 20, 2018 Name:

ESE531 Spring University of Pennsylvania Department of Electrical and System Engineering Digital Signal Processing

8: IIR Filter Transformations

Digital Processing of Continuous-Time Signals

ECSE-4760 Computer Applications Laboratory DIGITAL FILTER DESIGN

Electrical & Computer Engineering Technology

Experiment 2 Effects of Filtering

Advanced Digital Signal Processing Part 5: Digital Filters

Digital Processing of

DECIMATION FILTER FOR MULTISTANDARD WIRELESS RECEIVER SHEETAL S.SHENDE

EEO 401 Digital Signal Processing Prof. Mark Fowler

A PACKAGE FOR FILTER DESIGN BASED ON MATLAB

Design IIR Filters Using Cascaded Biquads

Lab 4: Static & Switched Audio Equalizer

Lab 4 An FPGA Based Digital System Design ReadMeFirst

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

George Mason University Signals and Systems I Spring 2016

4. Design of Discrete-Time Filters

Digital Filtering: Realization

CHAPTER 2 FIR ARCHITECTURE FOR THE FILTER BANK OF SPEECH PROCESSOR

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Project 1. Notch filter Fig. 1: (Left) voice signal segment. (Right) segment corrupted by 700-Hz sinusoidal buzz.

ijdsp Workshop: Exercise 2012 DSP Exercise Objectives

SCUBA-2. Low Pass Filtering

Application Note 7. Digital Audio FIR Crossover. Highlights Importing Transducer Response Data FIR Window Functions FIR Approximation Methods

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

E Final Exam Solutions page 1/ gain / db Imaginary Part

Active Filter Design Techniques

Analog and Telecommunication Electronics

Design IIR Filter using MATLAB

ASC-50. OPERATION MANUAL September 2001

16.30 Learning Objectives and Practice Problems - - Lectures 16 through 20

Design and Implementation of Efficient FIR Filter Structures using Xilinx System Generator

Analog and Telecommunication Electronics

ECE503: Digital Filter Design Lecture 9

Decoding a Signal in Noise

Design and comparison of butterworth and chebyshev type-1 low pass filter using Matlab

2) How fast can we implement these in a system

EECE 301 Signals & Systems Prof. Mark Fowler

Designing Filters Using the NI LabVIEW Digital Filter Design Toolkit

Digital Signal Processing

Electrical and Telecommunication Engineering Technology NEW YORK CITY COLLEGE OF TECHNOLOGY THE CITY UNIVERSITY OF NEW YORK

AUDIO SIEVING USING SIGNAL FILTERS

Narrow-Band Low-Pass Digital Differentiator Design. Ivan Selesnick Polytechnic University Brooklyn, New York

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

UNIVERSITY OF SWAZILAND

Signals and Systems Lecture 6: Fourier Applications

CS3291: Digital Signal Processing

Digital Filter Design using MATLAB

Digital Signal Processing ETI

DFT: Discrete Fourier Transform & Linear Signal Processing

Transcription:

Massachusetts Institute of Technology Department of Electrical Engineering & Computer Science 6.341: Discrete-Time Signal Processing Fall 2005 Project Assignment Issued: Sept. 27, 2005 Project I due: Nov. 1, 2005 Project II due: Dec. 6, 2005 This handout contains all parts of both projects (Project I and Project II) to be assigned in 6.341 this semester. The writeup for Project I is due on November 1, 2005. The writeup for Project II is due on December 6, 2005. Both projects are required to be done, turned in by all students independent of which homework option you chose, and will be counted in the final grade. You are required to turn in written reports for both Projects I and II. Project I will have two separate writeups, one for Part A and one for Part B. Project II will have one writeup. Each writeup should have a summary of how you went about it (anywhere from one to five pages, not to exceed five pages). In addition to the five page maximum, you can include any appropriate Matlab plots. Do NOT turn in any Matlab code. The total number of pages including description and plots for Project I Part A should not exceed five pages and for Project I part B should not exceed 10 pages. The total maximum number of pages for Project II is 10 pages. No formal solutions to the project will be handed out. We may select one or two of the reports handed in and (with the permission of the student) will distribute those to the entire class. Each writeup (two for Project I, one for Project II) will receive a grade which reflects our assessment of your level of understanding of the various issues involved and the effort that you put into it. For the actual grading, we will be using the EGRMU grading scheme which is an acronym for E(xtraordinary), G(ood), R(easonable, kind of), M(arginal), U(nsatisfactory). We are likely to use some mixed grades like E/G etc. In generating a numerical grade at the end of the semester, we will use the following scale: E=100, E/G=90, G=80, G/R=70, R=60, R/M=50, M=30, M/U=15, U=0. COMPLETION OF THE PROJECTS AND WRITEUPS IS A REQUIREMENT TO PASS THE COURSE. 1

Note: Matlab help sessions will be held by the TAs to help you get started on the project. This means that the TAs will be available in a cluster and will be open to questions. These help sessions are intended for Matlab- and project-related questions and are not to be used as general office hours. Also note that, to encourage you to start early on the project, the last problem in problem set 5 asks about your progress on the project. Playing Sound in Matlab Throughout these projects it will be necessary to play audio files which you will have manipulated in Matlab. While the function sound works well for doing this on Mac (OS X) and PC platforms, using sound on Athena machines is problematic and should be avoided. The staff has instead written several functions which should be used to play sound in Matlab on Athena Sun (UNIX) machines in lieu of sound. (Athena Linux-based machines are not supported within the context of this project.) These functions, usound441 and usound110, are available on the course website as.m files and will play back sequences at sampling rates of 44100 Hz and 11025 Hz, respectively. To install, simply put usound441.m and usound110.m in a directory which is in your Matlab path, or in your working directory. For information on how to use the functions type help usound441 or help usound110. Note that you may need to type add infoagents at your Athena prompt before starting Matlab for these functions to work properly. Overview One area in which discrete-time signal processing has enjoyed widespread use is in the field of speech processing. In this set of projects we consider various issues relating to applying digital filtering to speech. Specifically, in the first part of Project I, we consider the effect of all-pass filtering on speech. Your current background in 6.341 should be sufficient to allow you to begin on this part immediately. In the second part of Project I we consider IIR and FIR filter design in the context of enhancing speech corrupted by additive noise. While this relies somewhat on material in Lectures 7-8, some aspects can be started earlier. In Project II we continue the second part of Project I, with a constraint imposed on the allowable multiplier rate (number of multiplies per input sample) and the effect of this on different filter designs. Although Project II isn t due until December 6, it does not rely on lectures beyond L10 and we concourage you to start on it as soon as possible. Historically, DSP courses have put considerable emphasis on design techniques for both IIR and FIR filters, as discussed in Chapter 7 of the course text. A variety of filter design algorithms are now implemented in common software packages such as Matlab. This makes it unnecessary for most practitioners to learn the details of the design algorithms; however, ceding the design function to a software package makes it more important to understand the properties of different types of 2

optimal filters, the meanings of the design parameters, and some of the trade-offs between filter classes. In the context of what we are covering this semester on IIR filter design, we suggest that you read Section 7.0 including Example 7.1. Also, read the examples in Section 7.1.3, but focus on what Butterworth and Chebyshev filters are rather than on the details of the bilinear transformation. For the discussion of FIR filter design, the suggested reading is Sections 7.2, 7.3, and 7.4 through 7.4.1. We will not be going into the details of the issues raised in Section 7.4.1, but we would recommend at least reading that section to get a sense of what some of those issues are. Project I: (Due November 1, 2005) Project I. A. A common folk theorem states that the ear is insensitive to phase, i.e. that for audio, phase distortion is inaudible. If that is correct, then processing audio with an all-pass filter should not result in perceived distortion. This part of the project tests this conjecture. The all-pass filter that we consider is of the form H(z) = [ 3 k=1 ] N [ (z 1 e ] k )(z 1 e k ) 6k=0 b k z k N (1 e k z 1 )(1 e = k z 1 ) 6k=0. a k z k For this part of the project, the file projia.mat will need to be first loaded into Matlab. After downloading this file from the course website, copy it into your Matlab working directory and type load projia. The b k and a k coefficients above are stored in the variables b and a respectively; b(k + 1)= b k and a(k + 1)= a k. (a) Implement the all-pass filter for N = 1 and show plots of the impulse response (the first 100 samples), the magnitude of the frequency response, and the group delay. (b) Plot the pole-zero diagram. You may find the function roots helpful in doing so. (b) Process the speech file, stored as the variable speech (sampled at rate fs = 11025 Hz), using the command filter to run the filter implemented in (a). Listen to the result and comment specifically on whether there is audible distortion. (c) Implement the filter for N = 50 and again show plots of the impulse response (the first 5000 samples), the magnitude of the frequency response, and the group delay. (d) Repeat (b). In your writeup, comment specifically on how you would subjectively describe the distortion and on what aspect of the filter is it s primary cause. 3

Project I. B. For this part of the project, the file projib.mat will need to be first loaded into Matlab. After downloading this file from the course website, copy it into your Matlab working directory and type load projib. In this part of the project, it may be helpful to use Matlab s order estimation functions (e.g. buttord, cheb1ord,...). A caveat in the use of these functions is that Matlab s definition of ripple differs between the IIR and FIR filter design functions. The following can be used to sort through these differences in convention: 1. In the design of IIR filters, Matlab takes specifications for ripple magnitude and stopband attenuation as input parameters. A specification of ripple magnitude δ IIR yields an IIR filter design with a maximum passband gain of unity (or 0 db) and a minimum passband gain of 10 δ IIR/20 (or δ IIR db). A specification of stopband attenuation ξ IIR yields an IIR filter design with a maximum stopband gain of 10 ξ IIR/20 (or ξ IIR db). 2. In the design of FIR filters, Matlab also takes a specification of ripple magnitude as an input parameter. A specification of ripple magnitude δ FIR yields a FIR filter design with a maximum passband gain of (1 + δ FIR ) (or 20log 10 (1 + δ FIR ) db), and a minimum passband gain of (1 δ FIR ) (or 20log 10 (1 δ FIR ) db). A specification of stopband gain ξ FIR yields an FIR filter design with a maximum stopband gain of ξ FIR (or 20log 10 (ξ FIR ) db). Clearly, to compare FIR and IIR filters designed with Matlab, we must find a correspondence between our desired specifications and the input parameters to the filter design functions. Let us thus define G pbmax (db), G pbmin (db), and G sbmax (db) to refer to the desired maximum passband gain, minimum passband gain, and maximum stopband gain, respectively. In order to have free control over each of these parameters, we also introuce k FIR and k IIR, linear scaling terms which are used to normalize our FIR and IIR designs. Before beginning Project I.B. do (a) and (b) below and include your solutions as part of the project writeup. (a) Find δ FIR, ξ FIR, and k FIR in terms of G pbmax, G pbmin, and G sbmax. These parameters will be used for FIR designs. (b) Find δ IIR, ξ IIR, and k IIR in terms of G pbmax, G pbmin, and G sbmax. These parameters will be used for IIR designs. Project I.B. is concerned with designing a low-pass filter for the removal of high-pass noise from a speech signal. The noisy signal is stored in the variable noisy and was sampled at 44100 (fs) Hz. It consists of a summation of a speech signal which was band-limited at 4 khz using a low-pass filter with a very narrow transition band, and a noise signal which was filtered at 4 khz using a high-pass filter with a very narrow transition band. To filter the noise we must design a discrete-time filter with the following parameters: 1. Passband edge: 2500 Hz. 2. Stopband edge: 4000 Hz. 4

3. Maximum gain in the passband G pbmax : 40 db. 4. Minimum gain in the passband G pbmin : 37 db. 5. Maximum gain in the stopband G sbmax : 55 db. Because it may take a few iterations to get each filter right, we suggest you write a.m Matlab script for each filter. Note that in this part of the project, you may end up with very high order filters since the specifications are rather severe. You can try to implement the IIR filters according to the specs using Matlab s built in tools (such as the fdatool or the command line tools butter, cheby1, cheby2, and ellip type help signal for more information). If you do so, you will notice that the resulting systems might not be stable. There are several reasons for this, the most important of which being coefficient quantization even with floating point precision. This issue arises because the specifications are very tight and some of the filter types have all of their poles concentrated near z = 1. Fortunately, there is a workaround. What you need to do is to group the poles and zeros for the desired filter in pairs (conjugate or not) to create smaller stable second order filters of the form N(z)/D(z) where N(z) and D(z) are at most second order polynomials in z. A cascade of such filters will produce the desired system, and Matlab will be able to analyze it. The drawback is that you will have to implement your own methods to generate the plots and simulate the system. Design a DT filter of each of the following types based on the specifications given above: Butterworth, Chebyshev Type I, Chebyshev Type II, Elliptic, Parks-McClellan, Kaiser. For each of the designs, provide the following in your Part I project write-up: (a) The order of the filter. (b) The number of multiplication operations per input sample required to implement the filter. Be sure to explain the structure you assume. (c) Plot the magnitude response (in db) from ω = 0 to ω = π using freqz. Plot a detail of the magnitude response, focusing on the passband ripple (linear scale). Plot the group delay (in samples) using grpdelay. (Use subplot to fit the three plots on the same page for each filter.) (d) Plot the pole-zero diagram. (e) Plot the impulse response using filter and stem for 100 samples. (Use subplot to fit the pole-zero diagram and the impulse response on the same page.) Filter noisy using your de-noising filter. Listen to the filtered and original files. How do they compare? 5

Project II: (Due December 6, 2005) In this project, you will design filters for a hardware implementation of the de-noising system in Project I B. Since the de-noising filter does a good job of keeping the resulting signal band-limited to 4 khz, it is prudent to add a compressor-by-4 (which for no aliasing requires its input to be band-limited to 5512.5 Hz) as a final stage in the implementation of our system. The sampling rate at the output of the system is thus 11025 Hz, and the sampling rate at the system s input is still 44100 Hz. The overall de-noising system, which operates on a noisy signal x to yield a cleaned signal ˆx, is depicted in its nominal form below. x H 4 ˆx The hardware on which we would like to implement the de-noiser is indeed very limited; a maximum of 17 multiplications can be performed per input sample. (The 18th multiplier is used elsewhere to implement a digital volume control.) In an attempt to lessen the constraints on our design problem, we are told that we must adhere to all of the parameters outlined in Part I.B. except passband edge, which should be kept as close to the stopband edge as possible, while still meeting the multiplication constraint. Our new design criteria become: 1. Maximum number of multiplications per input sample: 17 2. Passband edge: as close to 4000 Hz as possible. 3. Stopband edge: 4000 Hz. 4. Maximum gain in the passband G pbmax : 40 db. 5. Minimum gain in the passband G pbmin : 37 db. 6. Maximum gain in the stopband G sbmax : 55 db. Again design a DT filter of each of the following types based upon these new specifications: Butterworth, Chebyshev Type I, Chebyshev Type II, Elliptic, Parks-McClellan, Kaiser. Note that for this section, writing a.m script will almost certainly prove useful. For each of the designs, provide the following in your Project II project write-up: (a) The order of the filter. (b) The passband edge parameter chosen. (b) The number of required multiplications per input sample, both with and without the use of polyphase. Were there filter implementations which did not meet the required specification for any arbitrarily low choice of passband edge? (c) Plot the magnitude response (in db) from ω = 0 to ω = π using freqz. 6

Now implement your de-noising system using each filter you designed. For designs where a polyphase implementation is assumed for purposes of multiplication counting, feel free to do the actual filtering in Matlab on the high-rate side of the compressor, remembering that a polyphase implementation implies only a specific filter form and will therefore not change the overall behavior of the system. To implement a compressor-by-4 on a sequence x in Matlab, use x = x(1:4:length(x));. On the course website you will find a list of unique.wav files which contain speech utterances in the presence of noise. Download the file corresponding to your Athena username and run it through the de-noising system you implemented, using each filter you designed. (You can read.wav files into Matlab using wavread.) In your writeup, specifically comment on the following: How does the quality compare for each filter design? What aspects of each filter do you think contribute to this? What does your utterance say? Feel free to experiment with other users utterances as well. 7