ELEC3104: Digital Signal Processing Session 1, 2013

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

APPENDIX A to VOLUME A1 TIMS FILTER RESPONSES

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

EEO 401 Digital Signal Processing Prof. Mark Fowler

ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet

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

Filters. Phani Chavali

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

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

Design of FIR Filters

Electrical & Computer Engineering Technology

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

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

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

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

Discretization of Continuous Controllers

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

4. Design of Discrete-Time Filters

Digital Processing of Continuous-Time Signals

F I R Filter (Finite Impulse Response)

Digital Processing of

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

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

ijdsp Workshop: Exercise 2012 DSP Exercise Objectives

UNIT-II MYcsvtu Notes agk

Brief Introduction to Signals & Systems. Phani Chavali

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

Analog Lowpass Filter Specifications

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

Window Method. designates the window function. Commonly used window functions in FIR filters. are: 1. Rectangular Window:

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

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

EECE 301 Signals & Systems Prof. Mark Fowler

Experiment 4- Finite Impulse Response Filters

Experiment 2 Effects of Filtering

Digital Filters FIR and IIR Systems

Project I: Phase Tracking and Baud Timing Correction Systems

Plot frequency response around the unit circle above the Z-plane.

Multirate Digital Signal Processing

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

EEO 401 Digital Signal Processing Prof. Mark Fowler

Copyright S. K. Mitra

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

Lab 4 An FPGA Based Digital System Design ReadMeFirst

ELEC3104: Digital Signal Processing Session 1, 2013

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

EEM478-DSPHARDWARE. WEEK12:FIR & IIR Filter Design

EE 470 Signals and Systems

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

Florida International University

Digital Filters IIR (& Their Corresponding Analog Filters) 4 April 2017 ELEC 3004: Systems 1. Week Date Lecture Title

Digital Filter Design using MATLAB

ECE503: Digital Filter Design Lecture 9

GEORGIA INSTITUTE OF TECHNOLOGY SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2025 Fall 1999 Lab #7: Frequency Response & Bandpass Filters

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

ECE 5650/4650 MATLAB Project 1

8: IIR Filter Transformations

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

Optimal FIR filters Analysis using Matlab

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


Signal processing preliminaries

Aparna Tiwari, Vandana Thakre, Karuna Markam Deptt. Of ECE,M.I.T.S. Gwalior, M.P, India

ECE 4213/5213 Homework 10

Multirate DSP, part 1: Upsampling and downsampling

DSP Filter Design for Flexible Alternating Current Transmission Systems

ASN Filter Designer Professional/Lite Getting Started Guide

Linear Time-Invariant Systems

The University of Queensland School of Information Technology and Electrical Engineering. ELEC3004/7312: Signals, Systems and Controls

UNIVERSITY OF SWAZILAND

A PACKAGE FOR FILTER DESIGN BASED ON MATLAB

LECTURER NOTE SMJE3163 DSP

EELE 4310: Digital Signal Processing (DSP)

Digital Filter Design

Filter Banks I. Prof. Dr. Gerald Schuller. Fraunhofer IDMT & Ilmenau University of Technology Ilmenau, Germany. Fraunhofer IDMT

ECE 5655/4655 Laboratory Problems

1. Find the magnitude and phase response of an FIR filter represented by the difference equation y(n)= 0.5 x(n) x(n-1)

Design of IIR Digital Filters with Flat Passband and Equiripple Stopband Responses

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

George Mason University ECE 201: Introduction to Signal Analysis

Final Exam Solutions June 14, 2006

DESIGN OF FIR AND IIR FILTERS

Lab 0: Introduction to TIMS AND MATLAB

APPLIED SIGNAL PROCESSING

DIGITAL FILTERING AND THE DFT

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

Part B. Simple Digital Filters. 1. Simple FIR Digital Filters

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

EECS 452 Midterm Exam Winter 2012

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

THE NEXT GENERATION AIRBORNE DATA ACQUISITION SYSTEMS. PART 1 - ANTI-ALIASING FILTERS: CHOICES AND SOME LESSONS LEARNED

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

Simulation Based Design Analysis of an Adjustable Window Function

FINITE IMPULSE RESPONSE (FIR) FILTERS

ECE503 Homework Assignment Number 8 Solution

VCC. Digital 16 Frequency Divider Digital-to-Analog Converter Butterworth Active Filter Sample-and-Hold Amplifier (part 2) Last Update: 03/19/14

Keywords FIR lowpass filter, transition bandwidth, sampling frequency, window length, filter order, and stopband attenuation.

SCUBA-2. Low Pass Filtering

Digital Filtering: Realization

Transcription:

