Digital Filters Ying Sun

Similar documents
Signals and Systems. Problem Set: The z-transform and DT Fourier Transform

EEL3135: Homework #4

Responses of Digital Filters Chapter Intended Learning Outcomes:


Discrete Time Systems

2.161 Signal Processing: Continuous and Discrete Fall 2008

Digital Signal Processing Lecture 10 - Discrete Fourier Transform

QUESTION BANK SIGNALS AND SYSTEMS (4 th SEM ECE)

Chap 2. Discrete-Time Signals and Systems

Transform Analysis of Linear Time-Invariant Systems

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

Signals and Systems Profs. Byron Yu and Pulkit Grover Fall Midterm 2 Solutions

GATE EE Topic wise Questions SIGNALS & SYSTEMS

University Question Paper Solution

UNIT 1. SIGNALS AND SYSTEM

Lecture 19 IIR Filters

Discrete-Time Signals and Systems. The z-transform and Its Application. The Direct z-transform. Region of Convergence. Reference: Sections

Review of Discrete-Time System

Digital Signal Processing Lecture 5

EECE 301 Signals & Systems Prof. Mark Fowler

ELEG 305: Digital Signal Processing

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

Analog vs. discrete signals

LECTURE NOTES DIGITAL SIGNAL PROCESSING III B.TECH II SEMESTER (JNTUK R 13)

EC Signals and Systems

Your solutions for time-domain waveforms should all be expressed as real-valued functions.

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2010

Linear Convolution Using FFT

Discrete Time Signals and Systems Time-frequency Analysis. Gloria Menegaz

Discrete Time Fourier Transform

Digital Signal Processing Lecture 3 - Discrete-Time Systems

The Johns Hopkins University Department of Electrical and Computer Engineering Introduction to Linear Systems Fall 2002.

EE482: Digital Signal Processing Applications

Stability Condition in Terms of the Pole Locations

Digital Signal Processing. Midterm 1 Solution

APPLIED SIGNAL PROCESSING

