Lecture 1 FIR Filtering Introduction

Lecture 1 FIR Filtering Introduction

EE3054 Signals and Systems Lecture 1 FIR Filtering Introduction Yao Wang Polytechnic University Most of the slides included are extracted from lecture presentations prepared by McClellan and Schafer License Info for SPFirst Slides This work released under a Creative Commons License with the following terms: Attribution The licensor permits others to copy, distribute, display, and perform the work. In return, licensees must give the original authors credit. Non-Commercial The licensor permits others to copy, distribute, display, and perform the work. In return, licensees may not use the work for commercial purposes—unless they get the licensor's permission. Share Alike The licensor permits others to distribute derivative works only under a license identical to the one that governs the licensor's work. Full Text of the License This (hidden) page should be kept with the presentation 1/22/2008 © 2003, JH McClellan & RW Schafer 2 What is a signal? Speech waveform in time (1-D signal) Stock prices in time (1-D signal) Images (2-D signal) We will focus on 1-D signal in this class Continuous time signal x(t) Discrete time signal x[n] Discrete in nature Sampled from continuous time signal A Speech Signal: 1/22/2008 © 2003, JH McClellan & RW Schafer 4 What is a system? Something that transforms an input signal to another signal Speech: Noise removal, echo cancellation, … Image: contrast enhancement, deblurring, … General mathematical description: y(t) = T ( x(t) ) y[n] = T ( x[n] ) EXAMPLES: POINTWISE OPERATORS SQUARING: y[n] = (x[n])2 RUNNING AVERAGE RULE: “the output at time n is the average of three consecutive input values” How to characterize signals? In time domain directly In a transform domain: Represent a signal as sum of some basis signals Coefficients for different bases leads to a transform domain representation Fourier transform: Use sinusoidal signals as bases for both continuous and discrete time Z-transform: for discrete time only Laplace transform: for continuous time only How to characterize systems? Impulse response Frequency response Helpful to look from a transformed domain representation Fourier transform: Impulse response -> frequency response Z-transform/Laplace transform: impulse response -> transfer function Topics Covered in This Course Discrete time signals and systems Linear time invariant systems Convolution or filtering Impulse response Frequency response Z-transform analysis Discrete time Fourier transform Continuous time signals and systems Sampling of continuous time signals Using MATLAB for implementing signal and system operations and transforms LECTURE OBJECTIVES INTRODUCE FILTERING IDEA Weighted Average Running Average FINITE IMPULSE RESPONSE FILTERS FIRFIR Filters Show how to compute the output y[n] from the input signal, x[n] 1/22/2008 © 2003, JH McClellan & RW Schafer 9 DIGITAL FILTERING x(t)x[n] y[n] y(t) A-to-D COMPUTER D-to-A CONCENTRATE on the COMPUTER PROCESSING ALGORITHMS SOFTWARE (MATLAB) HARDWARE: DSP chips, VLSI DSP: DIGITAL SIGNAL PROCESSING 1/22/2008 © 2003, JH McClellan & RW Schafer 10 DISCRETE-TIME SYSTEM x[n] y[n] COMPUTER OPERATE on x[n] to get y[n] WANT a GENERAL CLASS of SYSTEMS ANALYZE the SYSTEM TOOLS: TIME-DOMAIN & FREQUENCY- DOMAIN SYNTHESIZE the SYSTEM 1/22/2008 © 2003, JH McClellan & RW Schafer 11 D-T SYSTEM EXAMPLES x[n] y[n] SYSTEM EXAMPLES: POINTWISE OPERATORS SQUARING: y[n] = (x[n])2 RUNNING AVERAGE RULE: “the output at time n is the average of three consecutive input values” 1/22/2008 © 2003, JH McClellan & RW Schafer 12 DISCRETE-TIME SIGNAL x[n] is a LIST of NUMBERS INDEXED by “n” STEM PLOT 1/22/2008 © 2003, JH McClellan & RW Schafer 13 3-PT AVERAGE SYSTEM ADD 3 CONSECUTIVE NUMBERS Do this for each “n” Make a TABLE = 1 + + + + y[n] 3 (x[n] x[n 1] x[n 2]) n=0 1/22/2008 © 2003, JH nMcClellan=1 & RW Schafer 14 INPUT SIGNAL = 1 + + + + y[n] 3 (x[n] x[n 1] x[n 2]) OUTPUT SIGNAL 1/22/2008 © 2003, JH McClellan & RW Schafer 15 ANOTHER 3-pt AVERAGER Uses “PAST” VALUES of x[n] IMPORTANT IF “n” represents REAL TIME WHEN x[n] & y[n] ARE STREAMS = 1 + − + − y[n] 3 (x[n] x[n 1] x[n 2]) 1/22/2008 © 2003, JH McClellan & RW Schafer 16 ANOTHER 3-pt AVERAGER The output signals in previous examples are shifted from the input signals To align the output with the input, use both “PAST” and “FUTURE” VALUES of x[n] = 1 − + + + y[n] 3 (x[n 1] x[n] x[n 1]) Go through on the board PAST, PRESENT, FUTURE “n”is TIME 1/22/2008 © 2003, JH McClellan & RW Schafer 18 3-pt AVG EXAMPLE Input : x[n] = (1.02)n + cos(2π n /8 + π / 4) for 0 ≤ n ≤ 40 USE PAST VALUES 1/22/2008 © 2003, JH McClellan & RW Schafer 19 7-pt AVG EXAMPLE Input : x[n] = (1.02)n + cos(2π n /8 + π / 4) for 0 ≤ n ≤ 40 CAUSAL: Use Previous 1/22/2008 © 2003, JH McClellan & RW Schafer 20 LONGER OUTPUT FILTERED STOCK SIGNAL INPUT OUTPUT 1/22/2008 © 2003, JH McClellan & RW Schafer 50-pt Averager21 GENERAL FIR FILTER FILTER COEFFICIENTS {bk} DEFINE THE FILTER M = − y[n] ∑bk x[n k] k=0 = − For example, bk {3, 1,2,1} 3 = − y[n] ∑bk x[n k] k=0 = 3x[n] − x[n −1] + 2x[n − 2] + x[n − 3] 1/22/2008 © 2003, JH McClellan & RW Schafer 22 Example Given an input signal Compute the output of the previous filter 1/22/2008 © 2003, JH McClellan & RW Schafer 23 GENERAL FIR FILTER FILTER COEFFICIENTS {bk} M = − y[n] ∑bk x[n k] k=0 FILTER ORDER is M FILTER LENGTH is L = M+1 NUMBER of FILTER COEFFS is L 1/22/2008 © 2003, JH McClellan & RW Schafer 24 GENERAL FIR FILTER SLIDE a WINDOW across x[n] M = − y[n] ∑bk x[n k] k=0 x[n-M] x[n] 1/22/2008 © 2003, JH McClellan & RW Schafer 25 More on signal ranges and lengths after filtering Input signal from 0 to N-1, length=L1=N Filter from 0 to M, length = L2= M+1 Output signal? From 0 to N+M-1, length L3=N+M=L1+L2-1 Causal vs. Non-causal Filters? So far we only considered the filters that range from 0 to M Output at n depends on input from n-M to n (past values only) These are called “Causal” filters More generally, the filter may range from M1 to M2 Output at n depends on input from n-M2 to n-M1 Ex. Centered averaging over 7 points, M1=-3, M2=3 Unit Impulse Signal x[n] has only one NON-ZERO VALUE 1 n = 0 δ [n] = 0 n ≠ 0 UNIT-IMPULSE 1 n 1/22/2008 © 2003, JH McClellan & RW Schafer 28 UNIT IMPULSE SIGNAL δ[n] n = 3 δ[n] is NON-ZERO δ [n − 3] When its argument is equal to ZERO 1/22/2008 © 2003, JH McClellan & RW Schafer 29 Any x[n] Can be Represented by Impuse Signals! Use SHIFTED IMPULSES to write x[n] x[n] = 2δ [n] + 4δ [n −1] + 6δ [n − 2] + 4δ [n − 3] + 2δ [n − 4] 1/22/2008 © 2003, JH McClellan & RW Schafer 30 SUM of SHIFTED IMPULSES This formula ALWAYS works 1/22/2008 © 2003, JH McClellan & RW Schafer 31 4-pt AVERAGER CAUSAL SYSTEM: USE PAST VALUES = 1 + − + − + − y[n] 4 (x[n] x[n 1] x[n 2] x[n 3]) INPUT = UNIT IMPULSE SIGNAL = δ[n] x[n] = δ [n] = 1 δ + 1 δ − + 1 δ − + 1 δ − y[n] 4 [n] 4 [n 1] 4 [n 2] 4 [n 3] OUTPUT is called “IMPULSE RESPONSE” = 1 1 1 1 h[n] { , 0, 0, 4 , 4 , 4 , 4 , 0, 0, } 1/22/2008 © 2003, JH McClellan & RW Schafer 32 4-pt Avg Impulse Response = 1 + − + − + − y[n] 4 (x[n] x[n 1] x[n 2] x[n 3]) δ[n] “READS OUT” the FILTER COEFFICIENTS = 1 1 1 1 h[n] { , 0, 0, 4 , 4 , 4 , 4 , 0, 0, } “h” in h[n] denotes Impulse Response n=0 NON-ZERO n=–1 When window δ n=0 1 overlaps [n] n=1 n n=4 n=5 1/22/2008 © 2003, JH McClellan & RW Schafer 33 What is Impulse Response? Impulse response is the output signal when the input is an impulse Finite Impulse Response (FIR) system: Systems for which the impulse response has finite duration For FIR system, impulse response = Filter coefficients h[k] = b_k Output = h[k]* input 1/22/2008 © 2003, JH McClellan & RW Schafer 34 FIR IMPULSE RESPONSE Convolution = Filter Definition Filter Coeffs = Impulse Response M M = − = − y[n] ∑bk x[n k] y[n] ∑h[k]x[n k] k=0 k=0 CONVOLUTION 1/22/2008 © 2003, JH McClellan & RW Schafer 35 MATH FORMULA for h[n] Use SHIFTED IMPULSES to write h[n] h[n] = δ [n] −δ [n −1] + 2δ [n − 2] −δ [n − 3] +δ [n − 4] 2 h[n] 1 0 4 n = − − –1 bk {1, 1, 2, 1,1} 1/22/2008 © 2003, JH McClellan & RW Schafer 36 Convolution Sum OutputOutput == ConvolutionConvolution ofof x[n]x[n] && h[n]h[n] NOTATION: y[n] = h[n]∗ x[n] Here is the FIR case: FINITE LIMITS M y[n] = ∑h[k]x[n − k] k=0 FINITE LIMITS Same as bk 1/22/2008 © 2003, JH McClellan & RW Schafer 37 CONVOLUTION Example h[n] = δ [n] −δ [n −1] + 2δ [n − 2] −δ [n − 3] + δ [n − 4] x[n] = u[n] n −101234567 x[n]01111111..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    45 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us