CE 40763 Digital Signal Processing Fall 1992 Design

  • Slides: 46
Download presentation
CE 40763 Digital Signal Processing Fall 1992 Design of digital FIR filters using the

CE 40763 Digital Signal Processing Fall 1992 Design of digital FIR filters using the Windowing Technique Hossein Sameti Department of Computer Engineering Sharif University of Technology

Design of Digital Filters LTI Systems h(n) FIR Determine coefficients of h(n) [or P(z)

Design of Digital Filters LTI Systems h(n) FIR Determine coefficients of h(n) [or P(z) and Q(z)] IIR With rational transfer function No rational transfer function Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 2

Design of digital filters Design Stages 1. 2. 3. 4. Specifications Application dependent Design

Design of digital filters Design Stages 1. 2. 3. 4. Specifications Application dependent Design h(n) Determine coefficients of h(n) Realization Direct form I, II, cascade and parallel Implementation Programming in Matlab/C, DSP, ASIC, … Design of FIR filters ◦ Windowing Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 3

Motivation: impulse response of ideallow-pass filter IDTFT of ideal low-pass filter: Hossein Sameti, Dept.

Motivation: impulse response of ideallow-pass filter IDTFT of ideal low-pass filter: Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 4

Motivation: impulse response of ideal low-pass filter Multiply by a rectangular window • It

Motivation: impulse response of ideal low-pass filter Multiply by a rectangular window • It can be shown that if we have a linear-phase ideal filter and we multiply it by a symmetric window function, we end up with a linearphase FIR filter. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 5

Incorporation of Generalized Linear Phase Windows are designed with linear phase in mind ◦

Incorporation of Generalized Linear Phase Windows are designed with linear phase in mind ◦ Symmetric around M/2 So their Fourier transform are of the form Will keep symmetry properties of the desired impulse response Assume symmetric desired response With symmetric window ◦ Periodic convolution of real functions Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 6

Design of FIR filters using windows The steps in the design of FIR filters

Design of FIR filters using windows The steps in the design of FIR filters using windows are as follows: 1. Start with the desired frequency response results in the sinc function in time domain 2. Compute 3. Determine the appropriate window function w(n) 4. Calculate A finite-length window function Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 7

Desired frequency response Two properties should be considered: 1) The amplitude is unity in

Desired frequency response Two properties should be considered: 1) The amplitude is unity in the pass band it is zero in the stop band: 2) The phase is linear: Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 8

Example: Design of a high-pass FIR filter • First, we have to decide on

Example: Design of a high-pass FIR filter • First, we have to decide on the type of the filter. • Assume Type I filter (linear-phase) Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 9

Example: Design of a high-pass FIR filter IIR filter Hossein Sameti, Dept. of Computer

Example: Design of a high-pass FIR filter IIR filter Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 10

Example: Design of a high-pass FIR filter • It is a high-pass FIR filter

Example: Design of a high-pass FIR filter • It is a high-pass FIR filter with 7 taps that approximates the high-pass IIR filter. • How can we quickly check that the resulting FIR filter has the desired properties that we were looking for? (i. e. , it is a high-pass linear-phase filter)? Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 11

Reminder: DTFT Pairs Hossein Sameti, ECE, UBC, Summer 2012 Originally Prepared by: Mehrdad Fatourechi,

Reminder: DTFT Pairs Hossein Sameti, ECE, UBC, Summer 2012 Originally Prepared by: Mehrdad Fatourechi, 12

Windowing in frequency domain • What condition should we impose on W(ω) so that

Windowing in frequency domain • What condition should we impose on W(ω) so that H (ω) looks like Hd(ω) ? • Impulse function in the frequency domain, means an infinitely-long constant in the time-domain • Larger window means more computation Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 13

Windowing in Frequency Domain Windowed frequency response The windowed version is smeared version of

Windowing in Frequency Domain Windowed frequency response The windowed version is smeared version of desired response If w[n]=1 for all n, then W(ej ) is pulse train with 2 period Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 14

Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 15

Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 15

Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 16

Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 16

Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 17

Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 17