2. Typical Discrete-Time Systems All-Pass Systems (5.5) 2.2. Minimum-Phase Systems (5.6) 2.3. Generalized Linear-Phase Systems (5.

# FIR. [ ] = b k. # [ ]x[ n " k] [ ] = h k. x[ n] = Ae j" e j# ˆ n Complex exponential input. [ ]Ae j" e j ˆ. ˆ )Ae j# e j ˆ. y n. y n.

Lecture 2 OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE

ECE503: Digital Signal Processing Lecture 5

Question Bank. UNIT 1 Part-A

Chapter 5 Frequency Domain Analysis of Systems

Ch. 7: Z-transform Reading

Cosc 3451 Signals and Systems. What is a system? Systems Terminology and Properties of Systems

Discrete-Time Signals & Systems

PS403 - Digital Signal processing

ELEG 305: Digital Signal Processing

( ) John A. Quinn Lecture. ESE 531: Digital Signal Processing. Lecture Outline. Frequency Response of LTI System. Example: Zero on Real Axis

Like bilateral Laplace transforms, ROC must be used to determine a unique inverse z-transform.

E : Lecture 1 Introduction

Z Transform (Part - II)

Signals & Systems Handout #4

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science. Fall Solutions for Problem Set 2

Discrete Time Systems

Problem Value

Theory and Problems of Signals and Systems

Discrete-Time Fourier Transform (DTFT)

ECGR4124 Digital Signal Processing Exam 2 Spring 2017

UNIT - III PART A. 2. Mention any two techniques for digitizing the transfer function of an analog filter?

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF INFORMATION TECHNOLOGY. Academic Year

The Z transform (2) 1

Review of Fundamentals of Digital Signal Processing

Multimedia Signals and Systems - Audio and Video. Signal, Image, Video Processing Review-Introduction, MP3 and MPEG2

信號與系統 Signals and Systems

Review of Fundamentals of Digital Signal Processing

Today. ESE 531: Digital Signal Processing. IIR Filter Design. Impulse Invariance. Impulse Invariance. Impulse Invariance. ω < π.

University of Waterloo Department of Electrical and Computer Engineering ECE 413 Digital Signal Processing. Spring Home Assignment 2 Solutions

CITY UNIVERSITY LONDON. MSc in Information Engineering DIGITAL SIGNAL PROCESSING EPM746

The Discrete-Time Fourier

Z-Transform. x (n) Sampler

Let H(z) = P(z)/Q(z) be the system function of a rational form. Let us represent both P(z) and Q(z) as polynomials of z (not z -1 )

Lecture 04: Discrete Frequency Domain Analysis (z-transform)

Implementation of Discrete-Time Systems

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

Z-TRANSFORMS. Solution: Using the definition (5.1.2), we find: for case (b). y(n)= h(n) x(n) Y(z)= H(z)X(z) (convolution) (5.1.

Discrete-Time David Johns and Ken Martin University of Toronto

Digital Signal Processing

Examples. 2-input, 1-output discrete-time systems: 1-input, 1-output discrete-time systems:

Discrete-time signals and systems

University of Illinois at Urbana-Champaign ECE 310: Digital Signal Processing

NAME: 11 December 2013 Digital Signal Processing I Final Exam Fall Cover Sheet

ECE-314 Fall 2012 Review Questions for Midterm Examination II

Problem Value

LTI Systems (Continuous & Discrete) - Basics

III. Time Domain Analysis of systems

EE 521: Instrumentation and Measurements

Digital Signal Processing Lecture 4

Lecture 7 Discrete Systems

Discrete-time Fourier transform (DTFT) representation of DT aperiodic signals Section The (DT) Fourier transform (or spectrum) of x[n] is

Exercises in Digital Signal Processing

Digital Signal Processing Lecture 9 - Design of Digital Filters - FIR

Discrete-time Signals and Systems in

ECE 350 Signals and Systems Spring 2011 Final Exam - Solutions. Three 8 ½ x 11 sheets of notes, and a calculator are allowed during the exam.

Solutions: Homework Set # 5

New Mexico State University Klipsch School of Electrical Engineering EE312 - Signals and Systems I Fall 2015 Final Exam

信號與系統 Signals and Systems

Grades will be determined by the correctness of your answers (explanations are not required).

Digital Signal Processing Lecture 8 - Filter Design - IIR

Solutions. Number of Problems: 10

summable Necessary and sufficient for BIBO stability of an LTI system. Also see poles.

Transcription:

Digital Filters Ying Sun Digital filters Finite impulse response (FIR filter: h[n] has a finite numbers of terms. Infinite impulse response (IIR filter: h[n] has infinite numbers of terms. Causal filter: h[n]=0, for all n < 0. Noncausal filter: h[n] 0, for at least one n < 0. Stability h [n]< stable n= FIR filters are always stable. IIR filters may or may not be stable. Evaluating filter output by convolution y[n]= m= x [n m]h[m] = x[m]h [n m] m= Example. The impulse response of a filter is h[n]=e n u [n]. The input is a square pulse: x [n]= {, n=0,,,3. Determine y[n]. 0, otherwise y[n] = x[m]h [m n] = m= { 0, n<0 n e (n m, 0 n 3 = m=0 3 e (n m, n>3 m=0 {0, n<0, n=0 +e, n> +e +e, n= +e +e +e 3, n=3 e n +e (n +e (n +e (n 3, n>3 This is a low-pass filter. For the square pulse input, the output is a charge-discharge curve that shows reduction of the high-frequency contents.

Example. We implement a 3-point FIR low-pass filter to smooth the data according to: y[n]= ( x[n]+ x[n ]+x[n ] If the sampling rate is 00 Hz, what is the cutoff frequency (3 db roll-off of this filter? The impulse response as shown in figure is obtained by setting x [n]=δ[n]. h[n]= (δ[n]+ δ[n ]+δ[n ] Take z-transform (ZT of the filter equation above: Y [ z ]= [ X ( z+ z X ( z+ z X ( z]. The transfer function is given by H [ z] = Y ( z X ( z = [+ z +z ] = z ( z++z = z z+z (+ The Fourier transform (FT is the ZT evaluated on the unit circuit of the z-plane. By replacing z=e j ω, we have H (e j ω = e (+ e j ω +e Using the Euler's formula cosω= e j ω +e, we have H (e j ω = e (+cosω. The magnitude and phase of H (e j ω are: H (e j ω = (+cos ω H (e j ω = ω The system has a linear phase response, which represents a group phase delay. The linear phase is desirable because it does not introduce any phase distortion. The DC gain of the filter is ; H (e j0 =(+cos 0/=. The cutoff frequency f c is where the gain drops to / of the DC gain. / = 0.7079... ; 0 log 0 0.7079 = 3 db. Let H (e j ω c = (+cos ω = c, we have cosω c = =. = 0. ω c = cos 0. =. radians/s = 65.5 o /s.

The sampling rate is 00 Hz, which corresponds to π or 360 o. The cutoff frequency is: f c = 00 65.5 o /360 o = 36 Hz. Pole-zero plot: H [ z] = z + z+ = ( z+. There are two z z zeros at - and two poles at the origin on the z-plane. The red line shows the vector from e j ω to the pole. The green line shows the vector from e j ω to the pole. The magnitude of H (e j ω is proportional to the green line squared over the red line squared, as ω goes from 0 to π. Digital filters implemented with a microprocessor Digital filters can be implemented in real time by using a microprocessor system as shown. In order to sample the data with a precise sampling interval, a timer is used to generate periodical interrupts. The interrupts are processed by the microprocessor unit (MPU. A running buffer is set up in the memory to store the present and previous input sample points. The filter should be implemented in the interrupt service routine with the following pseudocode: x = x; x = x0; x0 = read from A/D; y0 = (x0 + x + x + x / ; write y0 to D/A; Example 3. In the continuous time, the derivative is defined as d x(t x(t x(t Δ t = lim. In the dt Δ t 0 Δ t discrete time, it is not possible to make Δ t 0. The smallest Δ t is the sampling period T. Thus, the backward difference is a discrete-time approximation of the derivative. Without losing generality, we let T = and add a scale factor of /. y[n]= x[n] x[n ] Plot H (e j ω c and show the pole-zero plot. The impulse response is: h[n]= δ[n] δ[n ] 3

The transfer function is obtained by taking the ZT of h[n]. H [ z] = z = z ( z 0 = z ( z z The first-order system has one zero at and one pole at the origin, as shown. To obtain the FT, let z=e j ω. We have j ω j ω H (e j ω = e ( e e = j e ( e e Using the Euler's formula sin ω= e j ω e, we have j H (e j ω = j e (sin ω j π = e e (sin ω j (ω π = e (sin ω. The magnitude and phase of H (e j ω are: H (e j ω = sin ω H (e j ω = ω π Notice that for the continuous time, the LT of the derivative is s and the magnitude of the FT is H (ω = ω, as shown by the orange line. ω and sin(ω/ are close for low frequencies,, but deviate more for higher frequencies. j Example. A low-pass filter can be implemented by averaging the present input with the previous output. The result is an IIR filter. Show the filter equation, impulse response, transfer function, pole-zero plot, an magnitude of the FT. If the sampling rate is 00 Hz, what is the 3-dB cutoff frequency. The filter equation is y[n]= x[n]+ y [n ]. This equation is a recursion and can be expanded as follows: y[n] = ( x[n]+ y [n ] = ( x[n]+ ( x[n ]+ y [n ] = ( x[n]+ ( x[n ]+ y[n ] =. x[n]+ x[n ]+ ( x[n ]+ y [n 3] The impulse response has infinite number of terms: h[n] = δ[n]+ δ[n ]+ 8 δ[n ]+...

Take ZT of the filter equation: Y ( z= X ( z+z Y (z. We have H ( z = Y ( z X ( z = z 0 = z ( z. The first-oder system has ones zero at the origin and one pole at /, as shown. The FT is obtained by replacing z=e j ω : H (e j ω = ( cosω+ j sin ω. The magnitude of the FT is: H (e j ω = ( cosω +sin ω. To find the 3-dB cutoff frequency, let ( cos ω +sin ω =. cos ω+cos ω+sin ω = 3 cos ω= 0 ω c = cos 3. o /s. = 0.77 radians/s = For a sampling rate of 00 Hz, this corresponds to f c =3 Hz. Compared to the nd-order FIR low-pass filter that has a cutoff frequency of 36 Hz, this filter has a lower cutoff frequency and a fast roll-off. However, unlike the FIR filters that have linear phase, this FIR filter has a nonlinear phase and may introduce phase distortion. Example 5. The above filter has a gain on /3 at the Nyquist frequency, which is half the sampling rate or at ω=π. Redesign the filter such that the gain is 0 at ω=π. The filter design can be done with the pole-zero plot. If the zero from the previous example is moved to -, the gain should be brought down to 0 at ω=π without any significant changes on other properties of the filter. The new pole-zero plot is shown on the right. The transfer function is H ( z = Y ( z X ( z = ( z+ z = z+ z = + z ( z 5

Y ( z( z = X (z (+z Y ( z = ( X ( z+z X ( z+ z Y ( z. The filter equation in the time domain is: y[n] = ( x[n]+x[n ]+ y [n ]. The FT is: H (e j ω = ( +e e. The magnitude (as shown is: H (e j ω = (+cosω +sin ω ( cos ω +sin ω. To find the 3-dB cutoff frequency, let (+cosω +sin ω ( cosω +sin ω = (+cos ω +sin ω = (( cos ω +sin ω +cos ω+cos ω+sin ω = 8 8cos ω+cos ω+ sin ω 0cosω = 8 ω c = cos 5 = 0.635 radians/s = 36.9o /s. For a sampling rate of 00 Hz, this corresponds to f c =0.5 Hz. Example 6. A 60-Hz notch filter is commonly used for removing the 60-Hz line noise from the signal. Design a FIR 60-Hz notch filter. The filter design can be done with the help of the pole-zero plot. If the sampling rate is set at 0 Hz, π corresponds to 0 Hz and π/ corresponds to 60 Hz. Thus, a zero placed at π/ will sink the 60 Hz noise. Another zero needs to be placed at -π/ in order to ensure that the coefficients of the filter equation are real number. Thus, we have a second-order system. The two poles are placed at the origin such that the filter is a FIR filter. The transfer function is: H ( z = z j( z+ j (( = ( z 0 (+ z. Y ( z = X ( z+z X (z Y ( z = [ X ( z+z X ( z] Filter equation: y[n] = ( x[n]+x[n ] ; Impulse response: h[n] = (δ[n]+δ[n ]. For a sampling rate of 0Hz, there are sample points on a 60 Hz sinusoidal wave. Every other point has the opposite sign as shown. Thus, the averaging removes the 60 Hz wave. 6

The FT is: H (e j ω = +e = e ( e j ω +e = e cos ω The magnitude is: H (e j ω = cosω, as shown. Example 7. Combine the 60-Hz notch filter (example 6 with the 3-pint low-pass filter (example with a cascade configuration. When two LTI systems are connected in cascade. The overall impulse response if the convolution of the two individual impulse responses. As shown in the figure, y [n]=x [n] y [n]= y [n] h [n]. h [n] and Combining the two, we have y [n]=( x [n] h [n] h [n]. Because the convolution satisfies the associative property, we have y [n]=x [n] (h [n] h [n]=x [n] h[n]. Thus, h[n]=h [n] h [n]. Low-pass filter: h [n] = (δ[n]+ δ[n ]+δ[n ] 60 Hz notch filter: h [n] = (δ[n]+ δ[n ] Combined: h [n] = 8 (δ[n]+δ[n ]+δ[n ]+δ[n ]+δ[n 3]+δ[] = (δ[n]+δ[n ]+ δ[n ]+ δ[n 3]+δ[n ] 8 7

Figure on the right shows how this can be done graphically. Because convolution in the time domain is equivalent to multiplication in the frequency domain, the overall transfer function is the product of the individual transfer functions. H [ z] = [+ z + z ] [+z ] = 8 [+ z + z + z 3 +z ]. The filter equation is: y[n] = ( x[n]+ x[n ]+ x[n ]+ x[n 3]+x[n ]. 8 The FT is: H (e j ω = (e cosω( e The magnitude of H (e j ω is given by: H (e j ω (cosω(+cos ω =. (+cosω = (cosω(+cos ω e jω. Example 8. Analyze the following filter: y[n] = x[n] x[n ]+ y [n ]. Transfer function: Take ZT, we have 8

Y ( z = X ( z z X ( z+ z Y ( z H ( z= Y ( z X ( z = z z = z ( z (+. z Impulse response: Impulse response can be obtained by solving the recursion or by doing a long division as shown. From the long division, we have h[n] = {( n n :even ( n n :odd Frequency response: Obtain the FT by substituting z=e j ω. We have H (e j ω = H (e j ω = e e = sin( ω ( 3 +sin ω j e ( e j ω e j 3 + j e ( e j ω e = j, which is plotted on the right using the online graphing calculator at <www.desmos.com/calculator>. j e sin ( ω 3 + j e sin ω Pole-zero plot: The transfer function can be written as: z H ( z = ( z (+ = z ( z 0( z ( z ( z+ The system has two poles and two zeros at: Poles:, Zeros: 0, The pole-zero plot is shown on the right. 9