You are on page 1of 5
DIGITAL SIGNAL PRoceBeNG LABORATORY ‘TITLE: DESIGNING LOW PASS FILTERS BY WINDOWING METHOD OBJECTIVE: tthe end of this experiment, you will be able to leara about (1) How to design FIR filters for various ozders and cut-off Frequencies (2) Whether pass band frequencies are attenuated and stop band frequencies are attenuated by the filter designed (3) How your designed FIR filters are resporiding to the input signals contaminated by noise. THEORY : In digital signal processing, idéal filters having sharp cut-off are not realizable in practice since their impulse responses,extend up to infinity.1n order 10 realize filters practically ,we need to truncate the impulse tesponse afiera few samples But this abrupt transition introduces many undesired features in the frequency domain(e.g. a large amount of power lies in the sidelobes). By windowing method, the truncated filter is modified fo satisfy certain frequency domein requirements and to perform its task as well If ha(a) is the desired impulse response and if H.(w) is the corresponding Fourier Transform, it follows, Ha (a) =)’ hd (n)exp(—jon) ro And Ad(ni) = (1/2) “trata, expUen)do Let w(n) be the window sequence and W(c) its F.T. So, W() = ¥. w(n) exp(-jan) wn) = (1/22) [7(o).exp(jamdoo [ NOTE: w(n) is non-zero in the interval 0 to N-1,otherwise zero] ‘Now if we multiply w(n) anid he(n) to get h(n) = w(n)*ha(n) H(o)= (1/22) Juaowto- vdy The window function is properly selected to achieve desired H() specifications. A few window functions (1) Rectangular window @ Triangular window (@) Henning window: (4 Hamming window ()Blackmnan window : win= 1 =f otherwise Wl) =1-24[n (NEL) /2] HN); n=O, -o otherwise 2 win) = 05-05 *cos[2am/(N-LJ 3 n=0,1.... Nol = 0 otherwise sw(n) = 0.54046 *cos [ 2un/(N-1)] Nl = 0 otherwise w(n) = 0420.5 *cos [2m /(N-1)] + 0.08 *cos [4am /(N-1)] = n=0,1,... NL =0 otherwise Ni) in time domain, an LPF is defined as hd} = Oe © forn=k Gino Anka (rk) form xk where ‘N=no of samples ke(N-1y2 {2 Choose an window funetion w(n} (3)Compute b(n) = ha(n)* w(n) (AUse freqz(B,A, «) function where B=h(n), and very @ from ~m to 7 (5)Plot the output of freqz function (This is your designed FIR filters response) (Do these steps with all five windows as mentioned shove. (1) Now change N to a higher value and repeat the above [ e.g. you may take Ne=8,64 and 512] (8) Ateach time, note the following (@) approximate transition width of the main lobe (b) peak of the first side lobe (c) maximum stop-band attenuation ‘NOTE : in order to test the performance of the filter in the time domain, do the following. (@ Construct a signal x(n) containing two sinusoids, one having frequency in the pass band ,the other in the stop vand (b) Pass x(n) through the filter to get output y(n) [use filtfilt() function fo do the same ]. Observe input and output spectra(in dB) by using fft() function. (c) Produce white noise using rand() function, Add this noise to x(n). Now repeat step (b) « (@) Find the corresponding SNR [ find the relative amplitudes of the sinusoid and that of other unwanted frequencies (in dB) and take the difference J RESULTS RECTANGULAR WINDOW N TRANSITION PEAK OF MAXIMUM WIDTH FIRST LOBE STOPBAND ATTENUATION i | r] rd 4 | os | L _ Repeat the above table for all the windows. RECTANGULAR WINDOW SIGNAL AMPLITUDE ‘NOISE AMPLITUDE Repeat the above table for all the windows. COMMENT : REFERENCE : (1) Digital signal processing: principles,algorithuns and applications Proakis & Manolakis (2) Digital signal processing : Oppenheim & Schafer

You might also like