Rationale for the shape of the filter Ideal filter Rectangular Window function (Oppenheim and

Rationale for the shape of the filter Ideal filter Rectangular Window function (Oppenheim and Schaffer, 2009) Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 18

Filter Specifications Pass-band: Stop-band: Pass-band ripple: Stop-band ripple: Transition width: • What is the

Filter Specifications Pass-band: Stop-band: Pass-band ripple: Stop-band ripple: Transition width: • What is the ideal situation? (Oppenheim and Schaffer, 2009) Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 19

Filter Specifications Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 20

Filter Specifications Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 20

Observations Width of transition is not sharp! • The width of transition depends on

Observations Width of transition is not sharp! • The width of transition depends on the width of the main lobe of the window. • Ripples in the passband / stopband are proportional to the peaks of side lobes of the window. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 21

Controlling the width of the main lobe • Q: How can we control the

Controlling the width of the main lobe • Q: How can we control the transition width (size of the main lobe)? • A 1: using the size of the window Uncertainty principle Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 22

Controlling the width of the main lobe • Q: How can we control the

Controlling the width of the main lobe • Q: How can we control the size of transition width (size of the main lobe)? • A 2: Shape of the window; in other words, windows with a fixed size that have different shapes can have different main lobe width. • Rectangular window Smallest; and Blackman largest main lobe width Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 23

Controlling the peak of the side lobe • Q: How can we control the

Controlling the peak of the side lobe • Q: How can we control the peak of the side lobes so that we can get a good ripple behavior in the FIR filter? • A: using the shape of the window Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 24

Controlling the peak of the side lobe • Q: Can we control the peak

Controlling the peak of the side lobe • Q: Can we control the peak of the side lobes by changing the size of the window? • A: It can be shown that changes are not significant. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 25

Demonstration using Kaiser window Hossein Sameti, Dept. of Computer Eng. , Sharif University of

Demonstration using Kaiser window Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 26

Properties of Windows Prefer windows that concentrate around DC in frequency ◦ Less smearing,

Properties of Windows Prefer windows that concentrate around DC in frequency ◦ Less smearing, closer approximation Prefer window that has minimal span in time ◦ Less coefficient in designed filter, computationally efficient So we want concentration in time and in frequency ◦ Contradictory requirements Example: Rectangular window Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 27

Rectangular Window Narrowest main lobe ◦ 4 /(M+1) ◦ Sharpest transitions at discontinuities in

Rectangular Window Narrowest main lobe ◦ 4 /(M+1) ◦ Sharpest transitions at discontinuities in frequency Large side lobes ◦ -13 d. B ◦ Large oscillation around discontinuities Simplest window possible Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 28

Bartlett (Triangular) Window Medium main lobe ◦ 8 /M Side lobes ◦ -25 d.

Bartlett (Triangular) Window Medium main lobe ◦ 8 /M Side lobes ◦ -25 d. B Hamming window performs better Simple equation Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 29

Hanning Window Medium main lobe ◦ 8 /M Side lobes ◦ -31 d. B

Hanning Window Medium main lobe ◦ 8 /M Side lobes ◦ -31 d. B Hamming window performs better Same complexity as Hamming Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 30

Hamming Window Medium main lobe ◦ 8 /M Good side lobes ◦ -41 d.

Hamming Window Medium main lobe ◦ 8 /M Good side lobes ◦ -41 d. B Simpler than Blackman Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 31

Blackman Window Large main lobe ◦ 12 /M Very good side lobes ◦ -57

Blackman Window Large main lobe ◦ 12 /M Very good side lobes ◦ -57 d. B Complex equation Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 32

Frequency response of some popular windows (M=50) rectangular Hanning Bartlett Hamming Blackman Hossein Sameti,

Frequency response of some popular windows (M=50) rectangular Hanning Bartlett Hamming Blackman Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 33

Peak Approximation Error Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology

Peak Approximation Error Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 34

Comparison of different windows Hossein Sameti, Dept. of Computer Eng. , Sharif University of

Comparison of different windows Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 35

Good design strategy Shape of the window Main lobe width of the window Side

Good design strategy Shape of the window Main lobe width of the window Side lobe Main lobe Good design strategy: 1) Use shape to control the behavior of the side lobe. 2) Use width to control the behavior of the main lobe. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 36

Kaiser window Zeroth order modified Bessel function of the first kind Number of taps

Kaiser window Zeroth order modified Bessel function of the first kind Number of taps Parameter to control the shape of the Kaiser window and thus the trade-off between the width of the main lobe and the peak of the side lobe. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 37

Demonstration of Kaiser window M=20 Hossein Sameti, Dept. of Computer Eng. , Sharif University

Demonstration of Kaiser window M=20 Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 38

Demonstration of Kaiser window Hossein Sameti, Dept. of Computer Eng. , Sharif University of

Demonstration of Kaiser window Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 39

Comparison with popular windows Hossein Sameti, Dept. of Computer Eng. , Sharif University of

Comparison with popular windows Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 40

Design Guidelines using Kaiser window 2. Calculate the transition bandwidth Calculate 3. Choose 4.

Design Guidelines using Kaiser window 2. Calculate the transition bandwidth Calculate 3. Choose 4. Choose 1. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 41

Example: Design of LPF using Kaiser window Specs: Hossein Sameti, Dept. of Computer Eng.

Example: Design of LPF using Kaiser window Specs: Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 42

Example: Design of LPF using Kaiser window Specs: Type II filter Use Bessel equation

Example: Design of LPF using Kaiser window Specs: Type II filter Use Bessel equation to get w(n) Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 43

Example: Design of LPF using Kaiser window Hossein Sameti, Dept. of Computer Eng. ,

Example: Design of LPF using Kaiser window Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 44

Example: Design of LPF using Kaiser window Q: Does it satisfy the specs? Hossein

Example: Design of LPF using Kaiser window Q: Does it satisfy the specs? Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 45

Summary Windowing method is a fast and efficient solution to design FIR filters. Using

Summary Windowing method is a fast and efficient solution to design FIR filters. Using Kaiser windows, the window can be chosen automatically. Hossein Sameti, Dept. of Computer Eng. , Sharif University of Technology 46