Filter Design Techniques-Digital Signal Processing-Lab Mannual, Exercises of Digital Signal Processing

This file is manual for Digital Signal Processing lab. In this lab manual some useful matlab functions are mentioned. Sir Pranav Boparai gave this in class as lecture handout and lab manual. It includes: Butterworth, Windowing, Wvtool, Fvtool, Stopband, Ripple, Acceptable, Specification, Multiband, Arbitrary

Typology: Exercises

2011/2012

Uploaded on 07/26/2012

parivita
parivita 🇮🇳

4.6

(9)

72 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Digital Signal Processing Lab
2
Filter Design Techniques
1. Objective
1.1 IIR Filter Design using Butterworth Filters.
1.2 FIR Filter Design using Windowing.
1.3 Filter analysis using fvtool & wvtool
2. Overview
Digital filters with finite-duration impulse response (all-zero, or FIR filters) have both
advantages and disadvantages when compared to infinite-duration impulse response (IIR) filters.
FIR filters have the following primary advantages: They can have exactly linear phase. They are
always stable, even when quantized. The design methods are generally linear. They can be
realized efficiently in hardware. The filter startup transients have finite duration. The primary
disadvantage of FIR filters is that they often require a much higher filter order than IIR filters to
achieve a given level of performance. Correspondingly, the delay of these filters is often much
greater than for an equal performance IIR filters.
3. IIR Methods
There are the four classical IIR filter types, namely Butterworth, Chebychev Type I and
II, and Elliptic filters. In this lab you will encounter only with Butterworth filter and probably
their design. Since straightforward algorithms for design and implementation of these filters
exist, many software programs help you in designing these filters by simply specifying their
parameters. Hence, for the sake of this experiment you need not know all the mathematical detail
involved in the design of the filter. Butterworth filters here refer to the lowpass case.
3.1 Butterworth
The Butterworth filter of order N, also called the maximally flat filter, is an
approximation of the ideal filter. As a result the frequency response of this filter decreases
monotonically with frequency and 21|)(| == c
ffH . The decrease is very slow in the
passband and quick in the stopband. In a design problem where no ripple is acceptable in
passband and stopband, Butterworth filter is a good choice.
Now we design analog and digital Butterworth low pass filter with following
specifications.
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Filter Design Techniques-Digital Signal Processing-Lab Mannual and more Exercises Digital Signal Processing in PDF only on Docsity!

Filter Design Techniques

1. Objective

1.1 IIR Filter Design using Butterworth Filters. 1.2 FIR Filter Design using Windowing. 1.3 Filter analysis using fvtool & wvtool

2. Overview

Digital filters with finite-duration impulse response (all-zero, or FIR filters) have both advantages and disadvantages when compared to infinite-duration impulse response (IIR) filters. FIR filters have the following primary advantages: They can have exactly linear phase. They are always stable, even when quantized. The design methods are generally linear. They can be realized efficiently in hardware. The filter startup transients have finite duration. The primary disadvantage of FIR filters is that they often require a much higher filter order than IIR filters to achieve a given level of performance. Correspondingly, the delay of these filters is often much greater than for an equal performance IIR filters.

3. IIR Methods

There are the four classical IIR filter types, namely Butterworth, Chebychev Type I and II, and Elliptic filters. In this lab you will encounter only with Butterworth filter and probably their design. Since straightforward algorithms for design and implementation of these filters exist, many software programs help you in designing these filters by simply specifying their parameters. Hence, for the sake of this experiment you need not know all the mathematical detail involved in the design of the filter. Butterworth filters here refer to the lowpass case.

3.1 Butterworth

The Butterworth filter of order N, also called the maximally flat filter, is an approximation of the ideal filter. As a result the frequency response of this filter decreases

monotonically with frequency and | H ( f = fc )|= 1 2. The decrease is very slow in the

passband and quick in the stopband. In a design problem where no ripple is acceptable in passband and stopband, Butterworth filter is a good choice. Now we design analog and digital Butterworth low pass filter with following specifications.

π π

π ≤ ≤ ≤

He w

He w jw

jw

% ANALOG FILTER DESIGN

[N, Wn] = buttord(0.2pi, 0.3pi, 20log10(0.89125), 20log10(0.17783), 's') [numd,dend]=butter(N, Wn,'s') % DIGITAL FILTER DESIGN [N, Wn] = buttord(0.2, 0.3, 20log10(0.89125), 20log10(0.17783)) [numz,denz]=butter(N, Wn)

4. FIR Methods

The Signal Processing Toolbox supports a variety of methods for the design of FIR filters. Windowing, Multiband with transition bands, constrained least square, arbitrary response and raise cosine.

4.1 Window-Based Design

Windowing is a common design method for FIR filters. In this method, the ideal frequency response H(f) is sampled. The corresponding ideal impulse response h(n) is determined by the inverse Fourier transform. In general, this response cannot be implemented in a digital filter because it is infinite and noncausal. Then h(n) is symmetrically truncated (multiplied by a finite, symmetric window) to create a linear phase finite impulse response. Windowing does not explicitly impose amplitude response constraints, such as passband ripple or stopband attenuation. It must be used iteratively to produce designs that meet such specifications. 4.2 Low pass filter design (Window-Based Design)

Consider the ideal, digital low-pass filter with a cutoff frequency of ω 0 rad/s. This filter

has magnitude 1 at all frequencies less than ω 0 , and magnitude 0 at frequencies between ω 0

and π. Its impulse response sequence h(n) is

This filter is not implementable since its impulse response is infinite and noncausal. To create a finite-duration impulse response, truncate it by applying a window. Retain the

[n,wn,beta] = kaiserord([1000 1500],[1 0],[0.01 0.001],6000); h = fir1(n,wn,kaiser(n+1,beta)); The kaiserord function estimates the filter order, cutoff frequency, and Kaiser Window beta parameter needed to meet a given set of frequency domain specifications. The ripple in the passband is roughly the same as the ripple in the stopband. As you can see from the frequency response. In order to generate Kaiser Window with known β and order (M) we use the following command in MatLab. B=kaiser(m,beta)

5. Exercise

IIR FILTER

Use the following equations to find the poles of H(s):

+⎜⎝⎛^ Ω ⎟⎠⎞

− = N

j c s

H sH s 2 1

() ( )^1

2 (^21 )⎟⎟ k=0,1,2.....2N- 1 ⎠

Ω ⎛ jN k +^ Ns e

π

After finding the poles sketch poles. Compute transfer function H(s). Use the poles present in left half plane in transfer function. FIR FILTERS 5.1 Design a windowed FIR lowpass filter at cutoff of fs/8. Use following windowing methods:

  • Hamming window
  • Hann window
  • Barlet window
  • Blackman window Filter speech signal using your designed lowpass filter.

W p = 0. 4 π , Ws = 0. 6 π,δ 1 = 0. 01 and δ 2 = 0. 001 ,β=5.653, M= 37

5.2 Plot the frequency response. 5.3 Filter the signal y with the designed filter. 5.4 Compare signals and spectra before and after filtering.