



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 5
This page cannot be seen from the preview
Don't miss anything!




1.1 IIR Filter Design using Butterworth Filters. 1.2 FIR Filter Design using Windowing. 1.3 Filter analysis using fvtool & wvtool
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.
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.
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
[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)
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.
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)
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)
Use the following equations to find the poles of H(s):
j c s
H sH s 2 1
2 (^21 )⎟⎟ k=0,1,2.....2N- 1 ⎠
Ω ⎛ jN k +^ N − s 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:
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.