ELEC3104: Digital Signal Processing Session 1, 2013 The University of New South Wales School of Electrical Engineering and Telecommunications LABORATORY 4: DIGITAL FILTERS INTRODUCTION In this laboratory, you will design and evaluate a number of digital filters using the signal processing functions in MATLAB. This will allow you to directly compare the analogue elliptic filter available on the TIMS panel with a digital implementation and to investigate the comparative advantages of digital IIR and FIR filters. To conclude our laboratory module on digital filter designs, we will consider how to compute, using primitive functions, the output from a filter with a given input sequence and a given filter impulse response. Before attending this laboratory, you should understand the following concepts: Differences between FIR and IIR Filters. Linear phase filters and their importance. Convolution. LABORATORY PREPARATION The frequency response of the TIMS Tuneable Lowpass (Elliptic) Filter is shown in Figure 2. The cutoff frequency (-3dB frequency) was set to 4kHz for this measurement. An equivalent digital filter will be designed. The first step is to assign values to the filter specification shown in Figure 1. 0dB Figure 1 Ap As f1 f2 fs/2 Find values of A p, A s, f 1, and f 2 from the analog filter frequency response shown on Figure 2. You will not be able to read the passband ripple level, but assume it is 0.5dB. Draw a diagram in your laboratory book of the frequency response specification. ELEC 3104 Session 1, 2013 Page 1 of 6

Figure 2: The frequency response of the TIMS Tuneable Lowpass (Elliptic) Filter LABORATORY WORK Section I Digital (Elliptic) Lowpass Filter The elliptic filter order N and natural frequency wn are calculated from the specification found in laboratory preparation question 4 by the MATLAB function ellipord(): [N,wn] = ellipord(f1/(fs/2),f2/(fs/2),ap,as); where fs is the sampling frequency, which equals 22050Hz. Question 1: What is the order and natural frequency of the digital elliptic filter? Check the order is the same as that specified for the TIMS Tuneable Lowpass Filter. Should A p and A s be entered as positive or negative numbers? The next stage in the design process is to calculate the coefficients B and A for the digital filter. This calculation is performed by the MATLAB function ellip(): ELEC 3104 Session 1, 2013 Page 2 of 6

[B,A] = ellip(n,ap,as,wn); where the arguments are defined as above. Question 2: What are the coefficients B and A for the digital elliptic filter? Once B and A are known, the design is complete. To confirm that the filter achieves the specification, obtain the frequency response using [h,w]=freqz() and plot the amplitude and phase responses using the statements: plot(11025*w/pi,abs(h)),grid % Amplitude (linear scale) plot(11025*w/pi,20*log10(abs(h))),grid % Amplitude (db scale) plot(11025*w/pi,unwrap(angle(h))),grid % Phase (unwrap scale) Compare the digital filter responses with the analog filter responses shown in Figure 2 and with the specifications. Question 3: Explain any differences in the amplitude and phase plots. What is the purpose of the MATLAB function unwrap()? Section I Checkpoint Marks: 2 out of 10 Section II (a) Impulse Response of Elliptic Filter Set the TIMS Tuneable Lowpass Filter bandwidth to 4kHz and its (passband) gain to 2 (refer to Lab 1). Using the VCO module and the Twin Pulse Generator module, generate a rectangular pulse of width between 20µs and 50µs at a repetition frequency of below 250Hz. This can be achieved by connecting the output of Variable DC to the input of VCO. Refer to the VCO manual for more details. Note that: you may not be able to achieve this pulse width range and repetition frequency exactly, but aim for narrow pulses at the lowest repetition rate. You are trying to generate an impulse. Variable DC Voltage Controlled Oscillator TTL Twin Pulse Generator Adder Tuneable Lowpass Filter Connect this signal to the lowpass filter input via an Adder module. Adjust the adder gain until the filter s input pulse is 2V amplitude. Record the response seen on the CRO in your notebook. Obtain a record of the lowpass filter response, sampled at 22050Hz. Keep this record for later comparison. The unit sample response of the Digital (Elliptic) Filter is computed as follows: delta = [1 zeros(1,99)]; %Unit sample signal (100 samples long) n = 1:length(delta); t = (n-1)/22050 y = filter(b,a,delta); stem(t,y) % Sample counter % Time scale (use 22050 sampling) % unit sample response % Plot of unit sample response Display and obtain a record of the unit sample response of the elliptic lowpass filter. ELEC 3104 Session 1, 2013 Page 3 of 6

Question 4: Compare the impulse response of the digital (elliptic) filter with the analogue impulse response of the TIMS tuneable filter. Explain any differences. (b) Linear Phase FIR Digital Lowpass Filter In the preceding section, a lowpass filter was designed with an IIR digital filter based on an elliptic prototype. This allowed direct comparisons to be made between the analogue and digital filters. In this section the same specification is achieved by an FIR digital filter designed using the Remez exchange algorithm. This algorithm is a very powerful tool and is in widespread use. Some properties of filters designed using this algorithm is: 1. Optimal equiripple FIR design. 2. Multiple passbands and stopbands can be specified. 3. The filters are of linear phase type. 4. Weights can be assigned to passband and stopband regions. This algorithm is implemented in MATLAB with the command remez. It requires the following inputs: 1. A vector F that defines the boundaries between passbands and stopbands. The frequencies must be in ascending order, starting with 0 and finishing with 1, where 1 corresponds to half the sampling rate. 2. A vector M that defines the levels of the passband and stopband regions. The elements of M must appear in equal valued pairs. 3. The filter order N. For example, the coefficients B of an order N = 10 FIR lowpass filter having a passband equal to 1 and extending to 4000 Hz and a stopband equal to 0 between 4400Hz and the Nyquist frequency 11025 Hz is designed using remez() as follows: F = [0 4000/11025 4400/11025 1]; % Pass- and stop-band frequencies M = [1 1 0 0]; N = 10; B = remez(n,f,m); A = 1; [h,w] = freqz(b,a,200); plot(11025*w/pi,20*log10(abs(h))); % Pass- and stop-band levels % Filter order % Calculate the FIR coefficients % Specify 1 for A coefficients % Calculate frequency response % Display amplitude response The specification used here is the same as that for the elliptic filter designed in the earlier section, but the order N = 10 is not large enough to achieve the specification (there is insufficient stopband attenuation). Calculate the coefficients B using remez() for a range of filter orders. Hints: try N>100. Question 5: What is the lowest order filter that achieves the required specification? Obtain the unit sample response of the filter and record the result. Question 6: Does this FIR filter require more or less computation and storage than the IIR filter designed previously? Section II Checkpoint Marks: 3 out of 10 ELEC 3104 Session 1, 2013 Page 4 of 6

Section III Convolution and Filter Response Consider the following filter: Hz () = Question 7: 8 7 6 5 4 3 2 1 z 0.9z 1.375z 0.975z + 4.8125z 0.975z 1.375z 0.9z + 1 8 z Where are the zeros of this system on the z-plane? Plot a pole-zero diagram for this filter. Confirm that the zeros are reciprocal of each other. Question 8: Question 9: Question 10: Question 11: Question 12: From the last laboratory, what special property does this filter have with the zeros being reciprocal of each other? Where are the poles of this system on the z-plane? By taking the inverse Z-Transform, or by deriving from the definition of the Z-Transform, determine its impulse response, h[n]. Is this an FIR or an IIR filter? Explain. A sequence, x[n], is being applied to this filter (with an impulse filter h[n]), its output sequence, y[n], can be determined as follow: x[n] Filter with impulse response h[n] y[n] = x[n]*h[n] * denotes convolution yn [ ] = xn [ ]* hn [ ] = xnhk [ ] [ n] wher e x[ n ] = { 1, 3, 5, 7, 9, 11, 9, 7, 5, 3, 1}, n = 0, 1,...10 Determine y[n] by writing a simple MATLAB program to perform the required convolution. n Section III Checkpoint Marks: 2 out of 10 Bonus 1 mark: Write MATLAB code to perform convolution without using built-in function conv(). ELEC 3104 Session 1, 2013 Page 5 of 6

Section IV Design a 4 th order bandpass filter The design of a bandpass filter can be carried out using MATLAB. For example, for the design of an elliptic filter using MATLAB, one might use the sequence of commands Fs = ; % sampling rate N = ; % order is 2*N Rp = ; % passband ripple in db Rs = ; % stopband ripple in db Wn = [Flo/(Fs/2) Fhi/(Fs/2)]; % passband [Flo, Fhi] normalized for pi [B,A] = ellip(n, Rp, Rs, Wn) The (partial) specification for the required IlR bandpass filter is: Sampling Frequency: Lower Stopband: Passband: Higher Stopband: Passband ripple/attenuation: 8 khz 0-0.7 khz 1.1-2 khz 3.1-4 khz 3 db Firstly, note that it may not be possible to obtain this specification with a 4th order filter. You need to choose both stopband ripples as small as possible, subject to the constraint of a 4th order filter. (Remember that this is a bandpass filter.) Choose which IIR filter option (Butterworth, Chebychev I, Chebychev II, or Elliptic) you think is the most suitable and explain your reasoning (with plots of magnitude responds of all the above four options). Section IV Checkpoint Marks: 3 out of 10 MODULE OUTCOMES: At the end of the laboratory, students should have a thorough understanding of the following concepts: Main differences between FIR and IIR Filters. Convolution. ELEC 3104 Session 1, 2013 Page 6 of 6