You are on page 1of 360
Discrete Fourier Transform ea ee Definition of DFT Properties of DFT Linear Filtering Methods based on DFT = a a © Code : DSP6 1.1 Introduction : What is DFT ? According to the definition of DTFT, X(@) = YE x(t 1) nea We know that X (0) is fourier transform of discrete time signal x(n). The range of “0” is from 0 to 2 or —m to 7. Thus it is not possible to compute X(@) on digital computer. Because in Equation (1) the range of summation is from ~ =» to +0, But if we make this range finite then it is possible to do these calculations on digital computer. When a fourier transform is calculated only at discrete points then it is called as discrete fourier transform (DFT). 1.1.1 Sampling the F.T. : If we have aperiodic time domain signal then discrete time fourier transform (DTFT) is obtained. But DTFT is continuous in nature and its range is from ~s> to +s, Then a finite range sequence is obtained by extracting a particular portion from such infinite sequence. Now X(@) is a continuous signal. A discrete signal is obtained by sampling X(@). A particular sequence which is extracted from infinite sequence. is called as windowed sequence. A windowed signal is considered as periodic signal. We can obtain periodic extension of this signal. This periodic extension in frequency domain is called as Discrete Fourier Transform (DFT). From this original sequence, x(n) is obtained by performing inverse process which is Inverse Discrete Fourier Transform (IDFT). x(o) x(0) DTFT —eeseeseee n ro 04 ° x 2s @ ) x(k) by sampling Pa) U oFT — k “1012 N-1N -N 0 N " Lo? @ © Hig. PL This process is explained graphically as shown in Fig. F-1. Fig. F-1(a) shows discrete time signal x(n). By taking DTFT of x(n); X(@) is obtained as shown in Fig. F-1(b). The sampled version of X(@) is denoted by X(k) which is called as DET. It is shown in Fig. F-1(c). By performing IDFT; original is obtained. It is denoted by %(n). It is shown in Fig. F-1(@). It is periodic extension of sequence x (n). Here ‘N’ denotes the number of samples of input sequence and the number of frequency points in the DFT output. 1.2 Def ion of DFT : The Discrete Fourier Transform : The DFT of discrete sequence x (n) is denoted by X(k). It is given by, N-1 x(k) =D x(n) P/N A) Here k = 0,1,2..N- Since this summation is taken for ‘N’ points; it is called as ‘N’ point DFT. We can obtain discrete sequence x(n) from its DPT. It is called as inverse discrete fourier, transform (IDFT). It is given by, ‘ x(n) = y z ayn (2) Here n = 0,1,2,...N=1 This is called as ‘N’ point IDFT. Now we will define the new term “W’ as, Wy 3) This is called as twiddle factor. Twiddle factor makes the computation of DFT-a bit easy and fast. Using twiddle factor we can write equations of DFT and IDFT as follows : N-1 a xX(ik)= DY x(n) We (4) n=0 Here n = 0,1,2..N-1 and x(n) = yD XC)W (8) i N Here n = 0,1,2,..N 1.2.1 Relationship between DTFT and DFT.: ‘The DTFT is discrete time fourier transform and is given by, x(o) = YS x(me™ (6) nse ‘The range of is from — x to or 0 to 2. Now we know that discrete fourier transform (DFT) is obtained by sampling one cycle of fourier transform. And DFT of x(n) is given by, N-1 K(k) = YS x(n FN .) n=0 Comparing Equations (6) and (7), we can say that DET-is obtained from DTFT by putting By comparing DFT with DTT we can write, 1. The continuous frequency spectrum X ( @) is replaced by discrete fourier spectrum X (k). Infinite summation in DTFT is replaced by finite summation in DFT. 3. The continuous frequency variable is replaced by finite number of frequencies located at 2nk NT,’ 1.2.2 DFT of Standard Signals : In this gub-section, we will obtain DFT of some standard signals with the help of solved examples as follows where , is sampling time. Prob. 1: Obtain DFT of unit impulse 8 (n). Soln. : Here x(n) = 8(n) a) According to the definition of DFT we have, N-1 X(k) = x(nye Pe’ 2) 3(n) n=0 But 8(n) = 1only atn=0, ' It is shown in Fig. F-2 Thus Equation (2) becomes, n=0 X(k) = 8(0)e% Fig. F-2 This is the standard DFT pair. Prob. 2: Obtain DFT of delayed unit impulse 8 (n—ng). Soin, : We know that 8 (n—ng) indicates unit impulse delayed by ‘n9” samples. Here x(n) = 8(n—n) (1) N-1 Now we have, X(k) = x(n PN 2) 5 (nM) But 8(n-ny) = 1 only atn= It is shown in Fig. F-3 ‘Thus Equation (2) becomes, n= Mp X(k) Fig. F-3 Similarly we can write, Prob. 3: Obtain N-point DFT of exponential sequence x(n) =a u(n) forO = +. 4 23s td According to cyclic property of DFT. ° w= wei aM aM, and We = WW 4j a MRM Putting these values in Equation (8) we get, rtad afi cicl 4 MW l= ty pr Hi 1 j-1 -j] Now given sequence is, x(n) = (1, 1). We want the length of this sequence equal to 4. It is obtained by adding zeros at the end of sequence. This is called as zero padding. x(n) = (1, 1,0, 0} 410) Now the DFT is given by, bora -j-1 ifjt -1 1-1/0 j -1 -j) [0 1+1+0+0 2 = x =| tcito+0 | _}1-j By = X=) 11040 0 1+j+o+0] [1+j This DFT sequence can also be weitten as, X, = {24+j0,1-j,0+j0,1+j} t 4 0 Magnitude plot : The magnitude at different values is obtained as follows, Ay 2 +(0y Fork =0 => 1X(k)I For k = 1 = 1X(k)I Cyre(-1? =V¥2 21414 Fork =2=1X(k)| = YOO =0 Fork =3=1X(k)l = Way +c1y = V2=1414 ‘This magnitude plot is shown in Fig. F-7. Fig. F-7 : Magnitude plot Prob. 2: Compute the DFT of four point sequence x(n) = (0, 1, 2, 3} Soln. : The four point DFT in the matrix form is given by, X, = [W,]-x(n) 11 1 -j -1 1-1 1 1 j-l [O+1+2+3 0-5-2433 O-1+2-3 0+j-2-3) Prob. 3: Calculate 8 point DFT of : x(n) = (1,2,1,2) Soin. : First we will make length of given sequence ‘8’ by doing zero padding. “ x(n) = {1,2, 1, 2,0, 0, 0, 0} A) 2x We have, Wy =e N we ~Q) 8 Here the range of K and n is from 0 to N~1 that means from 0 to 7. 0.707 - 0.707 wll sw? w= w® = w=... = -0.707-j0.707 oe Ny HM, =e Wee ww ewe wit. 1 5 Me Ng = M5 B wt = w? 0.707 +} 0.707 ae Ns wt ew ew” oe Ns 1s Wy, = 0.707 + j 0.707 X, = (WyIx, 44) Putting values of we in Equation (3) and write x, in matrix form we get, 1 1 1 1 1 1 1 1 1 0.707-j0.707 -j -0.707-j0.707 ~1 -0.707+j0.707 j . 0.707+j0.707 1 -i -1 i 1 -i “1 i 1 -0707-J0.707 j 0.707-j0.707 ~1 0.707+j0.707 -j -0.707+)0.707 1 “1 1 “1 1 wt 4 “1 ~ 0.707 +}0.707 ~j 0.707 +) 0.707 “1 i 0.707 +)0.707 -1 0,707-J0.707 j + -0.707-jo.707 “i 1 i “1 “i 0.707 +0707 -1 -0707-]0.707 -j 0.707 -j0.707 142+1424040+040 141414~j 1414-j-1414-j1.414+0+040+0 1~j2-1+j24+0+0+0+0 1-1414—~j 1414 +j+1414-j 141440404040 1-2+1-24+04040+0 114144) 1414~j+1414 4) 1414+040+0+0 14j2-1-j2+0+0+040 1414144) 1.414 +j~1414+j 1414+0+0+0+0 6 1-j2414 0 1-j 1.828 2 14 j1.828 0 1+j 3.828 This is the required DFT. Prob. 4: ‘Determine the length-4 sequence from its DFT. X(k) = (4 1-)-2, 143 Soln. : The IDFT in matrix form is given by, ol) Here Xy is the given DFT matrix. “*” indicates complex conjugate, To obtain the complex conjugate, we have to change the sign of j term. For example, complex conjugate of 1—jl is 1 + jl. Now we have already obtained the matrix W,, in problem (1). It is, 1orotod ype fi cb ct i Was] yep a =n - +0) Lj -t -j 1 1 1 1 ype fh J -t 4 [2-i-i+o+j-1 x(n) = cone That means x(n) = {1, 1, 0, 0} 0 +i 4 4 0 0 This is same as the given sequence; so calculated DFT is correct. Prob. 6 : - rol ity¢a) = Bonde n)) Find ¥(k) if X(k) = (05,24), 342, j,3,-j,3-j2,2-j] Soln. : We have, [x(n)+x(=n) y(n) = 2 ‘Taking DFT of both sides we get, Y(k) = PA sn) Given X(k) = {05,24),3+32,j,3,-j,3-i2,2-i} X(-k) = {05,2-j,3-j2,-j.+3,j,3+)2,24j} Putting these values in Equation (2) we get, Y(k) = $11,4,6.0,6,0,6,4) ) = (05, 2, 3, 0, 6,1 1.3 Properties of DFT : In this section we will study some important properties of DFT. We know that, the DFT of discrete time sequence, x(n) is denoted by X (k). And the DFT and IDFT pair is denoted by, DFT x(n) <> X(k) N Here ‘N’ indicates ‘N’ point DFT. 1.3.1 Lineari DFT DFT Statement: If x, (nm) <> X, (k) and x, (m) <> X,(k) then, N N DFT a, x) (1) +4, x(n) > ay X (k) +a) X, (k) N Here a, and a, are some constants. Proof : According to the definition of DFT, N-1 ka X(k)= ¥ x(n) Wy A) n=0 Here x(n) = a,x, (n)+a,x,(n) N-1 ka Xk) =D Lapx, (n)+ayx) (0) ] We n=0 N-1 kn N-1 = LY ax wee Y ax (nywe n=0 n=0 Since a, and a, are constants; we can take it out of the summation sign, N-1 N-1 X(k) = a x(n) We tay zr x(n) We (2) n=0 ° n=0 Comparing Equation (2) with the definition of DFT, X(k) = aX, (k) +a, X,(k) 1.3.2 Periodicity : DFT Statement : If x(n) > X(k) then N x(n+N) = x(n) for all n and X(k+N) = X(k) for all k. Proof : According to the definition of DFT, N-1 xis x(n) We ) n=0 Replacing k by k +N we get, N-1 . _ +N)n X(k#N) = x(nywh n=0 N-1 Nn XCREN) = 3) x(n) we we ) n=0 We know that Wy is a twiddle factor and itis given by, 2 N Wy =e 2x Wn we (e7*) if 2a N Nn . WA" = cos 2nn— j sin 2am G) But ‘n’ is an integer cos 2mm=1 and sin 2nn = 0 Nay wy 1 wl) Putting this value in Equation (2) N-1 K(kEN) =D x(a we (5) n=0 Comparing Equations (1) and (5), 1.3.3 ular Symmetries of a Sequence : We have studied the periodicity property of DFT. Suppose input discrete time se juence is x(n) then, the periodic sequence is denoted by x,(n). The period of x,(m) is ‘N’ wh -h means after ‘N’ the sequence x (1) repeats itself. Now we can write the sequence x, (n) as, x,() Y x@-m) Al) We will consider one example. Let x(n) {1, 2, 3, 4}. This sequence is shown in Fig. F-8(a). The periodic sequence x, (n) is shown in Fig. F-8(b). We will delay the periodic sequence x, (n) by two sample as shown in Fig. F-8(c). This sequence is denoted by x,(n—2). Now the original signal is present in the range n = 0 to n = 3. In the same range we will write the shifted signal as shown in Fig. F-8(d). This signal is denoted by x(n). Now from Fig. F-8 we can write every sequence as follows x(n) = {123.4} Q) t x(m) =f 1,2, 3, 4 1, 2, 3,4, 1, 2, 3, 4, 43) t x(n) = (123412341234. (4) T and x(n) = (34,12) (5) tT Now observe Equations (2) and (5). We can say that the sequence x(n) is obtained by circularly shifting sequence x(n), by two samples. That means x(n) is related to x(n) by circular shift, {a} Fig. F-8 : Shifting of sequence x(n) Notation : This relation of circular shift is denoted by, x(n) = x(n—k,modulo N) 6) It means that divide (n-k) by N and retain the remainder only. We can also use the short hand notation as follows : x(n) = x((n-k))y, . @™ Here ‘K’ indicates the number of samples by which x(n) is delayed and ‘N’ indicates N-point DFT. In the present example, the sequence x(n) is delayed by two samples; thus k = 2. Since there are four samples in x(n); this is four point DFT. Thus N = 4. Now for this example Equation (6) becomes, x(n) = x((n-2)), ~-@) Graphical Representation ‘The circular shifting of a sequence is plotted graphically as follows : (1) Circular plot of s equence x(n) : Here we have considered, x(n) = {1,2,3,4) tT Circular plot of x(n.) is denoted by x ((n)),. This plot is obtained by writing the s..nples of x(n) circularly anticlockwise. It is shown in Fig. F-9( Fig. F-9(a) : x ((n))q— The samples of x (11) are plotted circularly anticlockwise (2) Circular delay by one sample: To delay sequence x(n) citcu..rly by one sample; shift every sample circularly in anticlockwise direction by 1. This is shown in Vig. F-9(b). This operation is denoted by x ((n-1)) anticlockwise direction Fig. F-9(b) : x ((n—1)) shift every sample by samples means shift the sequence circularly in anticlockwise Remember that delay by 4 direction by k. (3) Cireular advance by one sample : To advance ‘sequence x(n) circularly by one sample; shift every sample circularly in clockwise direction by 1 sample, This sequence is denoted by x ((n+1)). Itis shown in Fig. F-9(¢). Fig. F-9(c) : x ((n+1)) shift every sample by one in clockwise direction Remember that advance by k samples means shift the sequence circularly in clockwise direction by k. (4) Circularly folded sequence : A circularly folded sequence is denoted by x((—n)). We have plotted sequence x ((n)) in anticlockwise direction. So folded sequence x ((—n)) is plotted in clockwise direction. It is shown in Fig. F-9(d). Remember that circular folding means plot the samples in clockwise direction. Now recall Equation (7) it is, x(n) = x((n-2)), Fig. F-9(d) : x ((—n)) samples are plotted circularly clockwise It indicates delay of sequence x(n) by two samples. It is obtained by rotating samples of Fig. F-9(a) in anticlockwise direction by two samples. This sequence is shown in Fig. F-%e). EE! ee Fig. F-9(¢) : Plot of x ((n-2))y (5) Circularly even sequence : The N-point discrete time sequence is circularly even if it is symmetric about the point zero on the circle, ‘That means, Consider the sequence, x(n) = (1,4, 3, 4}. It is plotted as shown in Fig. F-9(f). Note that this seqtience is symmetric about point zero on the circle. So it is circularly even sequence. We can also verify it using mathematical equation, The sequence is x(n) = (1,43, 4) ex(O)=1, x(1)=4, x(2)=3and x(3)=4 We have the condition for circularly even sequence, x(N=n) = x(n) ol) (nm) = {1 4, 3, 4} Here N = 4. We will check this condition by putting different values of n as follows : Fig. F-9(f) For n= 1 => x(4-1)=x(1) that means x(3)=x(1)=4 Forn=2 => x(4—2)=x(2) that means x(2)=x(2)=3 Forn=3 => x(4-3)=x(3) that means x(1) = x(3)=4. Since for all values of ‘n’, Equation (1) is satisfied; the given sequence is circularly even. (©) Circularly odd sequence : ‘A N-point sequence is called circularly odd if it is antisymmetric about point zero on the circle. ‘That means, Consider the sequence, x(n) ) 3} This sequence is plotted as shown in Fig. F-9.(g) Fig. F-9(g) : Plot of x(n) = (2, -3, 0, 3} Here x (0) = 2, x(1) =—3, x(2) = 0 and x(3) We have the condition for circularly odd sequence, x(N-n) = -x(n), for 1 SnSN-1 a) Forn=1 = x(4—1)=—x(1) that means x(3) =~x(1) For n= 2 =» x(4—2)=~x(2) that means x (2) -x(2) Forn=3 => x(4—3)=-x(3) that means x(1) =~x(3) ‘Thus for all values of ‘n’, Equation (1) is satisfied. Hence the sequence is circularly odd. Summary of circular properties : ‘The summary of circular property is shown in Table F-2. Table F-2 }x((a-k)) x((ntk)) x(-n) 1.3.4 Symmetry Properties of DFT : ‘The symmetry properties of DFT are derived in the similar way of DIFT symmetry properties. We know that DFT of sequence x(n) is denoted by X (Kk). Now if'x(n) and X(k) are complex valued sequence then it can be represented as follows x(n) = xg(m)+jxy(n), OSnSN-1 and = X(k) = Xp(k)+jX,(k), OsksN-1 Here ‘R’ stands for real part and ‘I’ stands for imaginary part. According to the definition of DFT, N-1 X(kK) = LY xine a=0 j2Rkw/N Putting Equation (1) in Equation (3) N-1 K(k) = ES [x(a ting (ndle” n=0 1) (2) ~-QB) wld) Putting this value in Equation (4) we get, N-1 Xk) =D by (msixcni =(8")} n=0 N-1 2 x(iky= [sx (ay-ooo{ 25 }-ing nin 282) n=0 sincorson( 28 Faycmrsn( 28] Here j* = — 1; and writing summation for real and imaginary parts separately we get, N-1 xX(k= YL [se(are n=0 1 iy [su cnsin[ 29 Joy cmeos{ 282 ]] 6) n=0 Comparing Equations (5) and (2) we can write, N-1 Xk) = [svcnreos 28 }+5,cmsin(?5)] 6) n=0 N-1 and X(k) = - > [ucnpsin( 25 R}s cneo(?8")] wD) n=0 Equations (6) and (7) are obtained by using definition of DFT. Similarly we can obtain real and imaginary parts of x(n) using definition of IDFT. 2mkn N I (8) 8 7 Zl it 2 5 z “5 Ze a) z 8 “8 Now we will consider different cases as follows : Case (i) : When x(n) is real valued : Statement : If x(n) is real valued then X(N-k) = X(-k)=X"(k) Proof : According to the definition of DFT, X(k) Replacing k by N~k, X(N-k) = (Nok) X(N-k) = x(n) WY wl Now we have, twiddle factor Wy j2n0 i = cos 2nn ~ j sin 20 Since n is an integer, cos 2.nn = 1 and sin 2 mn = 0 Na ws 1 N Thus Equation (11) becomes, N-1 7 X(N-k) = Dy x(n) Wy n=0 Comparing Equation (12) with definition of DFT ( Equation (10) ) we get, X(N-k) = X(-k) Now using Equation (10) we can write, N-1 x(k) = Y x(aywy n=0 kn (9) (10) (11) (13) 4) Case (ii) : When x(n) is real and even : ‘Statement : When x (n) is real and even which means, x(n) = x(N~=n) then DFT becomes, X(k) Xp (k) Proof : Since imaginary part is zero; putting x,(m) = in Equation (6) we get, N-1 onkn Rk) = qinvees( 25) n=0 Similarly IDFT can be written by putting X,(k) = 0 in Equation (8). -1 1 2mkn ) Rim = yD xq choo R n=0 Case (iii) : When x(n) is real and odd : ‘Statement : When x(n) is real and odd which means, x(n) = —x(N~n) then the DFT becomes, N-1 x(k) = “7D sgl sn( 25) n=0 Proof: Since x(n) is real, we will put x;(n) = 0 in Equation (5), Similarly x(n) is odd and N ‘i 5 2nkn 5: ‘cos’ is even function so we can write, cos{ 24" | = 0. Thus first summation in Equation (5) becomes zero. In the second summation of Equation ( , putting x,(n) = 0 we get, N-1 2mkn - (2 x(k) = -j > sa(orsi[ N } n=0 Similarly IDFT can be written as iy 2k . x(n) = iy E xq(4 sn a k=0 J Case (iv) :-When x(n) is purely imaginary sequence = When x(n) is purely imaginary which means Xp (n) = 0 and x(n) = jx,(n) then putting x(n) = 0 in Equation (6) we get, N-1 (28k Xk) = s(a)sn 25 | n=0 And putting x» (n) = 0 in Equation (7) we get, “I! srkn X(k)= > sven 25) n=0 Symmetry properties can be summarized as shown in Fig. F-10, | Signal xi] | | FT | Real | t + ! Real Imaginary | ‘ {imaginary Fig. F-10 : Summary of symmetry property This summary is shown in Table F-3. pee _ Z 1.3.5 Solved Problems using Properties of DFT : Prob. 1: The first five points of the 8 point DFT of a real valued sequence are {0.25, 0.125 ~ j0.3018, 0, 0.125 -j 0.0518, 0}. Determine the remaining three points. Soin. : Given DFT points are : X(0) = 0.25 X(1) = 0.125-j03018 X(2) = 0 X(3) = 0.125-j0.0518 X(4) = 0 Given sequence is a real valued sequence. According to the symmetry property we have, X"(k) = X(N-k) or X(k) = X"(N-k) (D) This is 8 point DFT. Thus N = 8 * X(k) = X"(8-k) 2) Now we want remaining three samples namely X(5) X(6) and X(7). Putting k = 5 in Equation (2), X(5) = X*(8-5)=X"(3) We have X(3) = 0.125-j0.0518 X"(3) = 0.125+j 0.0518 Putting k X(6) = X"(8-6)=x"(2) We have X(2) = 0, Thus X"(2)=0 6 in Equation (2), Similarly putting k = 7 in Equation (2) we get, X(7) = X*(8-7)=xX*(1) We have X(1) 0.125 —j 0.3018 Prob. 2: The first five DFT points of real and even sequence x(n) of length eight are given below. Find remaining three points. X(k) = {5, 1, 0, 2, 3, ..} Soln. : Given DFT points are: X(0) = 5,X(1)=1,X(2)=0,X(3)=2 and X(4)=3. According to symmetry property we have, X"(k) = X(N-k) X(k) = X*(N-k)/ ‘This is 8 point DFT. Thus N = 8 X(k) = X"(8-k) X(5) = X°(8-5)=X"(3) X(6) = X*(8-6)=X"(2) X(6)= X(7) = X*(8-7) =X) x(7) #1 | 1.3.6 Duality Property : DFT Statement: If x(n) <> X(k) N DFT then x(n) <> Nx[((-k))yJ N Proof : Consider a discrete time sequence x(n). Its periodic extension is denoted by x, (1). Now DET of x(n) is X (k) and the periodic extension of X (k) is denoted by X, (k). ‘That means, x(a) = x(n) yy a) and -X,(k) = X((K))y (2) ‘Thus we can write, DFT x,(n) Pre 3) Now we will define periodic sequence x, ,(n) = X,(n). One period of this sequence is @ finite duration sequence x, (n) = x(n) ‘The discrete fourier series coefficients of X p(k) = Nx, (-k). Xj p() ae denoted by X,p(k) and ‘Thus DFT of x, (n) which is denoted by X, (k) is, Nx (-k), 0SKkSN-1 Xi (k) = P 4) i(k) { elsewhere ® Equation (4) can also be written as, X,(k) = Nx[((-k))]y 0S kSN-1 (5) 0 elsewhere Now X, (k) is DFT of x, (n) and x, (n) is a finite duration sequence denoted by X (n). DFT se X(n) CO NXL((-k))y] N 1.3.7 Circular Convolution : Statement : The multiplication of two DFTs is equivalent to the circular convolution of their sequences in time domain. Mathematical equation : DFT DFT xj (m) <> X,(k) and x, (n) <> X, Ck) then, N N DFT x (M)@ %(m) > XK, (k)-X)(k) (a) Here@) indicates circular convolution. Let the result of circular convolution of x,(m) and x,(n) be y(m) then the circular convolution can also be expressed as, N yimy= > x(n) x, (in n=0 Here the term x, ((m~n) )y indicates the circular convolution, ny» m=0, 1, N- (2) Proof : Consider two discrete time sequences x,(n) and x,(n). The DFT of x(n) can be expressed as, Not 12a X(kK) = Yox(me Ny k=01..N-1 3) n=0 ‘To avoid the confusion we will write the DFT of X, (nm) using different index of summation. Nol =) 2nkl Xk) = SY x(me N” ,k=0,1,..N= Ad) I=0 Note that in Equation (4); instead of ‘n’ we have used ‘I’. Case We will denote the multiplication of two DFTs; X, (k) and X(k) by Y(k). Y¥(k) = X,(k)*X,(k) (8) Let IDFT of Y(k) be y(m). Then using definition of IDFT, , Nc! j2ekm y(m) = y D ¥(kye N 6) =0 Putting Equation (5) in Equation (6), ‘a 2nkm yom) = yD XC) x Cee 8 M k=0 Putting the values of X, (k) and X,(k) from Equations (3) and (4) in Equation (7) we get, Nol N-1 _ inka || N=1 _i2mkt | [2k yimy=y DL] Lame 8 Yume N le (8) k=0| 0=0 l= ‘Rearranging the summations and terms in Equation (8) we get, , Nol N-1 N=1 —jmg 22 jaan yim = y Yl Y x) Ye Noe é n=0 I=0 k=0 1? 1 N-1 N-1 amc( -1yN ym = ye DY xy YL HCO] LD a (9) n=0 1=0 k=0 Consider the last term of Equation (9); it can be written as, rk (m= n= ‘m-a- kK a rk ( LYN = [e™ ~~] : ao) Now use the standard summation formula, N-1 N fora=1 zx (LD) k=0 fora#1 (aza-b) Lethe, a=e 0" 8 (12) Now according to Equation (11) we will consider two cases : () : When a If (m~-n-J) is multiple of N which means, (m-n-1) = N,2N,3N,.... then Equation (12) becomes, +i Perkusees . fm) wal ‘Thus when (m—n—1) is multinle of N (that means a = 1) then according to Equation (11); i the third summation in Equation (9) becomes equal to N. Case (ii) : When a #1: If a ¥ 1 that means if m—n—[.is not multiple of N then according to Equation (11), N-1 N xe (13) k=0 Putting Equation (12) in Equation (13) we get, NaF sjarem-n- yk Lae ti2emrant) x iG ) = (14) k=0 I-e i +)2x(m=n-1) Here m,n and J are integers; thus © = 1 always, Thus RHS. of Equation (14) becomes zero when a # 1. So to get the result of Equation (11) we have to consider the condition a = 1. That means when m—n~1 is multiple of N, For this condition, we have the result of summation equals to N, Thus Equation (9) becomes, N-1 N-1 Lam Y yon y(m) y(m) = (15) M z M We have obtained Equation (15) for the condition; (m—n-1), is multiple of N. This condition can be expressed as, m-n ~pN (16) Here ‘p’ is an integer and an integer can be positive or negative. For the simplicity we have considered negative integer. Now from Equation (16) we get, 1 = m-nt+pN (17) Putting this value in Equation (15) we get, N-l y(m) = x, (n)-x,(m-n+pN) (18) n=0 Here we have not considered the second summation of Equation (15). Because this summation is in terms of ‘P and exponential term is absent in Equation (18). Now the term x,(m-n+ pN) indicates a periodic sequence with period N; this is because ‘p’ is an integer. This term also indicates that the periodic sequence is delayed by ‘n’ samples. We have studied that, if a sequence is periodic and delayed then it can be expressed as, x,(m-n+pN) = x, (m=), (19) we get, (20) shifted circularly; this type of convolution is called as CirculaConvolution. 1.3.8. Solved Problems on Circular Convolution : We can obtain the circular convolution of two sequences using two methods as follows : ‘A)_ Using Graphical Method B) Using Matrix Method. A) Circular convolution using Graphical Method : Prob. 1: Given the two sequence of length 4 are x(n) = (0,1, 2, 3} h(n) = (@4,1,2) Find the circular convolution. Soin. : According to the definition of circular convolution, N-1 yom) = Sx (n)-x,(m-a)y Al) n=0 Here given sequences are x(n) and h(n). The length of sequence is 4 that means N = Thus Equation (1) becomes, 3 y(m) = ¥ x(n)h((m-n)), (2) n=0 Step 1: Draw x (n) and h(n) as shown in Fig. F-11 (a) and (b). Note that x(n) and h(n) are plotted in anticlockwise direction. xt xQy=2 Fig, F-11 (a) : x(n) = {0, 1, 2, 3} betes! Fig. F-11 (b) : h(n) = {2, 1, 1, 2} Now we will calculate different values of y(m) by putting m = 0 to m = 3 in Equation (2). Step II : Calculation of y (0) : Putting m = 0 in Equation (2) we get, 3 y(0) = Y x(nph((-n),. +) n=0 Equation (3) shows that we have to obtain the product of x(n) and h((—n)), and then we have to take the summation of product elements. Using graphical method this calculation is done as follows. The sequence h((~n)), indicates circular folding of h(n). This sequence is obtained by plotting h(n) in a clockwise direction as shown in Fig. F-11(c). in i dee Lod i Fig. F-11(¢) : h(n) is plotted in clockwise direction To do the calculations; plot x(n) and h((—n)) on two concentric circles as shown in Fig. F-11@). x(n) is plotted on the inner circle and h ((—n)) is plotted on the outer circle. Now according to Equation (2); individual values of product x(n) and h((—n) are obtained by ‘multiplying two sequences point by point. Then y (0) is obtained by adding all product terms. y(O) = (Ox2)#(1x2)+(1x2)4+(3x1) 20424243 Fig. F-1@): YY) x(m)h((-n))q n=0 Step MMI : Calculation of y(1) : Putting m = 1 in Equation (2), 3 y) = & x(syh(i-ny, (4) n=0 Here h((1-n)), is sume as h((—n+1))q. This ro indicates delay of h((—n)) by 1 sample. This is obtained by shifting h(—n)) in anticlockwise ‘ direction by 1 sample, as shown in Fig. F-11(e). We have already drawn the sequence x(n) as shown in Fig. F-11(a). To do the calculations, according to Equation (4),- two sequences x(n) and h((1=n)), are plotted on two concentric circles as shown in Fig. F-11(. y(1) is obtained by adding the product of individual terms. Fig. F-11(e) : h((-n+1))4. y(1) = (Ox1)#(3x1)+(2x2)+(1x2) 0434442 (3) 3 Fig. Fl): y(1)= >) x(n)h(1-n)), n=0 Step IV : Calculation of y(2) : Putting m = 2 in Equation (2) we get, 3 y(2) = x(m)h(2-ny, 3) a=0 New starting position Fig. rh((-n+2))y Here h ((2-n)), is same as h((-n+2))q It indicates delay of h(n), by 2 samples, It is obtained by shifting h ((—1n )), by two samples in anticlockwise direction as shown in Fig. F-11(g). According to Equation (4) the value of y (2) is obtain by adding individual product terms as shown in Fig. F-11(h). Fig. F-1h) : y(2)= Y) x(m)h((2-n)), n=0 y(2) = (Ox1)#(3x2)4(2x2)+(1x1) = 0464441 Step V : Caleulation of y (3) : Putting m = 3 in Equation (2) we get, he)=4 Ea 3 i { yee D x(n)h((3=n)), (6) n=0 Here h((3-n)), is same as h((-n+3)),. It indicates delay of h ((—n)), by 3 samples. It is obtained by shifting h((-n), by 3 samples in anticlockwise New starting direction as shown in Fig. F-11(j). ‘position Fig. FAG) : h((-n+3))y According to Equation (5), y (3) is obtained by adding individual product terms as shown in Fig. F-11(). = ¥(3) = (0%2)+(3x2)+(2*1)4+(1X1) 50464241 Fig. F-1@:y(3)= D x(n)h(3-n)), n=0 Now the resultant sequence y (m) can be written as, y(m) {y(0).yC).¥(2),¥(3)} y(m)= (7,911, Using graphical method, obtain a 5-point circular convolution of two DT signals defined 15)", an-3, osns2 o y(2)=4-3=1 = y(3)=6-3=3 y(n) = {-3,-1,1,3} wn(2) It is asked to calculate 5-point DFT. That means Iength of each sequence should be 5. This length is adjusted by adding zeros at the end of each sequence as follows (zero padding) : x(n) = (1, 15, 225, 0,0} GB) and y(n) = {-3,-1, 1, 3/0). 4) Now according to the definition of circular convolution we have, N-1 y(m) = DY x, (n)x,(m-n)y a) n=0 Here the given sequences are x(n) and y(n) and length N = 5. 4 y(m) = Y x(n)y((m-n)), (6) n=0 Step I: Draw x(n) and y(n) as shown in Fig. F-12(a) and (b) respectively. Here x(n) and y(n) are plotted in anticlockwise direction. (@) x(n) = (1,15, 225, 0, 0) Now we will obtain values of y(m) by putting m = 0 to m = 4 in Equation (6). Step II : Calculation of y (0 4 Putting m = 0 in Equation (6) we get, y(0) =D) x(n)y((-n))5 7) n=0 Here y((—n)) indicates circular ‘folding of y(n). It is obtained by plotting y(m) in clockwise direction as shown in Fig. F-12(c). Starting CT position Fig, F-12() : y(-n)) According to Equation (7), y(0) is obtained ‘by adding all product terms as shown in Fig. F-12(d). Here x(n) and y ((~1)), is drawn on two concentric circles. Fig. F-12(@) : y(0)= Y) x(m)y(-n)) n=0 [1x(-3)]+[0x(-3)]+[0x1]+[2.25x3]+[15x0] 34+04+04+6.75+0 y(0) Step III : Putting m = 1 in Equation (6), 4 ya) = Y x(a)y(i-n), — B) n=0 Here y ((1~n)), indicates delay of y ((~n)) by 1 sample. It is obtained by shifting y((—n)) by 1 sample in anticlockwise direction as shown in Fig. F-12(e). Fig. F-12(¢) : y((1-n))g According to Equation (8), value of y( 1) is obtained a show Fig. P12): y(1)= Y x(m)y(1-m))s n=0 y(1) = [1x (+1) 1+ [0x1] +(0%31+[0% 2.25 ]+[15x(-3)] =-1404040-45 Step IV : Putting m = 2 in Equation (6), 4 y(2) = ¥ x(m)y(Q-ny, n=0 Here y((2-n)), is delay of y((—n)), by 2 samples. It is obtained by shifting y((—n)), by 2 samples in anticlockwise direction as shown in Fig. F-12(g). Fig. F-12(g) : y(2-n))s y (2) is obtained by adding all product terms as shown in Fig, F-12(h), Fig. F-12(h) : y(2) = YY x(n)y(2-n))s. n=0 y(2)=[1x1]+[0%3]+[0x0]+[2.25x(-3)]+[15x(~1)] = 14+0+0-6.75-15 Step V : Calculation of y(3) : Putting m = 3 in Equation (6) we get, 4 y(3) = D x(n)y@3-n), 10) n=0 Here y((3—n))s is delay of y((—n))s by 3 samples. It is obtained by. shifting y((-n)), by 3 samples in anticlockwise direction as shown in Fig. F-12(i). fay 0 Fig. F-12@) : y((3-))s y (3) is obtained by adding all product terms as shown in Fig. F-12(). Fig. F-12@):¥(3)= x(m)y(3-m))s n=0 y(3) = [1x3] +[0x0]+[0x(-3)]+[2.25x(-1)]+[ 151] = 3404+0-2.25+15 Step VI : Calculation of y(4) + Putting m = 4 in Equation (6) we get, 4 y(4) = DY x(n)y (4-0); wD) n=0 Here y((4—n)), is delay of y((—n)), by 4 samples. It is obtained by shifting y((~n))s by 4 samples in anticlockwise direction as shown in Fig. F-12(k). y(4) is obtained as shown in Fig. F-12() Fig. F120 :y(4)= YD x(m)y(4-n)g n=0 y(4) = [1x0] +L0x(—3)]+10x(—1)] 42.25% 1]4115%3] = 040404225445 “ Now the result of circular convolution can be expressed as, y(m) = {y(0),y(1),¥@),¥(3),¥(4)} y(m) = {3.75,-5.5, 7.25, 2.25, 6.75} wa(12) A) Comparison with linear convolution : We will obtain linear convolution of two sequences using tabular method. We have, x(n) = {1, 1.5, 2.25} = (1, 15, 2.25, 0} {-3,-1, 1, 3) x(n)*y(n) and y(n) Let y,(n) ‘The linear convolution of x(n) and y (n) is shown in Fig. F-12(m). Ss £ s Sf sy s 17) 15 @' 225 20 Fig, F-12(m) : x(n) * y(n) From Fig. F-12(m), y,(0) = -3 y,(1) = -1-45=-55 y,(2) = 1-15-6795 =-7.25 y,(3) = 3415-225 = 2.25 y,(4) = 454225 = 675 y, (5) = 6.75 +0= 6.5 y,(6) = 0 Thos x(n)*y(n) = 17 5.5,-7.25 2.25, 6.75 6.15.0} (13) Equations (12) and (13) show that circular convolution and linear convolution are not same. B) Circular convolution using matrix method : The graphical method which we have studied is tedious, especially when many samples are resent. While the matrix method is more convenient. In the matrix method, one sequence is repeated via circular shifting of samples. It is represented as follows : we have y(m)=x(n)@ h(n) =h(n)@ Nx(n) y(0) h(O) = -hCN~1) h(N-2)... (2) (1) x(0) y(Q1) h(1) h(O) R(N=1)-.. (3) (2) x(1) y(2) h(2) h(1) h(O) ... h(4y (3) x(2) y(N-2) h(N-2) h(N-3) h(N-4) °° h(O) h(N~1)]| x(N-2) y(N-1) h(N-1) h(N-2) h(N-3)--* b(1) h(O) x(N-1) Prob. 3: Determine the sequence y(n) = x(n) @hiny where = x(n) = (1,2, 3, 1} t and h(n) = (4,3, 2, 2} t Sola. : Wehave, — y(m) = x(n) @x,(n)=h(n) @ x(n) Using matrix method, Here x(0)=1, x(1)=2, x(3)=3, x(3)=1 and h(O) h(1)=3, h(3)=2 Here N= Jn the matrix form we have Cy y(0) ‘h(O) 1 bC) x(0) yo ha) | he) x) y2 | | m2 ) xQ) y(3) (3) -* (2) =” hC) -* (Oy | x(3) y(0) 422 37f1 yC)}_ |3 4 2 2//2 y(2)|~ ]2.3 4 24/3 y(3) 223 4][1 y(0) (4x1) +(2%2)+(2x3)4(3K1)] fF 4444643 y() (3x1) +(4x2)+(2x3)+(2%1) | | 3484642 y(2) (2x1) #(3x2)+(4x3)4(2x1) | | 24641242 y(3) (2x1) +(2%2)+(3x3)4(4x1)] | 2444944 y(0) 7 yC)]} _ | 19 y(2)| > | 22 y(3) 19 y(m) = x(n)@ h(n) = (17, 19, 22, 19} Prob. 4: Use the four point DFT and IDFT to determine the circular convolution of sequences x(n) = (1,2, 3, 1) t x(n) = (4, 8, 2, 2) T Soin. : The four point DFT of x(n) is X, (k) and it is given by, XK) = (Wy 1 py, toroid =f} ict Wehave, [Wy] =|) 2] yy Pojpl i X,(k) = X)(k) = X,(k) = Similarly, X,(k) = «ty roto 1 iqpa efi -i-t ij]}3 BU) =) Pa na l]2 1 j -1 ~j}l2 4434242 ul = | 4-31-24) |_| 2-5 00 = 349-2 |=] a 4433-2-35 | | 24) X,(k) = {11,2-j,1,24j} Now according to property of circular convolution, x,(1) @ x(n) = X,(k)-X, (k) =X, (k) X,(k) = {7,-2-j,1,-24j}-(11,+2-j,1,24) X,(k) = [77,~5,1,-5} Let the result of x(n) @x,(n) be sequence x, (n). It is obtained by computing IDFT of X; (k). According to the definition of IDFT we have, Loge Gin) = BOW Ky Lee y(n) = GLW)I X yy 1 1 1 1 77) _aija 4j -1 -j||-s SO = ahi pr al] a 1 -j -1 +j]h-s T-S5+1-5 68 17 x(n) = 4] 77-Si-1+5)|_1/ 76 |_| 19 3 © 4! 77454145 | 4} 88] >| 22 771+ 5j- 1-3} 76 19 Considering real part only, approximately sequence x(n) can be written as, we Prob. 5 : Solin. : Forn=0 > vote For n=1 Forn=2 For n=3 Forn=4 Forn=5 For n=6 Forn=7 = x, 2 ‘Thus sequence x, (n) Now we have, y(0) yQ) y(2) y(3) y(4) y(5) y(6) y¥(7) yin) = y(m) = x(n) Ox () is, cocoon ee = x,(7) = sin {0, 0.92, 0.707, ~ 0.38, coor eens cone HHoo 3x0 on HHHcoo 0 0 0 0 1 1 1 1 Men coooe Ha coooHe HoocooHee Compute the 8-point circular convolution for following sequences x(n) = {1,.1, 1, 1, 0, 0, 0, OF (nm) = on( 5") osns7 First we will obtain sequence x, (1) by putting values of n from n= 0 to n = 7. pe — 0.38, 0.707, 0.92} yj y(0) 0+0+0+0+0-0.38 +0.707 +0.92 1.247 y(1) 0+0.92+0+0+0+0+0.707 +092 2.547 y(2) 0+0.92 +0.707+0+0+0+0+0.92 2.547 y¥@3) 0+0.92 + 0.707 -0.38+0+0+0+0 1.247 yay] 0+0,92+0.707-0.38-1+0+0+0 ° 0.247 y(3) 0+0+0.707 - 0.38-1-0.38+0+0 = 1.053 y (6) 0+0+0-0.38 - 1 - 0.38 + 0.707 +0 — 1,053 y(7) 0+0+0+0-1-0.38 +0.707+0.92 0.247 y(m) = (1.247, 2.547, 2.547, 1.247, 0.247, ~ 1.053, ~ 1.053, 0.247) tT Prob. 6 : Compute the circular convolution of following sequences and compare the results with linear convolution. x(n) = (A -1) and h(n) {0, 1, 2, 3, 4, 3, 2, 1} Soin. : We have, y(m) = x(n) @ h(n) y(0) To-1 -1 0 -10 =1 1 1 1 0 yQ) 1 Vol 10-10 =1 1 1 1 y(2) 1 1 Posto -to =r =1 1 2 y(Q3)} 11 ot Poon) = -1 = 3 y(4)| = -1 1 1 1 1-1 =) o-1 4 y(5) -1 -1 1 1 1 Tost -1 3 y¥(6) -lo-10-1 1 1 1 1oo-a 2 ¥(7) -1o-10 -1 0-1 1 1 14 1 y(0) yd) y(2) y(3) y(4) y(5) y(6) yQ) y(m) = x(n) @ h(n) = (-4, Now we will obtain linear convolution of given sequences as shown in Fig. F-13, y(n) = y(n) = (0, 1, 3, 6, 10, 11, 9, 4, 0-1-2-3-443+241 041-2-3-4-34241 04142-3-4-3-241 0+1+24+3-4-3-2-1 O+14+24344-3-2-1 0-14+2434443-2-1 O-1-243444342-1 0-1-2-344434241 t Fig. FAS: x(n) #h(n) x(n) *h(n) - 11, -10, -6, Al) (2) From Equations (1) and (2) we can conclude that the results of circular convolution and linear convolution are not same. po Important note : Why the result of circular and linear convolution is not same 7 Basically circular convolution, y(m) contains same number of samples as that of x(n) and h(n). In the previous example x(n) and h(n) have 8 samples. The circular convolution is given by Equation (1). It also contains 8 samples. In the previous example; the linear circular is given by Equation (2). Here the number of samples are 15. We will use the following notations to indicates numbers of samples. L = Number of samples in x(n) M = Number of samples in h(n) N = Number of samples in the result of linear convolution. ‘Thus for the linear convolution we can write the equation, [i Limi Here L = M=8=>N=15 ‘That’s why the result of linear and circular convolution are not same. 3) How to obtain same result from linear and circular convolution ? ‘To obtain the same result from both convolutions the following steps are used (1) Using Equation (3), calculate the value of *N’; that means number of samples contained in linear convolution. Let us say it is 15. (2) By doing zero padding make the length of every sequence equal to 15. That means in this case we need to add seven zeros in x(n) as well as h (1). (3) Perform the circular convolution. The result of circular convolution and linear convolution will be same. Prob. 7: Compute the circular convolution of the following sequences and compare the results with linear convolution. x(n) h(n) {1, 05, 1, 0.5, 1, 0.5, 1, 0.5} = (0,12, 3} Soln. : In case of circular convolution the length of x(n) and h( 1) should be same. Thus we have to add four zeros in h(n) to make its length equal to 8. h(n) = {0, 1, 2,3, 0,0, 0, 0} Now circular convolution of x(n) and h(n) is given by, y(m) = x(n) @ h(n) 1 05 1 05 1 05 1 OS 0 05 1 05 1 05 1 05 1 1 1 05 1 05 1 05 1 0S 2 _ o5 1 05 1 05 1 05 1 3 = 1 05 1 05 1 05 1 OS 0 05 1 05 1 05 1 05 1 0 1 05 1 05 1 05 1 OS 0 oS 1 05 1 05 1 «O05 1 0 y(0) 0+054+2415+0+0+0+0 4 ya) O+14+14+34+04+0+0+0 5 y(2) 04+0.5424+15+04+04+040 4 y(3) O+1414340+040+40 5 y(4) 0+05+241540+0+0+0 4 y(5) 0+14+24+3+0+0+040 3 y(6) 040542+15+0+0+0+0| | 4 y¥(7) [ O+14143+0+40+4040 4, SY yim) = (4,5,4,5,4, Comparison with linear convolution : x(n) has 8 samples and h(n) has 4 samples. So linear convolution will have 8+4—1 = 11 samples. Thus result of linear and circular convolution will not be same, We can verify this by obtaining linear convolution of x(n) and h(n), Prob. 8 : Find the linear convolution of x, (n) and x, (1) x(n) = (1, 2,3, d}and x(n) = (1, 4, 1 tT t Obtain the same result using circular convolution. Soin. : First we will obtain linear convolution. Here x,(n) = (1,2, 3,4) t and x,(n) = (1,1, 1) = {1, 1, 1, 0) tT Using tabular method, linear convolution is obtained as shown in Fig. F-14. 4 oe —___ 4 Fig. Fl : y(n) = x, (m) #x)(n) y(n) = x,(n)#x,(n) = (1, 3, 6 9, 7,4, 0} a) | Now we will obtain the same result using circular convolution. Here the length of linear I convolution: = 7. We have to make the number of samples in x(n) and h(n) equal to 7. But this length is preferred to be in\terms of powers of 2. So we will make length of x(n) and h(n) equal to 8 by doing zero padding, x, (n) = (1, 2,3, 4, 0, 0, 0, 0} and x,(n) = {1, 1, 1, 0, 0, 0, 0, 0} 1 % 1 00004 3 2 1 2 10000 4 3 1 3.210000 4 1 . 4 3.2 1000.0 0 - 0 4321000 0 | 0 0432100 0 ! o 0043210 0 0 ooo04 3 2 1 0 i y(0) 14+0+0+0+0+0+0+0 1 y() 24+1+0404+0+0+0+0 3 y(2) 3424+140+040+0+0 6 y(3) 44+34+2+0+0+0+0+0 9 y(4) 0+44+3+04+0+0+0+0 7 y(5) 0+0+4+0+0+0+0+0 4 y(6) 0+0+0+0+0+0+0+0 0 y(7) 0+0+0+0+0+0+0+0 0 + y(m) = {1,3,6,9,7,4,0, 0) 2) Equations (1) and (2) are same, so the result of linear and circular convolution is same. Prob. 9: Obtain the linear convolution of two sequences defined as, x(M) = u(n)-u(n-3) h(n) = u(n-1)+u(n-2)~u(n=4)-u(n-5) using circular convolution. Soln. : First we will obtain the sequences x(n) and h(n). ‘We have, x(n) = u(n)-u(n-3) oD) ‘This sequence is obtained as shown in Fig. F-15(a). 4 Fig. F-15(a) x(n) = u(n)—u(n—3) x(n) = (L141) 2) tT Now h(n) = a(n-1)+u(n-2)-u(n~4)-u(n=S) ~@) This operation is performed as shown in Fig. F-15(b). bony = (91,221 A) Here x(m) bas 3 samples and h(n) has 5 samples. So linear convolution will give (3+5)-1 = 7 samples. To obtain the same result using circular convolution we need to make ength of x(n) and h(n) equals to 7. But we want this length (value of N) in power of 2. So we will make length of x(n) and h(n).equals to 8 by zero padding. x(n) = {1, 1, 1,0,0,0,0,0) 5) tT and h(n) = (0, 1,2, 2, 1,0, 0, 0} (6) Now we will perform circular convolution as follows. y(m) = x(n)@ h(n) y(0) 10000011 0 yQ) 11000001 1 yQ) 11100000 2 ren . ot110000 2 y(5) oo 111000 1 y(6) 00011100 0 yQ) oooo01110 | 0 ooo0o0011 1 0 0+0+0+04+0+040+40 0 0+14+0+04+0+0+040 1 O+14+2+0+0+0+040 3 O+1424240404040 5 0+0+2+24140+040 5 0+0+0+241+040+0 3 04+040+0+1+0+0+40 1 040+0+0+0+0+0+40 0 “= y(m) x(n)*h(n) = x(n) @ h(n) = (0, 1,3,5,5,3, 1,0) t hence linear convolution is obtained using circular convolution. Prob. 10: Using circular convolution, find output of system if input x(n) and impulse response h(n) Is given by, x(n) = 2u(n)-u(n-2)-u(n-4) h(n) =35(n)-28(n-1)+8(n-2). Son. : First we will plot sequence x(n) and h(n) as shown in Figs. F-16(a) and F-16(b). Multiply by 2 Delay by 2 Fig. F-16(a) x(n) = {2,2,1, 1} t Mutiny by 3 Delay by 1 and Mutiply by 2: Delay by 1 and Multiply by Fig. F-16(b) h(n) = 3,-2.1) Now output of system is, y(n) = x(n)*h(n) ‘Thus we have to perform linear convolution using circular convolution. Here x(n) has 4 samples and h(n) has 3 samples. Thus result of linear convolution will contain 4+3-1 = 6 samples. This value should be in terms of powers of 2, So to obtain same result using circular convolution we will make length of x(n) and h(n), equal to 8. x(n) = (2,21, 1,0, 0,0, 0} and h(n) = (3,2, 1,0, 0,0, 0, 0} Now we will perform circular convolution as follows : -y(m) = x(n) @n(ny y(0) 2000011 27f 3 y(1) 2200001 1//-2 y(2) 12200001 1 y(3)}_ [1122000 0]] 0 y(4)}~]01122000]] 0 y(5) 00112200]/ 0 y(6) 0001122 0{! 0 y(7) 0000112 2i/ 0 6+04+0+04+0+040+40 6 6-440+040+04040 2 3-442+040+04040 1 = | 3-2+24+0+040+0+0]_] 3 © | 0=2414+0+04+0+0+0] > | -1 0+041+04+0+0+0+0 1 0+040+0+040+040 0 04+04+0+0+0+04040 ° Thus output of system is, 1.3.9 Time Reversal of Sequence : DFT Statement : If x(n) <> X(k) N DFT then x(n), = x(N=n) <> X((-k))y = X(N-k) N Proof : According to the definition of DFT, N-1 ~j 2nkw/N DFT (x(n)} = x(n? n=0 Ni! ~j 2m N DFT (x(N=n)) = JY) x(N=-nje” n=0 put 7 = N~n, the limits will change as follows when n= 0 =31=N-0 and whenn=N-1 => 1=N-N+1 a) 2) ‘Thus Equation (2) becomes, 1 DFT {x(N-n)} = ¥ x(/) I=N Here x ((~1))y indicates circularly folded sequence. It can also be represented as x (Nn). ‘That means the sequence x(N—n) is circular in nature and we know that the DFT is periodic. =j2nk (N-1)/N eDRKON=Dy 8) As given by Equation (2); the original limits of summation are from n = 0 to N~1. That means here summation is calculated for the period ‘N’. Since the DFT is periodic in nature; if we calculate the DFT for next period then the result remains same. Now the next period is, n = 0 +N ton =N~—1+N, That means n = N to 2N~1, But the sequence is circular; so this period is same as n= N to n= 1. Thus even if we change the index; the limits of summation will remain same. Basic limits of DFT are 0 to N—1 as per Equation (2). N-1 DFT {x(N-n)} = YD x(tye RON -DN 10 N-1 = OY xe 2 eMnN wld) I=0 Now we have, ~jonk : e = cos 2nk — j sin 2k Since k is an integer, cos 2xk = 1 and sin 2nk = 0 ~j2mk ey S) Putting this value in Equation (4), N-1 DFT (x(N=n)} = Y x(t) a) 1=0 Similar to Equation (5) we can write, ~jant ai2nN em a Le N=] mo) We can multiply R.H.S. of Equation (6) by Equation (7); since its value is 1. N-1 IN pet {x(N-n)} = x(ye A. N Is0 N-1 e DET{x(N-n)} = Y x(1) MN (8) 1=0 Now according to the definition of DFT; R.H.S. of Equation (8) is X(N-k) * DFT {x(N-n)} = X(N-k)=X((-k)y, arly folded; its DFT is also-circula 1.3.10 Circular Time Shift of Sequence : DFT Statement : If x(n) <-> X(k) then, N DFT —j anki” x((n=Dy > X (ke N Fr of x(n-Dy > X(k) We N N Proof : According to the definition of IDFT, Nol x(n) = wrT{X(k)} =p zy x(k) WL (1) k=0 wy NC ts who kt werr{xdywe] = 5D xa wwe k=0 wy a Nct k(n-1) wer { x(k) Wy} =F L xGow (2) k=0 DFT Now we have, x(n) > X(k) 3) N Comparing R.H.S. of Equations (1) and (2) we can write, DFT 7 x(n-1) @> X(k) Wwe N N ‘The sequence is circular and DFT is periodic in nature so we can write, DFT x((n-D)y <> X(k) We (a) N N Hence the proof. 1.311 Circular Frequency Shift : This property is also called as Quadrature Modulation Theorem. DFT Statement = If x(n) ¢— X(k) then, N DFT Ww x(nyo WS C, X(k-I)y =X (+) N I OR x(n)e~ > X((kENy = X(k-1) Multiplication of sequence x(n) by 6!” is equivalent to the: jn time domain by ‘? samples. 1.3.12 Solved Examples using Circular Properties of DFT Prob. 1: A four point sequence x(n) = (1, 2, 3, 4} has DFT X(k), Os k < 3, without performing DFT or IDFT. Find the signal values which has DFT X(k~ 1), Soin. : According to the circular frequency shifting property, DFT 3 X((k+ Dy = X(K=1) N Here [= 1. Let the signal whose DFT is X(k~1) be denoted by x, (n). x(n)-e P/N x(n) = x(nye rr he/t Since N = 4 in this case. The given sequence is x(n) = (1,2, 3,4) x(0) = 1, x(1) We will find the sequence x, (1) as follows : x(2)=3 and x(3)=4 For n= 0 = x,(0)=x(0)-e?=1 we ie nom For n= 1 => x,(1)=x(l)e * =2e af ex g-saing] 2 (1) =-3j ie For n= 2 = x,(2)=x(2)e 4 =3e "=3fcosm-jsinx] x, (2) For n= 3 = x,(3)=x(3)e XG Prob. 2: Consider a real finite length sequence, x(n) = (4,3, 2, 1, 0,0, 1, 1} (i) y(n) is @ sequence related to x(n) such that, Yk) = Wax (k) where X(k) is 8 point DFT of x(n). Obtain y(n). (i) Also obtain finite iength sequence q(n) related to x(n) Such that its 8 point OFT is Q(k) = R,(X(k) |. Soin. : @ Given Y(k) = WiX(k) wl) According to circular time shifting property, DFT u x((n= Dy > XK) W, 0) N N Here N= 8 and [=4 ‘Thus comparing Equations (1) and (2). y(n) = x((n-4))g ‘That means y(n) represents circular delay of sequence x(n) by.4 samples. It is represented Delay by 4, — ) ot Start postion of yn) Gi) Given, Q(k) = R,{X(k)} (3) Let X(k) = M(k)+jN(k) (4) ‘Thus M (k) represents real part of X (k). Now X°(k) = M(k)-jN(k) Adding Equations (4) and (5), X(k)+X"(k) = 2M(k) — X(k)+X*(k) M(k) = 2 Taking IDFT of both sides, m(n) = x(a) +x (=n) DFT As x*(-n) ©>X*(k) N We have, x(n) = (43,2, 1, 0,0, 1, 1} x(n) = (43,210,011) X* (~n) represents circular folding of x*(n). It is shown in Fig. F-17(b). Fig. F-17(b) xi(-n) = (4,1, 1,0,0,1, 2,3} Putting Equations (8) and (9) in Equation (7) we can find sequence m(n) as follows : For n= 0 = m(o)=2U0D#x (0) da For n= 1 > m(1)= 2 XC) +x" (1) _ 341 se) 22 m(2)= 82148 (2) 241 3 (6) 1) (8) (9) For For For 1.3.13 Multiplication of Two Sequences : Statement n= 3 > m(3y= 243). n= 4 > m(4y= See). n= 5 = m(5)= 254") _ n= 6 => m(6)=2{O)** (6) _ 2 2 2 2 pa DFT DFT If x, (n) <> X; (k) and x, (n) <> X, (k) then, N N DFT , : x, ()-x, (0) WN X, x) © x, (ky 1.3.14 Statement : ication of two sequences in time domain is equivalei the frequency domain. Circular Correlation : DFT DFT If x(n) <> X(k) and y(n) @—» ¥ (kc) then, N N DFT ny (D> Ry(k) =X (k) Y"(k) ny By 1.3.15 Complex Conjugate Property : DFT Statement: If x(n) ©» X(k) then N DFT x'(n) > X*((-k)y =X" (N-K) N 1.3.16 — Parseval’s Theorem : DFT DET It states that, If x(n) @- X(k) and y(n) > ¥(k) N N N-1 Not then YY x(m)y"(n) = VY XC) n=0 k=0 1.3.17 Solved Problems on Circular Correlation Prob. 1: DFT of a sequence x(n) is given by X(k) ={4,1+2),),1-3)} Using DFT property only find DFT of x* (n) if x" (n) is complex conjugate of x(n). Soln. : According to complex conjugate property, DET If x(n) X(k) then N DFT x(n) > X(-k), N Wy We have, X(k) = {4,1+2j,j,1-3)} x(k) = {4,1-2),-j,143)) But DFT of x(n) is X"(—k)y Here X*(—k), indicates circular folding of X*(k). That means sequence X*(—k)y. is obtained by plotting the samples of X* (k) in clockwise direction. This is the DFT of x" (n). | | { Prob. 2: DFT of a sequence x(n) is given by, +X (k) = (6, 0, ~2, 0} () Determine x(n) (i) Plot x, (1m) if X,(k) Is X(k)-@ 1? (ii) Determine circular autocorrelation of x(n) using DFT and IDFT only, Soin. : (According to the definition of IDFT x(n) = ' 1 Ms i Here (WJ = 7 i 1 1 1 1 6 - 4/1 i -1 -i|| 0 x(m) = 4h -1 1-4 |] 2 1 -j -1 jfl 0 6+0-240 4] fi x(ny = 2/6+04240]_ 1} 8|_/2 ” ~ 41 6+0-2+0 4\4 1 6+04240 8) 2 Gi Given X,(k) = X(k)eU™¥? According to circular time shift property, DFT ~jaen K((n=1))y 9 X (ke ES a N Given term can be expressed as, jak 2 x(kye V7 = x(kye 4 2) Comparing Equations (1) and (2), DFT —idmk-2 x((n-2))y E> X(k)=X(k)e 4 N That means x,(n) = x((n—2))y Here x((n-2))y indicates circular delay of x(n) by 2 samples. It is plotted as shown in Fig. F-18. Circular delay by 2 ‘ x = Fig. F-18 Gii) According to circular correlation property we have DFT 11) > = Ry (k) = X(k)-X*(k) N We have = X(k) = {6,0,-2, 0) X"(k) is complex conjugate of X (k) x(k) = {6, 0, ~2, 0} X(k)-X"(k) = (36,0, 4, 0} Now r,, (1) is obtained by taking IDFT of X (k)-X"(k). ng (L) = FEWIT-X (k)-X" Ce) 1 1 1 17736 =4! ij -1 -j]fo te = ght i 1 F M—1 be t x,(0) > [xL— M1) x2 — 1) Bock 2-9 Maa volo) of 30-4 LT) Outpt on)» T Books Mat ie Output of x(n) + [Biggard! Block 2 output yal) MAT H Output of x3(n) —» [Biscara) Block 3 output yan) OMe Final output y(n) > [Blookt output, y,(n) | Block 2 output, yp{a) Block 3 output yan) Fig. F-21 : Overlap save method Observe each input block x, (1), x(n) .... Here each input block consists of initial ‘M— 1" samples taken from the previous block. That means there is overlap of sequences. While the last ‘L’ samples of each block are the actual input samples. Now because of the circular shift of DFT and because of the overlapping of input data blocks; there is aliasing in the initial ‘M—1" samples in the corresponding output block. To avoid this; first ‘M- 1° samples of Ym (0) are discarded. That means after computing time domain sequences; initial ‘M-1" samples are discarded. Then each block is fitted one after other {0 obtain the final output. The overlap save method is described as shown in Fig. F-21. . 2. — Overlap add method : Each input data block is In the overlap add method; the size of each input data block is ‘ zeros at the end of each formed by taking ‘L’ samples from the input sequence and adding ‘M— input sequence. Xy(0) = (200), oeenX(L= 1), 0, Oven) Al) Qe) First L samples of input (M ~ 1) zeros sequence x(n) samples from long input sequence x(n) and padding X,(n) is formed by taking next 1 “M—1" zeros at the end. 2 Xo(n) = (x(L), x(L + 2) nn X(2L= 1), 0, 0.0.1.0} (2) Lov O} Next L samples of input (M'— 1) zeros sequence x(n) Similarly, =X) = (XQL), OL + DooX BL =D, 0, O....0} --) — a ee Next L samples of input (M-~ 1) zeros sequence x(n) Impulse response of the filter is h(n) and its length is M. This length should be again made equal to N.'So L~ 1 zeros are added to form the sequence h(n ). h(n) = (NO), HD)ene(M= 1), 0, eon) (a) ee IED Oven} M samples of impulse (L- 1) zeros sequence to make total length = N Now the DFT of each input data block is computed separately. Similarly the DFT of h(n) is computed that is, H(k). Now the output of m block is obtained by multiplying DFT of m" input block by H(k). Y,,(k) = H(k)-X, Ck) (5) The time domain sequence Y,,(n) is obtained by taking IDFT of Y,,(k). Here we are performing ‘N’ point DFT; so the length of each output block is ‘N’. The different output sequences are as follows : y(n) = [¥,(0),¥ my (L=1) yy (Ly, (Lt 1) my, (L+M=1)] ¥p(M) = {y¥9(0)s¥9 (1) oY (L= 1) 99 (L) + ¥q(L#1) mY (L4M—1)} Similarly all output sequences are obtained. Input sequence, x(n) segmented into blocks of L samples. ot -——, M4 zeros, 9] <— Output of x(n) Fig. F-22 : Overlap add method In this method, each input sequence is padded with ‘M-1° zeros at the end to make the length N = L+M-~1. So last M1" samples of each output block must be overlapped and added to the first M-1 samples of succeeding block as shown in Fig. F-22. That is why this method is called as overlap add method. Here ‘M~1" samples are not discarded because there is no aliasing effect. 1.5 Frequency Analysis of jnals using DFT : ‘The frequency analysis is also called as spectrum analysis. To do the frequency analysis; time domain signal should be first converted into the frequency domain. If input signal is analog then first it is passed through the antialiasing filter. Then this signal is sampled at the rate F.; where F, is the sampling frequency. To avoid the aliasing, F, should be ‘greater than or equals to 2W. Here W is the maximum frequency of input signal. Tn practical cases; the time interval of signal is maintained at Ty and Ty = LT. Here L = number of samples and T is the sampling interval ‘Suppose we want to analyze the long input sequence x(n). Now to limit the time interval of sequence means this input sequence is multiplied by a rectangular window. A rectangular window is ‘denoted by Wa (n) and it is defined as, . 1 ,0smsL-1 Wp (nm) = {6 ‘otherwise Al) This rectangular window is shown in Fig. F-23. Since output of Wa(n) is zero after the interval L~1; multiplying x(n) by Wa (mn) produces signal £(n) only in the range 0 to L-1 Fig. F-23 : Rectangular window R(n) = x(n) Wa (a) ~) Then by taking DFT of Equation (2) we get, L-1 rs ~j 2k X(k) = ZY [x(n Wy (n) Je | 3) n=0 Here we are considering only ‘L’ samples of input signal and mot the complete input signal. ‘The spectrum will be more accurate if the value of “L’ is large. Spectral Leakage : Magnitude aaeane Fig. F-24 : Magnitude spectrum ‘As shown in Fig. F-24; the magnitude spectrum is not localized to a single frequency, but it is spreadout over the entire frequency range. That means the power of a signal is spreadout in entire frequency range. This leakage of the power is called as spectral leakage which is taking place because of ‘windowing’ of input sequence. ' Advantages and limitations of spectrum analysis using DFT : Advantages : (1). Fast processing of DFT can be done using FFT algorithms. (2) _ Estimation of power spectrum can be done. (3) Calculation of harmonies can also be done. (4) The resolution can be improved by increasing number of samples in the calculation of DFT. Limitations : (1) The frequency spectrum of entire input signal is not obtained because of windowing. (2) The leakage of power (spectral leakage) takes place. 3) If we increase number of samples to obtain the better accuracy then, the processing time is increased. 1.6 Relationship between: DFT and Z-Transform : ‘The Z-transform of sequence x(n) is, . X(Z) y x(yz" (1) ‘We know that at Z = e!®, X(Z) " x(n)e (2) Tt means that X(Z) is evaluated on unit circle. Now suppose X(Z) is sampled at ‘N’ equally spaced points on the unit circle. Then we have 2nK o=A5 @) Now if X(Z) is evaluated at Z = e!*/N then by putting Equation (3) in Equation (2) we get, X(Z) = (nye i?®KIN tz 2 PRIN 4) In Equation (4), if x(m) is causal sequence and has ‘N’ number of samples then we can write Equation (4) as, N-1 X(Z) =D x(mpe FPN ge Zw el RKIN (3) n=0 But R.H.S. of Equation (5) is DFT of x(n). This means if Z-transform is evaluated on the unit circle at evenly spaced points only; then it becomes DFT. Q.1 Write note on : Overlap-save and Overlap-add algorithms. Q. 2 What is relation between Z-transform and DFT @.3 State DFT and IDFT and describe any four important properties of the same. @.4 — Explain in brief method to reduce complexity in computation of FFT. Give practical ‘considerations in reducing - () memory size for storage of coefficients and (ii) computation time. @.5 "Explain clearly : Circular convolution. @.6 ~ Prove that linear convolution is obtained using circular convolution property of DFT. @.7 With the help of neat flow graph explain DIF FFT algorithm consider N = 8. @.8 Explain the difference between FT, DTFT, DFT. @. 9 How linear convolution of two sequences can be obtained using DFT ? @.10 Explain circular shitting, circular reflection and circular convolution. @. 11 Explain the relationship between DTFT and DFT. @.12 For DFT computation why it is necessary to have - N > L where, N : N-point DFT. ° L: Length of the signal x(n). Ans, : Definition of DFT : It is a finite duration discrete frequency sequence which is obtained by sampling one period of fourier transform. Sampling is done at ‘N’ equally spaced points over the period extending from ©=000=2n. N is very important parameter in the definition of DFT and IDFT. ‘N’ decides the limits of “k’ and ‘n’, ‘N’ also decides the amount of processing time required to calculate N point DFT. The values of ‘N’ is decided according to the number of elements present in the given sequence x(n). ‘That means the length of sequence x(m) = {x(0), x(1), x(2), x(3), x(4), x(5), x(6), x (7) J Here the last value x(7) is denoted by x,(n). Normally value of N is takes as n)+1 or N2L. If it is less than ‘L’ then it is not possible to compute DFT or IDFT. Now in case of fast fourier transformation (FFT) ‘N’ is required to be a power of 2. Accordingly the length of sequence x (n) is adjusted by padding zeros at the end. Q. 13 How N-point DFT is obtained from FT ? Q. 14 Explain how N-point circular convolution can be obtained using DFT and IDFT. @. 15 What is the relationship between ZT and DFT. @.1 Using definition of DFT, compute DFT of x(n) = {1, 0, 0, 1} t Ans. X(k) = (2,1+j,0,1-j) Q.2 Using definition of DFT, compute DFT of sequence, | | Osns2 + otherwise Ans. + X(k) 3 Q.3 Using matrix method, determine 8 point DFT of sequence x(n) = {0, 0, 1,1, 1, 0, 0, O} Ans. : X (ik) = (3, — 1.707 +) 1.707 ,j, 0.293 + j 0.293, 1, 0.293 - 50.293 ,-j,- 1.707 + j 1.707} @. 4 Plot the magnitude and phase spectrum of sampled data sequence {2, 0, 0, 1} which is obtained using sampling frequency of 20 kHz. Select N = 4. Hint: X(k)=(3,2+),1,2-2={320',2.236 22657', 1.20" ,2.236 -26.7'} ‘To plot the spectrum we have to select frequency on X axis. 1 _ Fe _ 20kHz FeNoNT 4 . X(0) represents DC component X(1) represents 5 kHz component X (2) represents 10 kHz component X() represents 15 kHz component ePerin econ OnkIN | = 5 kHz xt Xt) 3 2236 2.236 1 FikHz) (KHz) 26.57" (a) Magnitude spectrum (b) Phase spectrum Fig. F-28 Q.5 Determine IDFT of X(k) ={2,1+),0,1-j] Ans. x(n) = (1,0,0,1) Q.6 A 4 point DFT of sampled data sequence (2, 0, 0, t} is (3,2+j,1,2~j] verily () X(7) =X (3) i) X(12) = X(0) Hint : (i) Put N = 4 and n = 7 in the equation of IDFT and expand the summation. (i) Put N = 4 and k = 12 in the equation of IDFT and expand the summation. Q.7 First five points of 8 point DFT of a real valued sequence are given by X(0) = 0, X(1) = 24j2, X(2) = ~i4,X(3) = 2], X(4) = 0. Determine remaining points and obtain time domain sequence x ( n). Ans, : X(5) = 2+j2,X(6) =0+j4, X(7)=2-j2 > 2 Ans, : Ans, : ant Ans. + @12 Ans, : @. 13 Ans, : and x(n) = {1,1, 1,-1,1,1,-1} Calculate DFT of a sequence whose values for ‘one period are given by, x(n)=(1,1,-2,-2} X(k) = (2,3-j3,0,34)3} Obtain circular convolution of, (1) ={1,3,5,3}, x(n) = {2, 3,4, 1) y(m) = (19, 17, 23, 25} Using DFT and IDFT obtain circular convolution of, x(n) = (2, 0,0, 1) h(n) = (4, 3, 2, 1} Y(m) = (11,8, 5, 6) Find out sequence ¥(n) if h(n) = {1, 1, 1}, x(m) = 1, 2, 8, 1) using circular convolution. Hint : Obtain linear convolution using circular convolu: on Y(n) = {1,3,6,6,4, 1,0, 0) Obtain circular convolution of, x1(M) = (1, 2, 8, 4} xo(n (4, 8, 2, 1) Y(m) = (24, 22, 24, 30) Determine response ¥(m) of a filer if x(n) = (1, 2, 2, 1) and h(n) = (1, 2, 3} Y(n) = (1,4,9, 11,8, 3} QoQ ___—4 FFT Algorithms Name of the Topic Introduction Radix-2 FFT Algorithm Radix-2 Decimation In Time (DIT) Algorithm (OI Radix-2 Decimation In Frequency (DIF) FFT A\ Computation of DFT by Linear Fi Practical Considerations in FFT Implementation Chirp: Algorithm ie 1.1 Introduction : ‘We have studied how to obtain DFT of a sequence by using direct computation, Basically, the direct computation of DFT requires large number of computations. So more processing time is required. . For the computation of N-point DFT, N? complex multiplications and N?-N complex additions are required. If the value of N is large then the number of computations will go into lakhs. This proves inefficiency of direct DFT computation. In 1965, Cooley and Tukey developed very efficient algorithm to implement the DFT. This algorithm is called as Fast Fourier Transform (FFT). These FFT algorithms are very efficient in terms of computations. By using these algorithms, number of arithmetic operations involved in the ‘computation of DFT are greatly reduced. Different FFT algorithms are available : out of which Radix-2 FFT algorithm is most important FFT algorithm. 1.2 Radix-2 FFT Algorithm : While calculating DFT; we have discussed that we always calculate number N can be factored as, Here every ‘r’ is a prime. Now if then we can write, 2) N Here ‘r’ is called as radix (base) of FFT algorithm and ‘v' indicates number of stages in FFT algorithm. ‘Now radix means base and if its value is ‘2’ then it is called as radix-2 FFT algorithm. Thus when r= 2; Equation (2) becomes, N= 2 G3) Thus if we are computing 8 point DFT then N = 8 822 nove3 (4) So for 8 point DFT, there are three stages of FFT algorithm. While computing FFT, divide number of input samples by 2, till you reach minimum two samples, Based on this division there are two algorithms as follows : (1) Radix-2 Decimation in Time (DIT) algorithm, (2) Radix-2 Decimation in Frequency (DIF) algorithm, le Before studying these algorithms we will derive some important properties of twiddle factor Wy. The twiddle factor Wy, is given by, Wy (5) ken 1 Wy =W N Using Equation (5) we can write, ween — ion Bute ween ow wen (< (6) (7) Equation (7) indicates that twiddle factor is periodic. N kiN k 2 2. Ww ne Ww N Using Equation (6) we can write, . wets {8) (9) (10) Equation (10) indicates that twiddle factor is symmetric. 2 3. Wiy= Wwe From Equation (5) we can write, ie = " 1.3. Radix-2 Decimation In Time (DIT) Algorithm (DIT FFT) : ‘To decimate means to break into parts. Thus DIT indicates dividing (splitting) the sequence in time domain. The different stages of decimation are as follows : First stage of decimation : Let x(n) be the given input sequence containing ‘N’ samples. Now for decimation in time we will divide x (1) into even and odd’ sequences. x(n) = f,(m)+f,(m) (1) Here f, (m) is even sequence and f, (m) is odd sequence (2) es f,(m) = x(2n), NL soon 1 3) and f,(m) = x(2nt1), m=0,1 Input sequence x(n) has ‘N’ samples. So after decimation; f,(m) and f,(m) will contain & samples. Now according to the definition of DFT, N xc) = DY xcnywe (4) n=0 Since we have divided x(n) into two parts; we can write separate summation for even and odd sequences as follows xk) = xtsywhe Doxey we (3) never nod | The first summation represents even sequence. So we will put n = 2m in first summation. While the second summation represents odd sequence, so we will put n = (2m+1) in second summation. Since even and odd sequences contain x samples each; the limits of summation will be from m= 0 to N—1. y ween) N mC) 2 XU) = Sy (MW £, (1m) We ow X(k) = 2 Now we have W., = Wy km ve (8) km yk X(k) = y f, (mW ty x £(m) Wy, m=0 2 ‘Comparing each summation with the definition of DFT, X(k) = F,(k) We F(k), K=01.,N We will consider an example of 8 point DFT. That means N = 8. Here F, (k) is x point DPT of f,(m) and F,(k) is y point DPT of f,(m). That means F, (k) and F, (kk) are 4-point DFTs. Equation (9) indicates that F, (kk) is multiplied by Wy, and itis added with F, (k), to obtain (4 +4) ie. 8-point DFT. Graphically Equation (9) represented as shown in Fig. G-1. Remember that in Equation (9), K varies from 0 to N~1 (ie. 0 to 7 for 8 point DFT). 44(0) = x(0) eee | — xo) (1) = x2) Even + - © X(1) lam eae XQ) x(2n) = fy * £,(8)5 x6) x0) (0) = x i 60) = x(1) £0) Why oxi) f(1)= x(3) F(t) wi ond oo) computes 20 Wyn xi) inputs fo(2) = x(5) 4 point F,(2) Wis x6) x(20¥4) = fm) , Fk) 3 £48) 5x7) | F,(3) “te xq) Multiplication by N Fig. G-1 : Graphical representation of X (Kk) = Fy (k) + Wk F, (k) Now F, (k) and F;(k) are 4-point (3 DFTs, They are periodic with period §. Using periodicity property of DFT we can write, ri (ed) = F,(k) (10) and B[k+] = Fj (k) (lL) Replacing k by kee in Equation (9) we get, (12) Now we have, N N) wk pf x “F] = Fl key we #[k-3) (13) Using Equations (10) and (11) we get, N yk x(r+] = FQ) WER, () « Here X (k) is ‘N° point DFT. We can take k= 0 to X—1 then, by using Equations (9) and (14) we can obtain combined N-point DFT. X(k) = FCK)+WEE (ke), K=O, Nar (3) N N and X{k+3) = F, (k)-WAF, (i), k=01.09-1 (16) We are considering an example of 8 point DFT (N = 8). So in Equations (15) and (16), k varies from 0 to 3. Now putting k = 0 to 3 in Equations (15) and (16) we get, X(0) =F, (0)+W\F(0) X(1) =F, (1)+WyF(1) 17) X(2) =F) (2)+W (2) X(3) =F, (3)+WyF(3) J and X (044) =X (4) =F, (0)-WyF, (0) K (144) =X (5) =F, (1)-WyPp(1) (18) X (244) =X (6) =F, (2)-Wy Fh (2) X (344) =X(7).=F,(3)-WyF (3) ‘The graphical representation of first stage of decimation for 8 point DFT is as shown in Fig. G-2, (1) = walt Even J oN From samples < "yoy east | NSpOE Equation x (2n) = f,(m)) @— + an o-f1(3) = x161! £,(0) = x{1} oad (1) = x3 From samples Equation @)= went) ty{m) e222) (ia) £18) = x17) Fig. G-2 : First stage of decimation In Fig. G-2, input sequences are . f(m) x(2n) =(x(0),x(2),x(4),x(6)} (19) and f,(m) = x(2n+1) ={x(1),x(3),x(5),x(7)} (20) ‘That means each sequence contains R samples. Second stage of decimation : In the first stage of decimation; we obtained the sequences of length §, That means for S-point DFT (N = 8); the length of each sequence is “4" as given by Equations (19) and (20). We discussed that we ave to continue this process tll we get ‘2° point sequence. We can further decimate f,(m) into even and odd samples. Let g1, (n) = f,(2m), which contains even samples and let gin (n) = fy (2m-+ 1), which contains odd samples of f, (m ) ‘Note that here range of ‘n’ and ‘m’ is from 0 to x 1 ?) F, (k) and F,(k). The Jength of each sequence was x Here in the second stage of decimation; wwe are further dividing the sequences into even and odd parts. So similar to Equations (15) and (16) we can write; For F, (k), Now recall Equations (15) and (16). We obtained sequences X(k) and x(t ) from k F(k) = Gy(K)tWY Gy (ky k=0,1,.. 8-1 21) N wo 5 (8) Thus, for N = 8 we have the range of K, from K = 0 to K = 1, Here Gy, (k) is DFT of 811 (1) and Gyp(k) is DFT of g,. (nm). Now putting the values of ‘K’ in Equation (21) we get, k GC Wy Gig (k) k= 1 Bad (22) F, (0) = Gy (0) + Wy, Gp (0) : 23) | Fy(1) = Gy (1) + Wy, Gy (1) Similarly from Equation (22) we get, F,(0+8 |= (2) =6,(0)-w? ,G,(0) °} [O85 ]=F=Gn()-WE, G00) *| t i (24) J B(14E =F) G4), GoC1) Here the values of K are ‘0’ and 1. ‘That means it is 2-point DFT. Thus Equations (23) and (24) shows that we can obtain 4-point DFT by combining two 2-point DFTs. The graphical representation is shown in Fig. G-3. 101 = F101 = 94410 (0) = F,{0] = 94410] 0) Even From samples Eaton (4)= F12)= oft of fim) | X14) = F121 = oylt] eat Q)=f,11= aS M2) = f,(11= gy210) Fi dd From samples Equation of fm) ) x16) = £(3) = gyal) ey (24) j N Fig. G-3 : F, (Kk), 5 point DET Note that here, 8, (1) =f, (2m) =x(4n) =(x(0),x(4)} +] and By2(n) =f, (2m+1) =x(4n42)=[x(2),.x(6)} | (25) Now similar to Equations (21) and (22) we can write equations for F, (k) as follows : k N F,(k) = G(k)+Wy, Gy Ck), ke. 0-1 (26) N k and B (eT) Gy (K)- Wy, Gy (kK), K=O 1. 27) Here Gy, (k) is DFT of gy; (n) and Gy, (k) is DFT of go) (1). The values of K are 0 and 1, Putting these values in Equation (26), F, (0) = Gy (0) + Wy, Go (0) 0) 1 Fy (1) = Gy (1) + Wy G9 (1) Similarly from Equation (27) we get, 8 0 -) (48 JP (2) = Ga (0)- Why Gn(0) | (29) 8 1 (14 (3) = Gn (1) Wy Gt 1 J The graphical representation of Equations (28) and (29) is shown in Fig. G-4. Ey. i i X(1)= (0) = gp4(0)} {Sox(0) i (> Fo) Even Ni point ; | From hs wore] | a, X(5) = ,(2)= gay(1)| (2-Poin : of f,(m) ak j21(1) F(t) x(8) = (1) = G22(0) F,(2) od N/A point | From samples DFT Equation x(6)= £313) = gpa(1)| (2-Point) (2 of ffm) (8) = dzal 60) i «ce poi Fig. G-4 : F,(k), > point DFT Note that here, 8) (0) =f (Qn) = x(4n +1) =[x(1),x(5)} | G0) Bi (0) = fy (201) = x(4n +3) ={x(3).x(7)} Combination of first and second stage of decimation : Combining Fig. G-3 and Fig. G-4 in Fig. G-2 we get the combination of first and second stage of decimation. It is shown iti Fig. G-5. At is stage we have BR that means 2 point sequences. So further decimation is not possible. ‘As shown in Fig. G-5; we have to compute 2-point DFT. Stage 2 Stage 1 Fig. G-5 : Combination of first and second stage of decimation Computation of 2-point DFT : According to the basic definition of DFT, N-1 x= 5 x(n) We k=0,1,.,N-1 1) n=0 We will use Equation (31) to compute 2-point DFT. From Fig. G-6, consider the first block of 2-poirit DFT. It is separately drawn as shown in Fig, G-6. (0) = £,(0) = 944(0) G0) gui(n) Guth) where nis where kis Oand 1 G1) and 1 Fig. G-6 : Block of 2-point DFT Here input sequences are gj, (0) and g,, (1). We can denote it by g), (1); where n varies from 0 to 1. Now the output sequences are Gj, (0) and G,,(1). We can denote it by Gy; (k)s where ‘k’ varies from 0 to 1. Here Gy, (k) is DFT of g1,(). ‘Thus for G,,(k) we can write Equation (31) as, to. Gk) = ¥ e,(w", k=01 (32) it (A) W, > . n=0 Note that this is 2 point DFT, so we have put N = 2. Now putting values of k in Equation (32) we get, 1 ° XL gy (sw. n=0 For k= 0 = G,,(0) o Bul W) = 1 2 1 6,0) = LY ay(m) n=0 Expanding the summation we get, G6, (0) = 2, (0) #8, 1) (33) 1 Fork=1 = 6,(1)= XY a,(a)W) n=0 Expanding the summation we get, 5 0 i! GC) = 8), C0)W +8, (1) W, (34) ize Wehave Wy =e N 35) ooh Using Equations (33) and (35), we can represent the computation of 2-point DFT as shown in Fig. G-7. This structure looks like a butterfly. So it is called as FFT butterfly structure, 940) a x0) 6,10) } ay(1) 8) - Gy(t) Fig. G-7 : FFT butterfly structure Now we know that W) = 1, Thus we can modify Equation (33) and (35) as follows Gy (0) = (0048, (1) 36) 0 and G,,(1) = 8, (0)-W, 8, (1) GD ‘This modified butterfly structure is shown in Fig. G-8. sn 1 x(0) Gy3(0) Ww ees ; Sut Fig. G-8 : Modified butterfly structure Similarly for other 2-point DFTs we can draw the butterfly structure. Total signal flow-graph for 8-point DIT FFT : The total signal flow graph is obtained by interconnecting all stages of decimation, In this case, it is obtained by interconnecting first and second stage of decimation. But the starting block is the block used to compute 2-point DFT (butterfly structure). The total signal flow graph is shown in Fig. G9. lolx Is tix. felx lax ux lox Prob. 1: Compute the eight-point DFT of a sequence. x(n)= {z 8 algorithm. Soin. : This flow graph is shown in Fig. G-10. Here s,(n) represents output of stage - 1 and s, (mn) represents output of stage - 2. The different values of twiddle factor are 0,0, 0.0} Using in-place radix-2 decimation in time FFT we e 4 = 0.707-j0.707 w 8 We = -0.707-§0.701 Output of stage - 1 : 5,(0) = x(O)Wix(4) = 54 1(0) 5(1) = x(0)-WEx(4) = 4-10) = 5 4) = Wier eber(oye! 5,03) = x(2)5Wix(6)=$-1(0)=5 5(4) = xC)+WIx(S) = pH (o=5 5, (5) = x(I)-Wix(5) = 3-1-0) = 5 5 (6) = XG)AW X(T) = 541 ()=3 0 1 1 5,(7) = x()-Wix(7) = $= 1-0) = 5 Output of stage - 2 : S 0 0 1 1 sopemsane gt [a]! 1 jayew'say=4-it 5, (0) Wes, (2) = 5,(2) = 5,3) 5(4) s,(5) 8, (6) (7) Final output = (0) X(1) X(2) x(3) X(4) X(5) x(5) X(6) X(7) 2 1d 8, (D-Ws, (3) = 5459 11 5, (4) + WE, (6) = 11 5, (5) +Wes (1) = 5-53 o 1 8, (4) We 5, (6) = 3-5 1.1 5 (S)-Wes (7) = 5455 5, (0) #W9 3, (4) = 14152 8, (1) #W) 5, (5) = 2 }+¢o707-ja2m) 0.5 —j 1.207 5, (2) Wes, (6) = 0+(-§)(0) =0 Lil dood S@)eWyyO)= (25 }reo70r-som0r (353 | )}+¢0-ja70r «05-5020 5,(0)-Wys,(4) =1-11=0 8, (1)- W484 (5) 1d A tot (2-42 }-com07-soren(5 i 1 1 (3-33-07) 0.5 +j 0.207 8, (2)-Wys, (6) =0+)-(0) =0 3 8, (3)- Ws) (7) 11 11 (2252 om som (pes 1d . (zes2 }rorori os +j 120 {X (0), (1),X (2), (3), X(4)X (5). (6X (7) * io " Prob. 2: Let x(n) be a finite duration sequence of length 8 such that | x(n) =(-1, 0, 2,0, -4, 0, 2, 0} i (a) Find X (k) using DITFFT flow graph {b) Using the result in (a) and not otherwise find DFT of sequence x,(n) = (-1, 2, ~4, +2}. Justify your answer. (©) Using result in (b) find DFT of sequence x(n) = (4, +2,-1, +2} Soin. : (a) This flow graph is as shown in Fig. G-IK(a) Here s, (1) represents output of stage - 1 and s>(m) represents output of stage - 2, The different values of twiddle factor are as follows Wo =e 4 =-0,707-j0.707 Output of stage - 1: s,(0) = xO) #WEx(4) = 141(-4)= i 8, (1) = x(0)=WEx(4) == 1-1 (4) =3 5, (2) = x(2)+W)x(6) = 241-(2) =4 8,(3) = x(2)-Wix(6) 42-1-(2)=0 ID Ba b 8, (4) 5,(5) 5 (6) 5,(7) Output of stage 8,(0) (1) 3,(2) 5,(3) (4) 5,(5) s,(6) 8)(7) 2 ( Final output : X(0) x(1) X(2) x(3) X(4) x(1)+W°x(5)=041-(0) =0 8 X(1)=Wex(5)=0-1(0) =0 X(3)4W)x(7) =0 X(3)-Wex(7) 20-1 -(0) =0 +2: 5,(0)+W"s, (2)=-541-(4) =-1 H st 8, (Wis, (3)=3-j(0)=3 5, (0)-W)s,(2)==5-1-(4) = 9 8, (= Wes, (3) = 3400) 5, (4) +Wes, (6) =041-(0) =0 5, (5) +Wes,(7) =0-5(0) =0 8, (4) WY, (6) = 0-1 (0)=0 5, (5)—Wys, (7) = 04)(0) =0 50) + Ws, (4) == 141 (0)= 8, (1) + Wh s, (5) = 340.707 -j0.107)-0.=3 5, (2) +W)s,(6) =-9-](0)=-9 8, (3) + Ws, (7) = 3+(-0.707 -j 0.707) -0=3 2 3% 5,(0) Wes, (4) =-1-1-(0) 8, (1) = Wy 5, (5) = 3-1 (0) =3 X(6) = 8,(2)-Wys, (6) =-945(0) =-9 X(7) = 8,(3)-Wys, (7) = 3-(~ 0.707 ~j0.707)-0 = 3 ‘Thus, X(k) = {X(0),X(1),X (2).X (3),X(4),X(59,X (6), (7) } E () Let x(n) = (a, b, ¢, d) and let its DFT be the sequence X(k) = (A, B, C, D). If we add fone zero after each sample in x(n) then we will get the sequence. x(n) = [2,0,b, 0, ¢, 0, d, 0} This process is called as upsampling process. Since in this sequence one zero is added after each sample; the entire DFT repeats one time. If we will add two zeros after each sample then entire DFT will repeat two times. DFT {x,()] = X,(k) = {A,B,C D, A, B, C, D} In part (a) for the sequence x(n). x(n) = {=1,0,2,0,-4, 0, 2, 0} We have obtained the DFT, X(k) = (=1,3,-9, 3-1, 3-9, 3} Observe that first four DET samples are repeated only once. This is because in x(n), zero is ‘added after each sample. The given sequence is, x(n) = {-1,2,-4,2) So its DFT is, Justification of answer : We will prove the property of DFT used in this example. Let x(n) = (a, b, c, d} and X(k) = (A,B,C, D} Consider the sequence, x(n) = (2, 0,b, 0, ¢, 0, d, 0} According to the definition of DET we can write, 7 ka x(k) = x(n) W, (1) n=0 We will divide the sequence x,(n) into odd part and even part. Let x, (‘°") represent even part and x, (2n-+1) represent odd part. 3 3 X(k)= > x (21) We x x (aaetywet? x n=0 n=0 Observe that in the first sumination ‘n’ is replaced by 2n and in the second summation ‘n’ is replaced by (2n + 1). But in the second summation x, (2n-+1) represents odd samples of sequence x; (nm) and all these samples are zero. on2) 3 kn Xe) = Yn) we 3) n=0 Now we have the property of twiddle factor. Nd o we = we ‘4 3 X,Ck) =D x, (20) we mC) n=0 But x, (2n) represents even samples of x, (n). That means x, (2n) = x(n). 3 X(k) =D x(n) WP = x(k) n=0 But x; (1) is eight point sequence, X,(k) = (A,B,C, D, A, B,C, D) (-4,2,-1,2) (@ Here x, (m) Wehave x,(n) = (~1,2,-4,2) Let us plot the sequences x(n) and x, (n) as shown in Fig, G-11(b) and G-11(c). x1) x(t) | x2(2) x2(0) (2) (0) 1 | 23) x48) Sequence x(n) | ‘Sequence x;(n) © © . Fig. G-11 From these diagrams we can conclude that x, (1) is obtained by circularly rotating x; (n) by 2 positions in anticlockwise direction. That means x, (mn) is obtained by delaying x,(n) by 2 positions. x(n) = x, (n=2)) Now according to circular time shifting property, DFT uw x(n-Dy E> XC) WY N Thus in this case we can write, ioe § 2k ek X,(k) =X (k)- Wy =X (k)-e k . K(k) =e »X, (k) We have, = X,(k) = (-1,3,-9, 3} ‘We will calculate sequence X, (Kk) for different values of k as follows : Fork=0 = X,(0)=e?-X,(0)=-1 Fork=1 = X,(1) e!*X, (1) = (cos mj sine) 3 Fork=2 = X,(2)=e 3"? X, (2) = (cos 2n—jsin2n)-(-9) = -9 For k=3 = X,(3)=e )*?X,(3) = (cos3n-jsin3n)-3 = 3 X,(k) = {X, (0% (14% (2). (3) Prob. 3: Derive DIT FFT flow graph for N= 4 hence find DFT of x(n) = (1, 2, 3, 4} Soin. : First stage of decimation : We have the equations for first stage of decimation, X(K) =F, (k)+WE E(k), N xk and X P= F, (k)- WAR, (i), Here N = 4 X(k) " ke F,(k)+W/F,(k), and X(k+2) F, (k) “WEF, (ks Putting values of k in Equation (3) we get, X(0)=F,(0)+ WEF, (0) and X(1) =F, (1) +), (1) Similarly putting values of k in Equation (4) we get, X(2) =F, (0)-WOF, (0) and X(3) =F, (1) WIP, (1) This signal flow geaph is shown in Fig. G-12(a) X{0] xi] x2) x13] HOL= x10) Fe 2 Even ‘ samples Zon ' of x(n) ANS x12 t xi ‘ Odd ' samples 2 pont : of x(n) ff] = x [3] ' AD) a) 3) (5) (6) © X{0) ° X{2) © X{1] ° X{3] Fig. G-12(b) ‘The given sequence is, x(n) = (1, 2,3, 4) The different values of twiddle factor are as follows : wee The output s(n) is, sp = x(O)+x(2)=143=4 5, = x(0)-x(2)=1-35 o 8) = [x(1)#x(3)]W)=2+4=6 8 = (KC)=x (3) W) = (2-4) (7) =) The final output is, X(0) = syts,=4+6=10 X(1) = 5,45, 2-24)2 X(2) = =4-6=-2 X(3) = Thus, X(k) = {X(0),X(1),X(2),X(3)} (k) = (10, -2+)2, -2, Prob. 4 Draw flow diagram of DITFFT for N = 16. Soin, (1) Here N = 16, means it is 16 point DFT. (2) Total number of stages (3) The first stage of decimation using two 8-point DFT is shown in Fig. G-13(a). 0) ec 20) x01 x20 Xalth Ox x 201 x12) x] 2—] Soin oer [> x 38) | [Beven input {X:t4 x8) samples) xg) x[10) XG} (+) X15) x12] t (2) x16] td) Xt) Ab 7 x1] & om Sie {2x18 x13] rte ts SND XII el lS We ASS xc0 x7) point rr Pall. Wi x11] (odd input [X41 9 Wy x9] © ieaaiepe lel Se x12 x(t] “ wile -D@OXI13] x13} sit Ly NOx1141 x15] al pie 1XF)x/15] Fig. G-13(a) | Fig. G-13(b). (4) In the second stage each 8 point DFT is divided into 2 four point DFTs as shown in Pov Bs 2 213] r Xol4] xt] xf5] x9] x19] x91 pal Wie Fig. G-13(b) (5) The total flow graph is shown in Fig. G-13(c) SOI Roe Ox Isuix RSE : F =< : Ee NXX ite Sn A Vee oo fou Mo (sk forlw PJ 7 QOS ° — “ Se SS tax a DOOdhA a O—+ fei Wn ORK a Siascito=a Oe 7 Coe I| XX OSS at fork Isl | mL o + tz in oss a a * (zk > felw . x SX e eo al tk [lw ce tax (o> tel tux tek > (un ARO ROE lorx + tate tow 1.3.1. Comparison of Computational Complexity with Direct Computation : First we will calculate the computational complexity for direct DFT calculation. A] For direct compute According to the. definition of DFT we have, N-1 Xk) =D x(my We, k= 0,12, n=0 N-1 wl) Equation (1) indicates that we have to take. multiplication of x(n) and twiddle factor. Then we have to add all the terms. Since twiddle factor is complex; we need to perform complex multiplications and complex additions. Complex multiplications : As given by Equation (1), for one value of *k’ multiplication should be performed for all values of ‘n’, The range of ‘n’ is from 0 to N-1. So for one value of ‘k’; N- complex multiplications are required. Now the range of k is also from k = 0 to k = N~ 1. The total complex multiplications are, 2) es jlex multiplications = Nx N= Ni | Complex additions : According to Equation (1), for each value of K we need to add the product terms of ka x(n) Wy For example, let us say N= 4, 3 3 Fork=0=X(0) = DY x(nywe™*= E xinywh n=0 n=0 X(0) = XCO)WI EX (1) Wh +x (2) Wi +x (3) W? @) In Equation (3); four complex multiplications are required and three complex additions are required. Here we have considered N = 4. Thus for each value of ‘k’; N complex multiplications are required and ‘N— 1’ complex additions are required. Now the total values of k and ‘N’ B] Computational complexity using FFT algorithm : Firstly we will calculate the computation complexity required for one butterfly. Consider the general structure of butterfly as shown in Fig. G-14. a Aza+Wyb = Bra-Wyb Fig. G-14 : General structure of butterfly Here ‘a’ and ‘b’ are inputs and A and B are outputs of butterfly. The outputs are given by, A= a+Wip (4) and B= a-Wib (5) ©) ‘qo calculate any output (A or B), we need to multiple input b° by twiddle factor Wi, So one complex multiplication is required for one butterfly. (2) To calculate output ‘A’, one complex addition is required, while to calculate output “B’ one complex subtraction is required as given by Equation (5). But the computational complexity of addition and subtraction is same. So we can say that for one butterfly two complex additions are required, (3) As shown in Fig. G-10, for 8 point DFT; 4 butterflies are there at each stage, So for 4 point DFT, at each stage, ~~ butterflies are required. . 2 (4) As shown in Fig. G-10; three stages are required to compute 8-point DFT. In general, for ‘N’ point DFT, log, N stages are required. Complex multiplications : At cach stage there are x butterflies. Total number of stages are log,N. And for each butterfly, one complex multiplication is required, (6) Complex additions : Total number of stages are log NN. At each stage, * butterflies are required. And for each butterfly, ‘2’ complex additions are required. Total complex additions = 2% log, N Table G-1_ shows comparison of direct DFT computation and computation using FFT algorithms. ‘The Table G-1 shows that, by the use of PFT algorithms the number of complex multiplications and complex additions ‘are reduced. So there is tremendous improvement in the speed. 4.3.2 In-place Computation to Reduce Memory Fisstly, we will discuss the memory requirement of each butterfly. As shown in Fig. G-11(a); ‘a butterfly calculates the values of ‘A’ and “B® for the inputs ‘a’ and ‘b’. Remember that ‘a’ and “b’ are complex inputs, So two memory locations are required to store any one of the inputs; ‘a’ or “b’. ‘One memory location is required to store real part and other memory location is required to store imaginary part. Now, to store both inputs ‘a’ and ‘b’; 2 + 2 = 4 memory locations are required. Now the outputs are computed as follows A ae Wb a) and B= a-Wyb 2) ‘Thus outputs ‘A’ and ‘B’ are calculated by using the values of ‘a’ and ‘b’ stored in the memory. Now ‘A’ and ‘B’ are also complex numbers; so 2 + 2 = 4 memory locations are required to store both the outputs A and B. Once the computation of “A’ and ‘B’ is done then, values of ‘a’ and ‘b’ are not required. So instead of storing ‘A’ and ‘B? at other memory locations; these values are stored at the same place where ‘a’ and ‘b’ were stored. That means ‘A’ and ‘B’ are stored in the place of ‘a’ and ‘b’. This i called as in-place computation. In place computation reduces the memory size. Memory requirement : ‘We discuss that ‘four’ memory locations are required for every butterfly to store input and output values. Now, there are x butterflies per stage. Thus for éach stage, Now as shown in Fig. G-14, one value of twiddle factor is required to compute A and B. To Store one value of twiddle factor, one memory location is required for each butterfly. Now there are x butterflies at each stage. Thus for each stage, ‘Thus combined memory required per stage is N+ MN, These many number of memory locations are required to store input values, output values and the twiddle factor per stage. Now the actual computation of N-point FFT is done stage wise. That means computation of one stage is done at a time. So these memory locations can be used for other stages also. This will again reduce the memory size. 1.4 Decimation in frequency stands for splitting the sequences in terms of frequency. That means Wwe have to split output sequences into smaller subsequences, This decimation is done 2 follows First stage of decimation : According to the definition of DFT, N-1 kon X(k)= > x(n) wi oD We can divide the summation into two parts as follows : -Q) Now consider the second summation that means, x(n) we. ast 2 N. the jimi Put n =n +55 the limits will change as follows : =NINLAN = when n= => Daneh n=0 and when n=N~1 =) N ask onsN- Now we have, zo Z = Ip 0 ZOE 4 ae " X(k) = 1 lw 4) (k) = y [meenesta 2 || Ww 4) n=0 kn Here we have to split the sequence in terms of frequency. So we will split X (k) in térms of even numbered and odd numbered DFT coefficients. Let X ( 2r) represents even numbered DFT and X (941) represent odd numbered DFT. ‘Thus putting k = 2r in Equation (4), we will get even numbered sequence. N 2 or N)Y]y2r0 6 XQ = y [romecy a eels (5) n=0 By putting k = 2r + 1, in Equation (4), we will get odd numbered sequence. N z XQ1) = oy [remecoumrta(ne Ewe" (6) a= Here ‘ris ‘an integer similar to k and it varies from 0 to 1. (-1y¥ 21 AT) and (-1)"*! = (-1)%(-1)! = (8) Putting these values in Equations (5) and (6) we get, N Nl, 2 N 2m X(2t) = [remves(ned ]]y (9) \ n=0 Ra and X(2r+1) = [scmroa{ne wer (a0) n=0 Now consider the term W,” But we have We pw ew" aw w > (Myr) > Yer . Now we can write, WOH ye ye yl yl “ay N wy Wyve Ww Putting these values in Equations (9) and (10) we get, N ate N XQ) = [remven(as 13) n=0 od, md X(24+1) = Oy [vem-x(meP me we 4) Na n=0 N Now le, g(n) = x(n)+x/n+> (15) and h(n) = [roo-x aid I™. 16) 2 N Putting these values in Equations (13) and (14) we get, N 7h X(2r) = g(a) We, ay) n=0 Ba and X(2r+1) = h(nyWwr, (18) Note that at this stage we have decimated the sequence of ‘N’ point DFT into two x point DFTs given by Equations (17) and (18). Let us consider an example of 8-point DFT. That means N = 8. So combining Equations (17) and (18) (that means “= 4) we can obtain N (8 point) point DFT. This is first stage of decimation. Note that Equation (17) indicates 4% point DFT of g(n) \ and Equation (18) indicates 4 (F Join DFT of h(n). For 8-point DET Equation (15) becomes, g(n) = x(n)+x(nt4) 19) Here we are computing “4” point DFT. So range of ‘n’ is n = 0 to n = 3, Putting these values in Equation (19) we get, For n = 0 => g(0)=x(0)+x(4) Forn = 1=3 (1) =x(1)+#x(5) (20) For n= 2 =9 (2) =x(2)+x(6) For n= 3 = g(3)=x(3)+x(7) J Similarly for 8 point DFT Equation (16) becomes, h(n) = (x(n) =x (44) 1 We (21) For n= 0 = h(0) =[x(0)-x(4)] Wy ‘| Porn = 1 => h(1)=({x(1)-x(5)] Wy | 102) For n = 2 => h(2) =[x(2)-x(6)1W, Forn=3=9(3)={x(3)-x(7)]W, J Using Equations (20) and (22), and Equations (17) and (18) we can draw the flow graph of first stage of decimation as shown in Fig. G-15. 10} x{0] q——S1298 + dl . se a} N a j— ri] oF, on (8 x3) > af3} . 6) x4} ‘hfO} _ an “tl + Point [3] From: ‘s ul ° hI] 7 ort - "| Equation: s 7 0 (4-p0int) [> X15 (48) x7] Boy (3) . san Fig, G-15 : First stage of decimation Second stage of decimation : In the first stage of decimation we have used 4-point DFT. We can further decimate the sequence by using 2-point DFT. The second stage of decimation is shown in Fig. G-16. ‘This is similar to DIT-FFT. Stage 1 Stage 2 0} 0 x0} “ ovine |? xt] DFT iA) Ble X(2] © point a x{3} OFT X[6] xl o Nextt] point x{5) 0 OFT |__oxi5) x8} 0 N |—ex13] point x17] © OFT xi Fig. G-16 : Second stage of decimation _ Third fage of decimation = In the second stage of decimation we have used 2-point DFT. So further decimation is not possible. Now we will use a butterfly structure to obtain 2-point DFT. This butterfly is same as shown in Fig. G-14. Thus the total flow graph for 8 point DIF-FFT is shown in Fig. G-17. Fig. G-17 : Total flow graph for 8-point DIF-FFT ‘This flow graph is similar to the flow graph of DIF-FFT but it is in the opposite direction Note that here input x(n) is in sequence but output is shuffled. Similar to DIT-FFT there are log, N = log, 8 = 3 stages. ‘The computational complexity and the memory requirement is same as that of DIT-FFT. Prob. 1: Obtain OFT of a sequence iiid ) BBB p1010,0.0 | Using decimation in frequency FFT algorithm, Soin, ; The total flow graph is shown in Fig. G-18. x(n)= Here g(n) is output of first stage. h(n) is output of second stage. ‘The values of twiddle factor are as follows w= 8 wi = 8 xin wee? 8 w = = 0.707 {0.707 Output of stage - 1: B(0) e(l) g(2) #(3) (4) g(5) 8(6) g(7) x(O)+x(4)=540=05 i 2 x(1)#x(5) = 340205 1 X(2) +x (6) =7+0=05 7 +0=05 x(3)#x(7) = ofa [x(0)=x¢4)1We =| 5 1)-x¢syiwi =[4 (x()=x¢5)1W! =] 4 0.3535 —j 0.3535 [x(3)-x(7)] ~ 0.3535 ~ 0.3535 -0 -| -0]1=05 (0.707 = j 0.707) =0 |(-0.707 -j0.707) ] ] |c-ies ] Output of stage - 2: h(0) h(1) n(2) h(3) h(4) h(S) h(5) h(6) n(7) (7) Final output : x(0) x(q) X(2) x) x(4) x(5) X(6) x(7) X(k) = g(0)+g(2)=05+05=1 = [g(1)+g(3)] =(05+05)=1 = [e(0)-g(2)1W, = (05-05)(+1) = 0 2 = [e(1)-8(3)1W, = (05-05) (-j) = 0 = g(4)+g(6) =05-j05 = g(5)+g(7) = 0.3535 ~j 0.3535 ~ 0.3535 ~ j 0.3535 = -§0.707 = [e(4)-g(6)1W) = [05+j05]1=05 +) 05 = £a(5)—8(7)1 Wy = (0.3535 ~ 0.3835 + 0.3535 +} 0.3535 1(—I) = -j0.707 = h(O)+h(1)=1+1=2 h(4)+h(5) = 05-j 05 —j0.707 = 0.5 ~j 1.207 = h(2)+h(3)=04+050 = [n(6)+h(7)1WE = [0545 0.5~j 0.707}: 1 = 0.5 -j0.207 = (h(O)-h(1)1We = [1-1-1 =0 = th (4)—W(5)1Wy = [(05 JOS) +) 0.707] +1 5 +5 0.207 = [h(2)-h(3)1We= = [h(6)-h(7)1W, = [05+] 05450-7071 = 0545121 = {X (0),X (1), (2), (3), X (4), X (5). (6) X (7)} Prob. 2: Using DIFFFT Find (DFT X, (k) of following sequence x, (n) = (1, 2,-1, 2, 4, 2,1, 2} (i) x,(m) = x, (=n) without performing FFT find X, (Kk). Soln. The total flow graph is shown in Fig. G-19(a). Third stage of decimation Fig. G-19(a) The values of twiddle factor are as follows : 0 Wel 8 wi = 0.707 -j0.707 2. Wo i W, = -0707 0.707 Here, x(0) = 1, x(1) = 2, x(2) = =1, x(3) = 2, x(4) = 4, x(5) = 2, x(6) =-1, x(7)=2 Output of stage - 1: 0 (0) g(l) e(2) x(O)#x(4)=144=5 x(1)+x(5)=2 4254 x(2)+x(6)=-1-1 u 0 -2 ——— g(3) a(4) g(5) B(6) g(7) K(3)4x(7)52+2=4 [x(0)-x(4)]W = [1-4] x1 = =3 [x(1)-x(5)1W) = (2-2) W = 0 [x(2)-x(6)]W. =(-141)W,=0 1 8 2 8 3 8 [x(3)-x(7)]W. = (2-2) We =0 Output of stage - 2: n(0) h(1) h(2) n(3) = h(4) = n(S) h(6) h(7) - Final output : X(0) xq) x(2) X(3) x(4) X(5) X(6) x(7) X(k) woe 8 (0) +8(2)= g(1)+e(3)= [e(0)-g(2)]We=5+2=7 3 =8 + 8 (e(1)=8(3)1Wy = (4-4) (-j) =0 g(4)48(6)=-3 2(5)+g(7)=0+0=0 fe(4)-8(6)1Wy=-3 [9(5)-8(7)1W, = 0 h(O)+h(1)=3+8=11 h(4)+h(5) =-34+0=~3 h(2)+h(3)=7+0=7 th(6) +h (7) 1Wy = -3 [h(0)-h(1)]W°=3-8=-5 [b(4)-h(5)] Wo = -3 (n(2)-h(3)1Wh=7 [h(6)=W(7)1Wy = -3 {X(0),X (1), X (2), X (3), ¥ (4), X (5), X (6), X(7) } Gi) Given x,(m) = x, (-n) According to time reversal property, DET x(-1)y 9 X(-k)y N Here x((-n))y represents circular folding of x(n) and X((—k))y represents circular folding of X (k). Thus X, (k) is obtained by circularly folding X, (kc) as shown in Fig. G-19(b), x2) . x@6) x(a) x(0) x0) ——> x x(6) (2) Fig, G-19(b) Thus in this case Xj (k) is same as X, (k). 1.5 Computation of Inverse DFT (IDFT) using FFT Algorithms : We have studied Radix-2 DIT and DIF FFT algorithms to compute the DFT, X(k). The same algorithm can be used to obtain input sequence x(n) from its DFT. That means to compute IDFT. Recall the definition of IDFT, N-1 1 x)= y Y xc) W, yw N=1 wl) k=0 Just for comparison we will write the definition of DFT. 4 N-I ' +kn } X(k) = YD x(a W k= 01 N-1 2) n=0 Thus IDFT differs from DFT by, (a) Multiplication by x factor. (b) Negative sign of imaginary part osf (Wy ) { wording i stage 1 Stage 2 Stage 3 Tine doin Frequency domain, toms, shld Der terme, neque x) Fig. G-20 : Computation of IDFT using FFT ‘Thus we can use the same algorithm to compute IDFT; but we have to change the sign of twiddle factor and for DIF FFT algorithm we have to multiply input sequence X(k) by t ‘The total flow graph is shown in Fig. G-20. Prob. 1: Using FFT and IFFT, find the output of system if input x(n) and impulse response h(n) ate given by, x(n) = (22,4) hon) = (1, 1} Soln. : If the given sequences are very long then we have to divide such sequences into smaller segments. In this case it is not necessary to divide the sequences. Given x(n) = (2,2, 4} and h(n) = (1, 1) 0 Here L M Number of samples in x(n) = 3 ‘Number of samples in h(n) = 2 ‘That means we have to make length of x(n) and h(n) equal to 4, x(n) = {2, 2, 4,0} and h(n) = {1, 1, 0, 0} First we will obtain DFT of x(n) using DITFFT algorithms. We can also use DIFFFT algorithm, ‘The calculations are shown in Fig. G-21(a) Fig. G-21(a) x(0)+x(2)=24+4=6 = x(0)-x(2)=2-4 & = [x(1)+x(3) Wh =240=2 5) = [x(1)-x(3)] Wi = (2-0)(-j) ==72 The final output is, X(0) = syts)=642=8 X(1) = s,+s,=-2-j2 x(2) y= 6-2=4 X(3) = =-2+)2 X(k) = (8, -2-j2, 4, -24)2) hyo] = 4 hij=0 hiy=4 ha] =0 ‘The final output is, H(0) H(1) H(2) H(3) H(k) (0) Hit] HE2] HES] n(O)+h(2)=1+ h(0)-h(2)=1-0=1 Eh(1)#h(3)1W) = 140-1 1 (h(1)-h(3) Wy = (1-0) -j {2, 1-j, 0, 1+3} Now we will multiply H(k) and X (i). Let Y(k) Y(k) Y(k) X(k)-H(k) {8, -2-j2, 4, -2+2)- (2, 1-j,0,1 +) (16, -4,.0, -4) Now we will perform IFFT to obtain sequence y(n). For this we have to multiply each input by z that means ; and we have to change the sign of imaginary part of twiddle factor. This computation is shown in Fig. G-21(¢) 4Y0 2y(0) tye tray tre Fig. G-21(0) 1 1 1 GY(O#GY (2) = 7 (16)4+5(0) =4 L 4 1 1 1 1 GY(O)—GY(2) = 4 (16)-4(0) =4 1 1 [axogye |: = [Progra ]cn The final output is, y(0) = yQ) = y(2) = yQ)= Prob. 2: Let x(n) be 8 point sequence. Its corresponding DFT X (k) is X(k) = {( 0.5) (24)),(3+i2), (7 (3),(-1), (3-12), (2-J)} Find x(n) by performing IFFT. Soin. ; We will use inverse DIF FFT algorithm. The flow graph is shown in Fig. G-22. x0 OR x0) a x8) xe owl 0 x16) xe o at x . (810, (6) x(e}e 3) a + 7) i ‘ averaging ' by tN stage 1 stage 2 stage 3 “rme domain Frequency domain, FT tems, in sequence tems, tes Fig. G-22 Let g (1) represent output of first stage and h(n) represent output of second stage. By changing sign of imaginary part of twiddle factor the values of twiddle factor are as follows : gc) g(2) 2(3) e(4) a(S) 8(6) g(7) h(0) hal) (2) h(3) n(4) h(5) n(6) h(7) Final output : x(0) x(1) Output of first stage g(0) 1 1 EX (FRX (4) = (05) 443) = 0.44 1 1 1 1 BX) +B (5) = 5 (24) 49 (-j) = 025 1 1 1 1 * BX (2)+ EX (6) = 9 (34i2) +3 (3-]2) = 0.75 1 1 1 1 BX (3) 4 gX(7) = BG) +g (2-5) = 0.25 [exo gxcafeew)-[f0-Fa)] 1 3 131 1 5 [ax@o-gxco fom =[semD- gD |eeororsjar07 (0.25 +} 0.25) (+0.707 +5 0.707) = j 035 i 4 ? [ly 4 1 [axe 3x06) ]¥5-[ 5 GHD) —g GB) Hi -05 1 1 . . [exo gxcr fry =| Fod~f2-H | 0207-50707) hie (= 0.707 +4 0.707) = -j0.35 Output of second stage : 8(0)+8(2) = 0.44 + 0.75 = 1.19 g(1)+8(3) = 025+ 0.25 = 0.5 [e(0)~g(2)1W) = 044-075 =-031 (e(1)~8(3)1We=0 8(4)+g(6)=-031-05 = ~081 g(5)+8(7) =j035~j0.35 =0 [e(4)-8(6)1W) =-031 +05 = 019 [g(3)—8(7)1W, = [035 +035 ]) =~07 h(O)+h(1) = 1.19 +05 = 1.69 h(4)+h(5) 5-081 a x(2) = h(2)+h(3) =-031 x(3) = (8(6)+n(7) WE = (0.19-0.7)-1 = 051 x(4) = [h(0)-h(1)]-W) = (1.19-05)-1 = 0.69 x(5) = [h(4)-h(5)] W. -081 x(6) {h(2)-h(3)] 031 x(7) = [h(6)-h(7)] W. = (0.19+0.7)-1= 0.89 Now sequence x(n) is, x(m) = {x(0),x(1),x(2),x(3).x(4),x(5),x(6),x(7)] +. x(n) = (1.69, - 0.81, -0.31, - 0.51, 0.69, — 0.81, — 0.31, 0.89} 1.6 Computation of Linear Filtering and Correlation using FFT: We know that linear filtering is same as linear convolution, We have studied FIR linear filtering using DFT. For that, overlap add and overlap save methods are used. Now, we will discuss how to obtain linear convolution using FFT algorithms. As an example, we will consider overlap save method. The procedure is as follows : (1) Input data sequence x (n) is segmented into the block of L. points, (2) Impulse response of FIR filter is h(n). It has ‘M? samples. (3) Each block contains ‘M—1" samples from the previous sequence and ‘L’ new samples from the input sequence. Thus the total length of each input block is L+M—1 =N. (4) Using DIF FFT algorithm; the DFT of each input data block is performed. We know that DIF FET algoritht does not require bit reversal of input sequence. But the output sequence is in the bit reversed order. (5) DFT of impulse response, that is H(k) is obtained by using DIF FFT algorithm. So H(k) is also in bit reversed order. (6) Now the output of m'™ block is obtained by multiplying H (k) with X,, (k). Here X,, (ie) is DFT of m' input block. Y,y(K) = H(k)+X,,(k) Here Y,,(k) sequence is also in bit reversed order. (7) Now inverse DFT is obtained using DIF FFT algorithm. This requires bit reversed input Yq (Kk); which produces the output y(n) in the natural order. correlation is nothing but the convolution with one of the Sequences, folded. ing the sequence h(n) we can compute the rfiltering (convolution) = means we can compute the correlation. ie 1.7__ Computation of DFT by Linear Filtering Approach We have studied that Radix-2 FFT algorithms are used to compute ‘I *-point DFT. In this case, NtogyN complex multiplications and Nog, N complex additions ate required to compute N-point DFT. But there are certain applications in which selected number of DFT values are required; but not the entire DFT. In such cases the direct computation of DFT is more efficient than FFT algorithms. The direct computation of DFT for selected values can be realized using linear filtering approach. ‘This type of computation can be performed using the algorithm, called as Goertzel algorithm, 1.7.1 Goertzel Aigorithm : In this algorithm the periodicity property of twiddle factor (Wy,) is used Now recall the definition of DFT, N-1 xX(k)= DS x(m) We" Al) m=0 Note that here we have used notation x (m) for input sequence. Now the oviddle factor is given by, 152m e = cos 2k + j sin 2k Since W,,*" = 1 we can multiply Equation (1) by W,, N-1 em kN xcK) =D x(m wwe m=0 N-1 =k(N-m x(k) =X x(myw SO 2) m=0 Now according to the equation of linear convolution, ym) = Yo x(m) by (n=m) 3) be ‘We know that hy (nm) is an impulse response. Now let, hein) = Wo Mun) (4) Replacing n by ‘n-m’ we get, h,(n-m) = wo unm) (5) ut this value in Equation (3). Here u(n—m) is unit step. So because of multiplication by u(n—m) the limits of summation will become m = 0 to m = =. N-1 yt) = > x¢m)wearm) (6) m=0 Now we will calculate y,(n) at n= N, N-1 * wn => x(my ws) AD m=0 Equations (2) and (7) are identical. Thus we can conclude that DFT, X(k) can be obtained ‘as output of LTI system at n = N. (y, (1) ). But in this case, we will get X(k) only at one value of K. So we need to use parallel systems to obtain X (i) at different values of K. Algom is efficient when X (i) is to be computed at points less than tog, ih 1.7.2. Computation of DFT of Two Real Sequences using Only One FFT Flow Graph : Suppose x,(n) and x(n) are two real valued sequences of length N. We will define a complex valued sequence x(n) as, x(n) = x, (n)+jx,(n), O X"(-k))y =X" (N-k) N Xk) = SEX) +X" (N-K)] er) and X, (k) FER) =X (N=K)] (8) Thus by performing single DFT on complex valued sequence x(n) we can obtain DFT of two real sequences x, (m) and x, (n). Prob. 1: Find DFT of two real sequences using only one FFT flow graph. XM) 201 tt X(N) = (2, 1,2, 1} Perform FFT only once. Soln. : Consider a sequence x(n) such that, x(n) = x,(n)+jx,(n) x(n) = (1431 +5 1432145) Here x(O) = 1+j2x(1)=14jl,x(2)=14j2,x(3)=14j1. We will obtain DFT using DITFFT, the flow graph is as shown in Fig. G-23(a). (0) x(2) x1) x(t) XQ) x(3) x(3) x(O)#x(2)=1+j2+14j2=24j4 x(0)-x(2)=14j2-1-j2=0 [x()#x(3)1Wy = [Lei ete) =24+)2 [x(1)=x(3)1W) = [14jt-1 jl] (-3) = 0 The final output is, X(0) = syts=2tid+24j2=4 +56 X(1) = s,45,=0 X(2) = = 24 j4-2-j2 = j2 X(3) = 5, X(k) = {4 + j6, 0, j2, 0} (1) Calculation of X,(k) : Now wehave, X,(k) = 31X(k)#X"(N=k)1 @ Here N = 4 and X"(k) = (4~j6, 0, ~i2, 0) B) In Equation (2), X*(N—k) = X"((-K)) which represents circular folding of X* (kk). It is shown in Fig. G-23(b). Fig. G-23(b) X°(-k) = (4-6, 0, ~j2, 0} (4) Using Equation (2) we can obtain DFT X, (k) as follows : Weave, X,(k) = F1X(k) +x" (-Kk)] Fork =0 = X,(0)=3{X(0)+X"(0)] =414+j6+4-i6] = 4 Fork=1 => X, (1) = $1X(1) +X) =Fl0+0]=0 Fork =2 = X\(2)=31X(2)+x"(-2y ]=4E4i2-22) <0 Fork=3 = X,(3)=$1X(3)+X"(-3))1= Calculation of Xp (kK) : ‘We have, X,(k) = IX (k)=x"(N-k)] 1 * 3 yl XK) - x (-k)] Fork=0 = X,(0) = GLX (OX (0) = F [4456-446] = 6 1 Pork=1 = XC) = gIX()-X CI) = [0+0]=0 For k= 2 = %(2)= 31 X(2)-x"(-2) = ie4 2122 Fork=3 3 X,(3)= (X(3)-X'(-3)] = F10~0) 0 1.8 Practical Considerations in FFT Implementation : We have studied DITFFT and DIFFFT algorithms. While implementing these algorithms practically; several things should be taken into consideration. 1. These are number of stages; depending on the value of N. So accessing and storing of data at an intermediate stage should be properly done, 2 Once an appropriate data is obtained then actual implementation of butterfly computation should be considered. Indexing : We know that DITFFT requires input data in a bit reversed order; while DIFFFT produces output data in a bit reversed order. Actual input sequence is in natural order. So bit reversal algorithm is required to generate the data in required form. ‘Take an example of 8 point DIT FFT (Fig. G-9). Here input sequence x(n) is not in natural order, Input data is shuffled as x(0), x(4) » x(2) x(6) X(1): (5), x(3), (7) Similarly in case of 8-point DIF FFT (Fig. G-17); the output sequence is not in natural order. It is shuffled as X(0), X(4), X(2), X(6), X(1),X(5), X03) X(7). Now all inputs and outputs are stored in the memory of computer. The given input sequence x(n) will be in natural order. But for DIT FFT we want this sequence to be shuffled. Similarly for DIF FFT, output sequence X(k) should be shuffled, For this, bit reversal algorithm is used. The concept of bit reversal is shown in Table. G-2. Table G-2 Dit reversal ‘As shown in flow chart : Step 1: Accept value of N from user. Step IL : Calculate number of bits (n) from N. Step UM: Accept ‘n’ numbers from user. Step IV : Swap the number as shown in table using swapping of array technique, Step V+ Display the array which contains numbers in reverse order. Number of bit(n) = log Niog22)] a[0]= temp 4 Display the arraya Fig. G-24 : Flow chart While performing linear filtering using DFT; we have studied, how to avoid use of bit reversal algorithm. To make coefficient use of memory; in-place computation should be done. We have studied how to perform in-place computation in FFT algorithms. But there are two disa cdvantages if we use in place computation |. The rindom access memory is required rather than the sequential memory. 2 Bit reversed data is required to generate either at input or at output. So indexing structure required to implement these algorithms is complicated. Coefficients : 1 We know that the coefficients Wy aie required to generate at every state of FFT algorithm. Here the range of variable r is r= 0, 1, .... N These are two methods to generate required values of wy can be obtained. By using this approach; the speed of operation is improved but it requires extra memory to store the values of Wy. 2. The calculation of W\, can be done as and when required. This inethod does not require any extra memory but it is less efficient. But if this method is to be used then it is preferred to use recursion formula. It is, al N wt = whwieb No" This formula shows, how to obtain /* coefficient from (1—1)* coefficient. We can use this formula because the required coefficients are all powers of complex number of the form wy , Where q depends on algorithm and the stage. 1.9 Chirp-Z Algorithm : ‘The chirp-Z algorithm is used to compute X(Z) on the other countours; in the Z-plane. It ‘may include the unit circle. If we want to calculate X(Z) at a set of points [Z,] then the equation of Z-transform can be written as, N-1 X(Z) = YL x(nyZ a n=0 Here let k = 0,1,..,L-1 and n= 0,1,...N=1 Now Z can be represented in the polar form with radius of countour ‘r' and at N equally spaced points then Z= k=0,1,..,N-1 (2) Putting this value in Equation (1) we get, N-l ny gi 2k IN X{(Al=s YL tx(ayrtye? 3) n= 8, Now let us say that Z,, fall on an arc which starts at some point Z, = 1,¢.° and spirals either in; towards the origin or out, away from the origin. Then Z can be defined as, k=0,1,.,L-1 (4) Here if R, < 1; the points fall on a contour that spirals towards the origin and if R, > 1 then points fall on a countour that spirals away from the origin. If R = 1 then the countour is a circular arc-of radius r,. And when r, = R, = 1 then the countour is an arc of unit cirele. Now if 1, =R,=1,0=0,9= 22 frequencies are those of the DFT. Putting Equation (4) in Equation (1) we get, N-1 a nk xiz= > x(n) [10%] [Re] n=0 Let V = Rye% o X(Al= YD x(n)teert.vom n=0 Now the term nk can be expressed as, nk = FE 4e-(k-n Py Putting this value in Equation (5) we get, N-1 2 ; . KiZje vey [acotnehre. venta] n=0 38 en =n /2 Let us define, a(n) = x(n) te rev Let _g(n) = Input sequence and impulse response h(n) = V h(k=n) = vekoav/2 Thus Equation (8) becomes, »N-1 x(q1=V"? Y ecnyh(k-n) n=0 Here the summation term represents the equation of linear convolution. That represents the output of digital filter y (_k). FV and L-= N then the countour is the entire unit circle and (5) (6) AD) (8) +9) +(10) ALD) means it » XIZ] -y(k) (02) Now we have V" 212 n h(n) (from Equation (9)) < " th(k) TP! = > ‘Thus Equation (12) becomes, y(k) cK): NOW the Z-transform evaluated as in ‘Thus the DFT at discrete point Z,, is the ratio of Equation (8) is called as, Chirp-Z transform, Solved Problem : Prob. 1: Derive the signal flow graph for N = 16 point radix 4-decimation in time FFT algorithm in which the input sequence is in normal order and computations are done in place. Soln, : If number of data points N in DFT is a power of 4 (N = 4) then we can use Radix? algorithm, But more efficient design can be implemented by Radixd algorithm. To implement a Radix4 decimation in time. FFT algorithm we will us Di Approach. Here N-point DFT where N can be factored as a product of two integers. . Ns iM ide and Conquer Sequence x(n), 0 $n $N=I can be stored in single dimensional array n or two dimensional array (1m) Selective mapping is done by, A Ml+m or n= l+mL WW Similarly arrangement is used to store values of DFT ic. X (k) in one dimensional array k or two dimensional array (p, q) when 0 $ pS L~1 and 0SqSM~1 Selective mapping k= Mig ‘The DFT matrix can be expressed as a double sum over the elements of the rectangular array multiplied by corresponding phase. + Mapping is done by the given formula, : M-1L-1 at X(pa= YY xUmywy? m=0 [=0 aq) (mL+0) Further simplified equation is, L-1 M-1 Ly Xcpa) = Lf we) Y xem [Ewe 1=0 M=0 Here in Radix4 point DFT, L = 4 and M = N/4,1,p = 0, 1, 2, 35 m,q = 0,1. N41 n= 4m4+l,k=(N/4)p+q From these parameters Equation (3) can be written from Equation (2). 3 - ‘4 bo Xp = L[wlrcsay] Wwe p=0.1,2.3 t=0 (N/4)=1 where, Fg) = x(t.m) we M=0 where [= 0,1, 2,3 p= and x(/,m) = x(4m+) N x(Fors) when expressed in matrix form X(p.q) 0 WyF(O.a) X(0,q) 1 1 1 1] wer. XCiq)} lft -j -1 0 5 N X(2.q)} JL -1 1-1 24 [xa] LE i -1 -i]| MPO a Wy F(3.4) (I) (2) 3) Using this algorithm for N = 16 the Radix4 FFT is obtained as follows : x(q x(0) x(t x) x(2} (8) x(3k, x(12) x(4) xt) x6) 3X) x6 9X09) x(7)0 RAZ © x(13) x8 x2) (9) x(6) x(10)¢ ob SK xt10) xt x14) x(12% x3) x(13)o xq) x(14) do, <0 X(11) x(15)d x(15) Fig. G-25 How an N-point sequence x(n) can be obtained from its N-point DFT Xk) using an FFT algorithm, Derive and explain the Goerizel algorithm used to compute DFT. Develop the signal flow graph for second order recursive computation of X[k] Derive and explain N-point radix-2 DIF FFT algorithm. For N = 8 draw the signal flow graph. Explain the procedure to find linear convolution of two causal, finite duration sequences using FFT algorithm, Obtain second order recursive implementation of Goertzel Algorithm. How one can obtain the inverse DFT to get an N-point sequence x(n) by means of FFT algorithm ? Draw a signal flow graph of 8-point DFT for DIF FFT Algorithm Comment on the number of twiddle factor computations required in each stage and the computational complexity Determine the total number of twiddle factors required to compute and N-point OFT using Radix-2 DIT FFT algorithm and compare it with that of direct computation of N-point DFT. Q@. 10 at Ans. : Draw the signal flow graph for the computation of a 2-point DIT using Radix-2 DIT FFT algorithm. Explain how an N-point DFT can be obtained by means of linear convolution and determine the computational complexity. Derive and explain Radix-2 DIT FFT Algorithm (all stages) for N = 8. Draw signals flow graph and commet on the computational complexity and in-place computation, Derive and explain Radix-2 DIF (Decimation in Frequency) FFT Algorithm for N = 8. Draw the signal flow graph for all the stages. Compare this algorithm with DIT FFT. Comment on the computational complexity and in-place computation. Determine 8 point DFT of x(n) = 1 for —3 -- hay hyn) hyMt-3) I a xin) Fig. H-3(b) : Pick-off node _ ; F yoy ‘n(2) h(t) n(O) Fig. H-3(c) : Tapped delay line filter 2.8 ___Cascade Form Structure : Cascade means the number of stages are connected in series. Now we have the system transfer function of the FIR system is given by, M-1 -k H(Z) = YY bz (1) k=0 Generally the higher order FIR filter is realised by using a series connection of different FIR sections (cascade connection). Here each section is characterized by the second order transfer function, Then due to cascade connection ; the total transfer function [:'{Z:)] will be multiplication of all second order transfer functions. 6 H(Z) = Hy (Z)-H,(Z)-H,(Z) 1, (Z (2) Here H, (Z) is the second order transfer function and it is given by, - -1 -2 H(Z) = dy +d, +b Z (3) Y¥(Z) But we know that, Hy (Z) = % iz k Y,(Z) k oat -2 XZ = by tb, Z tbyZ Y(Z) = bio (Z) +b Z'X, (Z) +b ZX, (Z) 4) Taking inverse Z-transform (IZT) of both sides we get, Y,(n) = bom (M) Hb H (M- 1) +b, x (0-2) (5) i From Equation (5), we can draw the direct form realization of second order section as shown in Fig. H-4@). “t) ¥(0-2) mln) KL) = X44(0) Fig, H-4(a) : Direct-form realization of second order section Now the total structure is obtained by cascading all second order sections. The block schematic of cascade structure is shown in Fig. H-4(b). a(n) = x9(n) yal) = x3(n) x(n) = x4(n)- Hy(2) > Holz) = yal) = y(n) > Hy2) Fig, H-4(b) : Block diagram of cascade structure ‘Thus using Figs. H-4(a) and H-4(b), we can draw the cascade realization of FIR system as shown in Fig. H-4(0). x(n) x(n) Fig. H-4(c) : Cascade realization of FIR system Wot © “This ieascadé realization is obtained by putting K = 0 in fist stage and K i aiage. Observations : 1. This cascade form is canonic with respect to delay. 2. It has M~1 adders and M multipliers for (M~ 1)" order FIR transfer function. 1.4 Frequency Sampling Structure : The major advantage of designing FIR filters using frequency sampling structure is that; we can design FIR filter at the frequencies of interest and not at all frequencies. So the design complexity is reduced. Now in frequency sampling structure; the desired frequency response is specified at the set of equally spaced frequencies as follows : © =@, = Fea) ea) M-1 Here 1, 2, Mis an ineger and =o or t According to the definition of fourier transform we have, M-1 H(@) = Y h(mei ~Q) a=0 This equation gives the frequency response of input signal. Putting Equation (1) in Equation (2) we get, Mot eeeayen H(o,) = h(nje n=0 M-1 2 M Ho) = YD h(nye ROE 3) n=0 This set given by Equation (3) are called as frequency samples of H (cy). Here H (0) is same as DFT H (k +), Now if o: = 0, then H(@) = H(k) which corresponas to M point DFT. M-1 H(kta) = SY acne PRETO AM (4) n=0 Using the definition of IDFT we can write, M-1 h(n) u D wk+ayd OM (5) k=0 Now we will obtain the equations in Z domain. According to the definition of Z-transform we have, M-1 H(Z) = Y h(m)Z" 6) n=0 Putting Equation (5) in Equation (6), M-1 M-1 1 jan(k+a)a/M | oon H(Z)= Diy L Wlk+aye Zz n=0| k=0 Interchanging the order of summation we get, M-1 M H(Z) = Y H(k+a) x yO 7 AD k=0 n= Now we have the standard summation formula, N Nel x n=0 ‘Thus Equation (7) becomes, M-1 rif Mj2m(k+a) )] HZ = > wearer] ff ees 8) k=0 Here the term &*(**4) can be written as, BEKO) = gitnk, ofan And &* = cos nk +j sin rk Thus Equation (8) can be simplified as, M- M iene H(k+a) H(z) = 4S Tope gt --) k=0 ‘This equation shows that H(Z) is characterised by set of frequency samples, H(k +01). Now we can write H(Z.) as the function of two cascade filters as, H(Z) = H,(Z)-H,(Z) Let H,(Z) = wz Me™) (10) This is called as All-Zero system (filter) and zeros are located as, +0)/M 2, = alkea) FIRFS-10 M-1 Similarly, H,(Z) = k=0 This consists of parallel banks of single pole H(k+a, 1 e2R(k+a)/M 7-1 (11) Now H,(Z) and H, (Z) can be realised separately. Then H(Z) is obtained by connecting H, (Z) and H, (Z)) is cascade form as shown in Fig. H-5. > Hfa] o 1 x0 « Paitoay e s an a=0ork Jeri teaynal 2 Hila} Fig. H-5 : Frequency sampling realization a ~ — 15 Lattice Ladder Structure for FIR Filters : Consider M™ order FIR system with the transfer function, M Hy(Z) = 1+ LD By(k)zK M21 k=1 Here M denotes the degree of polynomial and Py, is coefficient. “Thus when M = 0 we get, H,(Z) = 1 Basically Hyy (Z) is the transfer function which can be written as, Hy(Z) = Y(Z) = X(Z)Hy(Z) Putting Equation (1) in Equation (3) we get, M Y(Z) = X(Z)} 1+ LD By(yz* k=1 J M Y(Z) = X(Z)+X(Z) LY By(K)Z* k Taking IZT of both sides we get, M y(n) = x(n)+ D) By(k)-x(n-k) k=1 Let M = | then Equation (5) becomes, y(n) = x(n)+B,(1)x(m~1) «(Here k = M = 1) In the simplest way Equation (6) can be realized as shown in Fig. H-6(a). =) (2) QB) wad) 6) (6) y(n) x(n-1) = Bg(1) x(n—1) —>} Axln] = y [nl xo} o—| Bo In} By [nt] (b) Single stage lattice structure Fig. H-6 Now the same output can be obtained by using the structure shown in Fig. H-6(b). This structure is called as single stage lattice structure. This structure provides two outputs namely A, (n) and By (n), Here A,(n) = Ay(n)+k,By(n—1) Ap and Bo are constant multipliers. In terms of x(n) we can write, Aj (n) = x(n)+k,x(n—1) Similarly, the other output can be written as, B,(n) =k, Aj(m)+B,(n-1) -8@)) In terms of x(n) we can write, B,(m) = k,x(m)+x(n-1) 8) We know that Equation (7(b)) is obtained by using single stage lattic structure, Equations (6) and (7(b)) are same if, Ay(n) = x(n) and k, = B,(1) Similarly, Equations (6) and (7(a)) are matching if, Ag(n) = x(n), B,(1) =k, and By(n-1) = x(n-1) be Here ‘k’ is called as reflection coefficient. ‘That means the same output can be obtained using single stage lattice structure. Now for M 8 y(n) 2; Equation (5) becomes, x(m)+B,(1)x(n-1)+B,(2)x(n=2) (9) ‘As M = 2 we have to cascade two stages to obtain two stage lattice structure as shown in Fig. H-6(0. x(n] o— AoIn} Ain) Aein] = yin) Bo inj LF > B, In] Bain) Fig. H-6(c) : Two stage lattice structure From Fig. H-6(c) we can write, Output of first stage : A\(n) = x(n) +k, x(n=1) and B,(n) = ky x(n) +x(n=1) And the output of second stage is, Ayn) and B,(n) 0 A, (n) +k, B, (n=1) kA, (1) +B, (n-1) Now putting Equation (10) in Equation (12) we get, A, (m) = x(n) +k, x(m-1)+k,B, (n= 1) From Equation (11) we can write, B,(n-1) =k x(m=1)+x(n=2) Putting this value in Equation (14) we get, a(n) A, (n) x(n) +k, x(n—1) +k, [k, x(n-1)+x(n—=2)] x(n) +k, (1+k,)x(n-1)+k,x(m=2) (10) U1) (12) (13) (14) AMS) Observe that Equations (9) and (15) are matching, Here, B,(2) = ky, 8,(1) = (1 +k) B,(1) or ky = (2), oh Ray Here ky and k are reflection coefficients The same way we can increase the number of Stages. Finally M™ stage lattice structure is obtained as shown in Fig. H-6(d). Aon] r A Pl ee am Aa, fy Auve nl Auta = yn xn) ane M1) stage stage By) Bn) Puan) Buf M" order lattice structure 1.6 Digital Sinusoidal Generator : Zang Tea Z'4+aZ Here parametérs a, and ay are given by, a, = 2rcos@, anda, = 7 Where ris the radius of circle. This system has complex conjugate poles at p = re! and its unit impulse response is given by, byt BO) = raya Dayu(ny (2) If the poles are placed on the unit circle (¢ = 1) and if by = Asin @ then Equation (2) becomes, h(n) = sin (nt 1) 0, 0(n) h(n) = Asin(n+1)@u(n) (3) This equation shows that the impulse response of second order system is sinusoidal. Thus this system is called as digital sinusoidal generator. Now we can the draw the block schematic of digital sinusoidal oscillator as follows: From Equation (1) we get, HZ) = a 14a, Z7)+a,Z ” ¥(Z) (144,27! +a,Z by X(Z) cs ¥(Z)+a,Z-1Y(Z)+a,Z~7¥(Z) = byX(Z) . Y(Z) = byX(Z)-aZo'¥(Z)-aZ7¥(Z) A) Taking IZT of both sides we get, y(n) = byx(n)—a, y(n—1)—a, y(n—2). Thus the block schematic of digital sinusoidal oscillator is as shown in Fig. H-7. y(n) boxin) =A sin oy Fig. H-7 1.7__ Structures for Linear Phase FIR Filters FIR filter is said to be having a linear phase structure if its unit impulse sequence is either symmetric or antisymmetric about some point in time. That means FIR filter has linear phase if it satisfies the condition, h(n) = h(M-1-n), n=0,1..M=1 ol) Here M = Number of samples ‘The transfer function of FIR filter is given by, M-1 H(Z) = YY h(mz" (2) n=0 Let us split the summation into two parts. M_, M-1 2 _ x _ H(Z) = x h(nyZ "+ h(nyz" (3) M =0 But for linear phase we have, h(n) = h(M-1-n) > n=M-I-n Putting this condition in the second summation of Equation (3) we get, M M 2 H(Z) = ye h(n y BMH a-nyZz- Io) gy 2 HZ) = ye h(nyiz ez Mt) (5) n=0 Case (i) For even M: YZ We know that H(Z) = (a>: thts Equation (8) becomes, M yz) _ 2! (Mtn) xm se heny[z"+z ] n=0 [eo | Y(Z) = 4 y b(n)[Z Pez Mt) Vx ¢z) | | | n=0 J Now expanding the summation we get, Y¥(Z) = acon[142 9 Ixczyancry[ztez-O-2) ]x¢z M 2 a xy (2) = n(oy[xtz}4Zz OY .x(zy}en(y[ Zz! x (zy 4z-OM-?) x(z)] son th( May e) X(Z)+Z siz x @] 6) Taking IZT of both sides we get, y(n) = h(O){x(m) +x(n—(M~1)]}#M(1){x(m-1) +x [n~(M—2)]} voor] G1] 0 Let M = 6, Thus Equation (7) becomes, ¥(M)=h(0)[x(m)+x(m—5)] +h (1) (x(m=1)4x(n=4)]4+h(2)Ex(n-2)4x(n=3)} (8) The realization of Equation (8) is shown in Fig. H-8(a). x(n-1) x02) xo) z Zz x(9-3) y(n) Fig. H-8(a) : Linear phase FIR structure for M = 6 (even) Case (ii) : For odd M : ‘When M is odd (let M = 5) we can simply write the difference equation as, y(n) =h(O)x(m)+h(1)x(n—1)+h(2)x(n—2)+h(3)x(n—3) #h(4)x(n—4) 49) But we have the condition for symmetry, h(n) = h(M-1-n) (10) Here M = 5, Thus from Equation (10) we get, For n=0 = h(0)=h(4) For n=l = h(1)=h(3) For n=4 = h(4)=h(0) ‘Thus Equation (9) becomes, y(n) = h(0)x(n)+h(1)x(n—1)+h(2)x(n-2)+h(1)x(n-3)+h(0)x(n-4) y(n) = h(O)[x(n)+x(n—4)J+h(1)[x(m-1)+x(n-3)]+h(2)x(n—-2) (11) The realization of Equation (11) is shown in Fig. H-8(b). x(n-2) rae) Es ww Tz m7 ho) yin) Fig, H-8(b) : Linear phase FIR structure for M = ‘case (i), equation of H(Z) for odd M can be expressed. 2 M-3 + > neny[zrez 3-0) : n=0 ising same procedure we can obtain the required realizati Solved Problems : Prob. 1: Obtain linear phase realization of . Zi Zz? 5a HZ) = 1424 Zar Soin. : Given equation is, 21 Zs H(Z) = 144-447 47 1 n(O) = 1, hayes, h(2)=q h(3)=1 Here M = 4 that means M is even. Now we have the condition for symmetric response. h(a) = h(M-1-n), n=0,1,...M-1 For n= 0 => h{0)=h(3) For n= 1 = b(1)=h(2) ‘This realization is similar to Fig. H-8(a). So for M = 4; the realization is shown in Fig. H-9. rape) x(n) wd + x(n-2) hay =n) = vin) Fig. H9 Prob. 2: Realize a linear phase FIR fer with the following impulse response h(n) = 8(n)+3.5(n~1)-45(n-2)+8(n-4)4+26(n-3) Soln. : We can write the impulse response a5, h(n) = n(0) = Here M = Now according to’ the condition of symmetry, h(n) = h(M-1-n), For n= 0 = h(0)=h(4) For n= 1 => h(1)=h(3) For n= 2 = h(2)=h(2) This is the case for M = 5 (odd). The realization is same as shown in Fig. H-8(b). FIRFS-20 Prob. ‘An FIR filter is given by y(n) =x(n)+$x(n=1)+3x(n-2)42x(n-3) 5 2 3 Find the lattice structure coefficients. Soln. + y(n) = x(n)4$x(n=1)43x(n-2)43x (0-3) ‘Taking Z-transform, Y(Z) = X(Z)+$2-1X(Z) 432 2x(Z)+ 22-3x(2) = 4,-1437-2427-3 Y(Z) = x@fiede 452 -743Z | XZ) | aw pa4grty dz 2427-3 egy = NUL ade. ay As we know A, (Z) = Ay) (Z)4K, 2° 1B, (Z) (2) B,(Z) = KL A,(Z)+Z-'BL | (Z) GB) A, (Z)-K,, By (Z) Ayo (Z) = ne 4) In above example, using step down recursion, as order of filter m = 3, = 14477'432-2427-3 Aj(Z) = 1452143272427, a(3) = 3 as K, = coefficient of lattice structure (5) A, B(Z) = B,(Z) = B,(Z) = (6) Now, Aan (Z) » AA (Z) Collecting same terms together A (2) A (2) «9, (2) Now, B,(Z) B,(Z) B, (Z) u A,(Z)- KB, (Z) 4g-1439-2427-3 1431492743 87 50 7) S19 pty? (8) Now, AZ A (Z) Collecting same terms together, AZ) 1 783__ 1250 7569 2500 Z"' (0.6264 — 0.36) fre 25 (1 -3.0276)~ = 3.0276 = 2.0276 = 140,13138697~! = 0.1314 = 0.1314 y(n) @.1 Compare various design methods of linear phase FIR filter. @.2. Write short note on : Frequency sampling techniques. 3 How to draw direct form structure 2 Q. 4 Explain cascade form realization of FIR filter ? Q.5 Write short note on : (@) Frequency sampling structure (d) Lattice ladder structure nsolved Numerié @.1 Represent the system function using linear phase FIR structure H(Z)= +HlZez"] Ans. : 12 7 | . zh + xo) Ye) vir) z —— i2 fa) (b) Fig. Heit @. 2. Represent system function using linear phase FIR structures 2 H(Z)= p49 Ans. : x(n) 250) 72 Fig. H-12 Draw cascade realization of H(Z)=1+8z248z2-79 Hint : (2) = Hy (Z)-Hy(Z); Hy (2) = (1-2-7) and Me@re(1-9 Ans. : x(n) Qgo Structures for IIR Filters Cascade Form Structures Parallel Form Structure 15 16 Transposed Structures 17 Feedback in IIR Systems. . 18 Lattice Structure for IR Filters Lattice-ladder Structure of IIR Filter Ideal Filters and Approximations © Code : DSP11 11 Introduction : We know that IIR stands for infinite impulse response. Generally UR systems are recursive type. A recursive system means; feedback connection is present from output side to the input side. For the realization of HIR systems present, past, future samples of input and past values of output are required. For the realization of IIR systems, following structures are used. 1. Direct form structure 2. Cascade form structure 3. Parallel form structure 1.2 Direct Form Structure for IIR Systems : Direct form structure is again divided into two types : A. Direct form-I structure B. Direct form-Il structure. ‘The general difference equation for discrete time LTI system is given as, M roz* {d) Now let H, (Z.) = Numerator term of Equation (1) M HY(Z) = Y oz-* (2) And let, Hi, (Z) = —b-—_ GB) 16 DY azek k=1 Putting Equations (2) and (3) in Equation (1) we get, H(Z) = H,(Z)-H,(Z) (4) This equation shows that H{(Z) can be represented as the cascade connection of H, (Z.) and H, (Z) as shown in Fig. F-1(a). we) x(n) Hy) | He@) +++ yin) + Cascade connection of H, (Z) and H, (Z) j We know that H,(Z) is the transfer function of the numerator term, Numerator always contain zeros of the system. So H,(Z) is called as all zero system. Now H,(Z) is transfer function of denominator. Denominator always contain poles of the system. So H,(Z) is called as all pole system. @) ct form-I structure : The direct form-I structure is obtained by cascading (connecting in series), the structure for H, (Z) and H, (Z), First we will draw the direct form structure for H, (Z). Direct form structure for Hy(Z) : Recall the equation of H, (Z) (Equation (2)). It is, M H,(Z) = ¥ bz* (5) k=0 we know Output ¥ (Z) But we know that, H(Z) Tnput [X(Z)] To avoid the confusion we will write, = W@). Hy (Z) = SCZ where W (Z,) is output of fist stage, M W(Z) -k X(Z) Xb? oO k=0 W(Z) _ X(Z) Bul 2° = 1 : W(Z) = byX(Z)+b,27'X(Z) +b, ZK (Z) +... by ZX (Z) 2) Taking inverse Z-transform (IZT) of Equation (7) we get, y,(m) = byx(m)+b, x(n=1)+b, x (n=2) +... yy x(n=M) (8) Here by bp by by are the coefficients. The direct form realization of Equation (8) is shown in Fig. I-1(b). Fig. I-1(b) : Direct form realization of H, (2 ) (All zero system) Direct form structure for H,(Z) : Recall the equation for H, (Z.). Itis, iz) = — 9) be Dz ¥(Z)I We have, Hy (2) = ot (X(Z)] “ Now H,(Z) represents second stage of Fig. I-I(a). Input of second stage is the output of first stage. Thus input of H,(Z) is W(Z) and output of H, (Z) is the output of overall system which is Y (Z). Thus Equation (10) becomes, Y(Z ny(z) = 22. Putting this value in Equation (9) we get, Y¥(Z) W(Z) f N Y(Z)+Y(Z) aZ*| = W(Z) kel . N s ¥(Z)= -| SD az-*ly(z)+w(Z) k=1 Expanding the summation we get, Y(Z) = -[a27l+az + etayZ-8 ]¥(Z)4+W(Z) Y(Z) = -aZ-'¥(Z)~-aZ-?Y (2). =ayZ-Ny(Z)+W(Z) Taking IZT of Equation (12) we get, y(n) = -ayy(n-1)-a,y(n-2).. ~ayy(n-N)+w, Here ~a,, —a, .. ay are the coefficients. ‘The direct form implementation of Equation (13) is shown in Fig. 1-1(c). yin) Fig. -1(0) : Direct form realization of H, (Z:) (AI pole system) 11) wn(12) 13) Here all R.H.S. terms of Equation (13) except w (1) are the delayed output terms. Thus this is a feedback (recursive) connection. Now direct form - I structure is obtained by cascading H,(Z) and H,(Z). Thus direct form-I realization of HR system is obtained by connecting Fig. I-1(b) and Fig. I-1(c) in series. It is shown in Fig. I-1(@). ‘Al 2er0 system All pole system Fig. L4(@) : Direct form-I realization of IIR system Computation complexity : ‘The computational complexity of direct form-I structure is as follows : 1. Number of multiplications = M+N-+1 2. Number of additions = M+N 3. Number of memory locations = M+N+1. (B) Direct form-II structure : Observe Fig. I-1(d). Here, first block represents all zero system anil second block represents all pole system. Thus, in direct form- I structure ; zeros of H(Z.) are realised first and the poles of H(Z) are realized second. Now we are studying these structures for LTI (linear time invariant) systems, Since the systems are linear we can interchange the positions of H, (Z.) and H,(Z). This will give us the direct form-II structure, Thus in direct form-II structure; poles are realised first and zeros second, We have, H(Z) = H,(Z)-H,(Z) ol) We will interchange the equations of H, (Z) and H, (Z.. = H(Z) =— 1 (2) M and H,(Z) = Yb. z7* (3) k=0 Fig. 1-2(a) : mn Here U(Z) represents the output of first block. (1) All pole system : We can write, H(z) = at Comparing Equations (2) and (3) we get, UZ) _ X(Z) N 1+ DY az* k= N uz} it YD az*l = xz) k N u(zZ)+u(Z)| Y az-* k=1 " X(Z) N X(Z)-U(Z)| D 4Z™ k=1 U(Z) 1 Expanding the summation we get, U(Z) = X(Z)—a, Z1U(Z)—a, ZU (Z) may ZN (Z) ‘Taking IZT of Equation (5) we get, u(n) = x(m)—a,x(n—1)~a,x(n=2) an ay x (MN) ‘The direct form implementation of Equation (6) is shown in Fig. 1-2(b). wn) ~G) (6) Fig, 1-2(b) : Direct form realization of H, (Z) (All pole system) (2) All zero system : AS shown in Fig. -2(a), the output of second stage is the overall output of the system which is Y(Z). While input to this stage is the output of first stage, which is U(Z). Thus we can write, = Quiput _ Y(Z) oD) (2) = Tone U(Z) o Comparing Equations (3) and (7) we get, M YZ) _ “ (Z) * 2 BZ (8) M Y(Z).=U(Z)] Y bz-* k=0 Expanding the summation we get, Y(Z) = id cee Here Z° = 1; multiplying by U(Z) we get, YZ) = by UZ) +b, 2-1 (Z) +b, Z-2U(Z) + 2 by Z-MU(Z) (9) Taking IZT of Equation (9) we get, Y(m) = Pou(n) +b, u(n~1)+b,u(n=2)+...+b, w(n—M) (10) The direct form implementation of Equation (10) is shown ia Fig, Pat byu(r—M) Fig. 1-2(c) : rect form realization of H, (Z ) (All zero system) Now direct form-II structure is obtained by cascading H, (Z) and H, (Z). That means it is obtained by connecting Fig. I-2(b) and Fig. I-2(c) in series. This is shown in Fig. 1-2(d), All poie system Ail zero system 1-2(d) : Direct form-II realization of IIR system In Fig, 1-2(d), separate delay elements are used. Generally common delay elements are used in direct form-II structure. By using common delays, direct form II structure is drawn as shown in Fig. 1-2(e). Note that here we have considered N = M. Fig. 1-2(e) : Direct form-II realization using common delay elements Computation complexity : ‘The computational complexity for direct form-II realization of IIR is as follows 1. Number of multiplications = M+N +1 2. Number of additions = M+N. 3. The number of delay elements are reduced in direct form-II structure, compared to direct form-I structure, That means the memory locations are reduced. The memory locations required for direct form-II structure are {M,N}. Why these structure are called as direct form structures ? ‘The direct form-I and direct form-II structures are obtained directly from the correspon transfer functions without any rearrangements. So these structure is called as direct form structures. Advantage : The only advantage of direct form realization is its implementation which is easy. We prefer direct form-II structure compared to direct form-I structure; because less memory locations are required. Disadvantage : Both direct form structures are sensitive to the effects of quantization errors in the coefficients. So in the practical applications ; these structures are not preferred. 1g 1,3 Cascade Form Structures : To obtain the cascade form realization; the numerator and denominator of given transfer function H(Z.) is factored into the product of second order terms. ‘Then the total transfer function H (Z) is expressed as, H(Z) = H,(Z)-H,(Z) Hi, (Z) A) Here H,(Z), H,(Z) .. H,(Z) ate second order polynomials. Then each subtransfer function (H, ,H, ... etc.) can be realised using direct form-I or direct form-II structures. The total transfer function is obtained by connecting all second order subsystems. in series as shown in Fig. 1-3(a) yin) = yin) Now we have the general difference equation for discrete time LI system given by, M -k x 4z 0 a Q) 1+ Daze k=1 Since H,(Z), H,(Z) are second order polynomials ; we can write the second order differential equation for H, (Z.) by putting M 2 in Equation (2). H(Z) = 2 dD z* 3) We can obtain direct form-II structure of Equation (3), similar to Fig. 1-2(e). Now, Fig. I-2(e) shows the direct form-II realization for N = M ; that means for M stages. In this case we have second order equation. So by using Fig. 1-2(e) we can draw the direct form structure for Equation (3) by putting M 2. This structure is shown in Fig. 1-3(b). x(n) Fig, I-3(b) : Direct form-II realization of second order subsystem So all such subsystems should be connected in series to obtain the cascade form realization of IIR system. 1.4 Parallel Form Structure : We have the general difference equation for IR systems given by, M yz" ol) By using partial fraction expansion we can express overall transfer function H(Z.) as, H(Z) = C+H,(Z)+H,(Z)+...#H,(Z) wa) Here ‘C’ is constant and H,(Z), H,(Z).. H,(Z) ate second order subsystems. The general block schematic of parallel form realization structure for HR system is as shown in Fig. [-4 x(n) i 5 & Fig. 1-4 : Parallel form reali > yin) ion for IIR system Here H, (Z), H, (Z)..etc. can be realised by using direct form-I or direct form-II structures. ‘Then all these structures are connected in parallel as shown in Fig. -4 to obtain the parallel form realization for IIR system. Applications : ‘The parallel form realization is generally used for high speed filtering applications. Since this is a parallel connection ; the processing of filtering operation is performed parallely 1.5 Representation of Structures using Signal Flow Graphs : Basically a signal flow graph is graphical representation of the block diagram structure. Both the signal flow graph and the block diagram structure provide the same information. For example, we will consider the second order subsystem. We know that the transfer function of second order subsystem is given by, by +b, Z-1+b,Z H(Z) = =) I+aZ7l+aZ ‘We have already drawn the direct form-II realization of second order subsystem (Fig. H-7(b)). For the reference it is again drawn as shown in Fig. I-5(a) and its signal flow graph representation is shown in Fig. I-5(b). Adder node Branching node y(n) x(n) x(n) > y(n) @ b Fig. 15: Direct form-It realization and its signal ftow graph How to draw a signal flow graph ? From the given block diagram realization; it is simple to draw the signal flow graph. The procedure is as follows : 1. Replace all adders by adder nodes. 2. Whenever there are different branches ; draw the branching node. 3. Keep the directions of arrows and the corresponding coefficients as it is. 4. Replace every delay element by simple transmittance branch. For that branch, write Z~! to indicate the delay operation. There is 1:1 correspondence between the signal flow graph and block diagram representation, And the signal flow graph representation is much simple compared to block diagram representation. 1.6 Transposed Structures : If two digital filter structures have the same transfer function then they are called as equivalent structures. By using the transpose operation, we can obtain equivalent structure from a given realization structure. ‘Transposition or flow graph reversal theorem : If we reverse the directions of all branch transmittances and interchange input and output in the flow graph (or given structure) then the system transfer function remains unchanged. It is called as transposition theorem. Procedure to obtain transposed structure and transposed flow graph : 1. Reverse all signal flow graph directions. 2. Change branching nodes into adders and vice-versa. 3. Interchange input and output. ‘The transposed structure for second order subsystem is shown in Fig. [-6(a) and the corresponding transposed flow graph is shown in Fig. 1-6(b). 1 bo x(n) yin) y(n) (anput) (Output) (Outpus) ‘Transposition (a) Transposed structure for second order subsystem x(a) 1 bo 1 bo > — a yl) yin) es x(n) => 4 by o—>—e (b) Transposed flow graph for second order subsystem Fig. 1-6 1.7 Feedback in IIR Systems We have stuilied that, in case of IR systems, feedback connection is present. Thaf means output signal is fed back to the input side. This is also called as a loop. Generally this feedback connection is required to generate infinitely long impulse responses. First we will consider a system where feedback is not used, Consider the difference x(n) equation, y(n)= x(m)+x(n=1)+x(n=2) 0) x(n~1) The block diagram representing Equation (1) is shown in Fig. -7(a. x(n=2) —w Fig, 1-7(a) As shown in Fig. 1-7(a), a feedback path is not present. All the signals simply travels in the forward direction towards output. In this case an impulse response is no longer than the total number of delays in the system. Thus we can conclude that, if loops (feedback connections) are not Present then the system function has only zeros (except for pole at z= 0). To prove this, we will take Z transform of Equation (1), Y(Z) = X(Z)+Z°-'X(Z)+Z7-?X(Z) “ Y(Z) = X(Z)(14Z7'4z7>7] | | | fie a YQ 2 y(zyat4z- ez? X(Z) Multiplying and dividing by Z? we get, 2 eo W(Z) = ae 2) Equation (2) shows that the system has only zeros except the poles at origin. The poles are not present at any other locations, Now consider a system with feedback connection. Let us consider a difference equation, y(n) = 2y(n-1)+x(n) 3) Equation (3) indicates that, the delayed output, y(n—1) is multiplied by constant value *2” and it is added with input x(n). The block diagram representation and signal flow graph is shown in Fig. 1-700). x(n): yin) x(n) y(n) Fig. 1-7(b) If input is an impulse sequence then the single input sample continually recirculates in the feedback loop. Every time an amplitude increases due to multiplication by constant 2. Now taking Z transform of both sides of Equation (3) we get, ¥(Z) = 2Z'Y(Z)+X(Z) 2 ¥(Z)-2Z°'Y(Z) = X(Z) S Y(Z)I1-2Z X(Z) . YZ) yz) = 1 “xz 7) 1-227 . Zz se H(Z) = 555 A) Impulse response h(n) is obtained by taking inverse Z transform of Equation (4). h(n) = 2u(n) (5) Equation (5) indicates that, because of the feedback connection an infinitely long impulse response is obtained. Equation (4) indicates that the system function has a pole other than origin, This indicates the presence of feedback loop, But a network with feedback connection will not produce infinitely long impulse response if the poles of system function cancels with zeros. Solved Problems : Prob. 1: Obtain direct form | and Il realization of a ‘system described by, YOM) FV) By (9-2) = xCM HE KCN=1) Soln, : Calculation of H(Z) : Given equation is, y(n)~Fy(n-1) +4y(n=2) = x(n)+dx(n=1) (1) ‘Taking Z-transform of both sides we get, Y(2)-F2'¥(Z)4h2-Y¥(Z) = X(Z)45Z2-'X(Z) v2) iz ede] = xzfietz-] 2) 4 8 2 J Now the transfer function H (Z) is, HZ) = 3 ‘Thus from Equation (2) we get, ted! H(Z) = — 2 @ ie late We will obtain direct form-I and structures using cascade connection. This cascade connection is shown in Fig. I-8(a), Direct form-1 structure : We have, H(Z) = H,(Z)-H,(Z) Loyal Let H,(Z) = 1432 But H,(Z) = Output _W(Z) Input" X(Z) WZ) _y,17-1 x(z) 7 +32 Wa =xc@[irgen W(Z) = X(Z)+42-'X(Z) Taking inverse Z-transform (IZT) of Equation (4) we get, won) = x(n)+5x(n-1) 8) The direct form-I realization of Equation (5) is as shown in Fig. I-8(b), 1 Now let, H,(Z) = > 3z-t447-2 a 8 = Output _ ¥(Z) Bu (2) = “put = W(zZ) Y(Z) _ 1 W(Z) 35-1,17-2 1 42 +gZ x(n) C)—> win) 3x4) Fig. 1-8(b) : Direct form-I realization of H, (Z) vee) pztegz = wz) 2 Y{Z)-BZY (Z) +427 V(Z) = W(Z) Y(Z) = W(Z) 432-4 (Z)— “Taking IZT of Equation (6), y(n) = w(n)+$y(n=1)-4y (0-2) ) (6) ‘The direct form-I realization of Equation (7) is shown in Fig. I-8(). wo) (0) 3 |Z 4 Tym) L a {fz B y(n-2) Fig. I-8(c) : Direct form-I realization of H, (Z) Now direct form-I realization of total transfer function H(Z) is obtained by cascading Fig. 1-8(b) and Fig. I-8(c). This is shown in Fig. 1-8(¢). Direct form-Il realization : The direct form-II realization is obtained by interchanging the positions of H,(Z) and H,(Z). That means by interchanging block-1 and block-2 of Fig. I-8(4). It is shown in Fig. -8¢¢). Blook- [H2)] Block 2 [Ha(2)] pe 3x(n-1) = LotR, Taking Delay ‘Common, Fig. 1-8) : Direct form-II realization Prob. 2: Consider a causal LTI system with system function, Draw the signal flow graph for implementation of the system using direct form-Il URFT-19 Soln. : The given transfer function is, 143z7 H(Z) = ; ~) (a +3Z Jersoasz ) It can be simplified as follows : 1etzt H(Z) = T 1-05Z7!+527? +0252"! 0.1252~? +0,08332.~* H(Z) 1-0.25Z For the direct form-II structhre, poles are realized first and then the zeros are realized, We can write, H(Z) = H,(Z)-H,(Z) 1 Here H,(Z) = All pole system = 0.2527! +0.208 Z~? + 0.0833 2~ and H,(Z) = All zero system = 140227! consider H, (Z) terms. Output’ W(Z) We have H,(Z) = TEC = xczy WZ) X(Z) — 1~-0.2527' +0.208.~? + 0.0833 2~* . W(Z){1-025271+0.208 2~? +0.08332.~9} =X(Z) oe W(Z)~ 0.2527! W(Z) +0.208 Z~? W (Z) +0.0833 2-3 W(Z) = X(Z) . W(Z)=X(Z)+0.252Z~! W(Z)—0.208Z-* W (Z)- 0.0833 Z~> W(Z) Q) Taking IZT of Equation (2) we get, w(n) = x()+0.25 w(n~1)~0.208 w(n~2) —0,0833 w (n—3) B) ‘The direct form realization of Equation (3) is shown in Fig. 1-9(a). MRFT-20) win) Fig. I-9(a) : Direct form realization of H, (Z) Now consider H,(Z.) that means all zero system, H,(Z) =1+022Z7! Output _ ¥(Z) But H,(Z) = Input ~ W(Z) YZ) _ 402271 W(Z) Y(Z) = W(Z)+02Z7'W(Z) 4) Taking IZT of Equation (4) we get, y(n) = w(n)+02w(n-1) 6) ‘The direct form realization of Equation (5) is shown in Fig. 1-9(b). win) Fig. -9(b) : Direct form realization of H, (Z) Now direct form-II realization is obtained by connecting Fig. 1-9(a) and Fig. 1-9(b) in series (cascade connection). It is shown in Fig. 1-9(c), x) yo) x0) yin) Taking delay in direct formell realization by first drawing. di ft structure take H, (Z) = all zero system, Now the signal flow graph is as shown in Fig. 1-9(d). x(n) y(n) 0.0893 Fig. 1-9(@) : Signal flow graph Shortcut method to draw direct From-il structure : In problem (1) and (2) we have obtained direct form-II structure by considcing the cascade connection, That means by using H(Z) = H,(Z)-H,(Z). Now we will study the shortcut method to obtain direct form-II structure. By using this shortcut method we will obtain direct form-II structure for problem (2). dy-1 1452 In problem (2) the given H(Z) is, H(Z)= z 5 1-0527'+0.2082~? +0.083 2~ ‘The different steps are as follows : Step I: Write down three terms namely input x(n), middle x(n) win) y(n) term w (n) and output y(n) as shown in Fig. I-10(a). @ e e Fig. 1-10(a) : Step-I Step IV: x) win) ve) Check the maximum power of Z_ inverse £ present in the numerator or denominator. It z represents the maximum delay. For the given H (Z) it is ‘3°, This indicates that total ‘3° delay boxes are required. Draw three Z~! boxes below w(n) z as shown in Fig. 1-10(b), z : Fig, 100): Step-II Step TIT: Now consider the numerator term. Check the constant multiplier value. It is 0.2 and it is multiplied by Z~'. So write this value at the R.HLS, and below first Z~ box as shown in Fig. F-10(¢). x(n) win) y(n) . 0) 02 Zz T Fig, 1-10(¢) : Step-I11 Then using the adder complete the connection as shown in Fig. I-10(). ‘Step IV : Now consider the denominator term, Write down the constant multiplier values at the LHS. part of diagram, While writing these values, change the sign. The original constant multipliers are “-0.5° for Z~', 0.208 for Z~? and 0.083 for Z~°. So change the signs of these values and write down at the L-H.S. near the corresponding delay box. Then by using adders complete the connection as shown in. Fig. I-10(d). x(n) win) y(n) ° ° ° yin) Fig. 1-10(d) : Step-IV - This diagram is same as Fig. [-10(c). So by using this simple method; we can directly draw the direct form-II structure, Now applying this method we will obtain direct form-II structure for problem No. (1). In this problem we have obtained the equation of H(Z) as, Here maximum value of Z inverse is ‘2’. So two delay elements are required. For the numerator the constant multiplier value is 5. While for the denominator term constant multiplier values are -3 for Z~! and t for Z~2. After changing the signs we get 3 for Z~! and ~} for Z-2. So we can draw direct form-Il structure as shown in Fig, I-10(e), x(n) win) y(n) ° ° x(n) + vin) oz 3 Fig, 1-10(e) : Direct form-II structure for problem No. (1) Prob. 3 : Develop direct form-II realization of the Wransfer Tundlion. 3+36Z7'+06z72 14012>'-022-? 's it advantageous than direct form-1 ? H(Z) Soin. : For the direct form-I structure we have to realize the poles frst and then zeros, L 140127102277 Let H,(Z) = All pole system = = Output W(Z) Now Hy (Z) Input ~ X(Z) W(Z)[1+01Z71-02277] = x(z) W(Z)+01Z"'W(Z)-022-? WZ) = x(Z) W(Z) = X(Z)-0127!W(z)4022-2 WZ) 0) ‘Taking IZT of Equation (1), w(n) = x(n)-O1w(n-1)+02w(n-2) (2) ‘The direct form implementation of Equation (2) is shown in Fig. I-11(a) win) w(n-1) w(n-2) Fig, I-11(@) : Direct form realization of H, (Z) Now H,(Z) = Alll zero system = 3+3.6Z7'+0.6Z77 But H,(z) = up YZ) Input ~ W(Z) Y(Z) =1 -2 Way 734362 1 +062 2 ¥(Z) = 3W(Z)+36Z7'W(Z)+06Z~? W(Z) +) Taking IZT of Equation (3) we get, y(n) = 3w(n)+3.6w(n-1)+06w(n-2) (4) The direct form implementation of Equation (4) is shown in Fig. I-11(b). 3 win) y(n) win-t Fig, I-11(b) Direct form realization of H, (Z) ‘The direct form-II realization is obtained by cascading H,(Z) and H,(Z.). It is shown in Fig. LU), Taking delay ‘common, Fig. 1-11(0) : Direct form-II realization Now compared to direct form-I structure; nearly half number of delays are required for direct form-I realization. That means, it requires ‘minimum number of storage elements. So it is advantageous than direct form-1 structure. Quick check : We can check the answer by using shortcut method to obtain direct form-II realization. Here maximum delays are 2. The coefficients of numerator are 3.6 for Z~} and 0.6 for 2-2. Now changing the signs, we get the coefficients of denominator as ~0.1 for Z~! and + 0.2 for Z~?. Thus direct form-II realization is shown in Fig. I-11(4), x(n) win) y(a) ° ° ° Fig. I-11(d) : Direct form-II realization using shortcut method ‘Thus Fig. -11(©) and Fig. 1-11(4) are same. Prob. 4 = Obtain direct form-II implementation of LT! system with transfer function. Soln. : For direct form-II structure. All pole system is realized first and then all zero system is realized. | are Let 2 W(Z)-4Z- W(Z)-Z2PW(Z) = X(Z) W(Z) = X(Z)+Z 2-4 W(Z)+4Z>W(Z) wl) Taking IZT of Equation (1), . w(n) = x(n)¢dw(n-1)+5w(n=2) 3) ‘The direct form realization of Equation (2) is shown in Fig. I-12(a). x(n) win) Fig. I-12(a) : Direct form realization of H, (Z) Now consider all zero system. ay eredzrtehg-2 H,(Z) = 142271452 _ Output _¥(Z) Bur HQ (2) = “Tpput = WZ) YZ) 4 45z-141y-2 Wiz) = 1+GZ +62 Y(Z) = W(Z)4227 W(Z) 432? WZ) 3) ‘Taking IZT of Equation (3), y(n) = w(n)+ew(n-1)+Ew(n=2) ) ‘The direct form implementation of Equation (4) is shown in Fig. I-12(b). Fig. 1-12(h) : Direct form realization of H, (Z) ct form-II realization is obtained by cascading H,(Z) and H,(Z.) as shown in “o @rve) Taking delays ‘common. 1 2 + Fig. 1-12(¢) : Direct form-II realization Prob. 5 : A certain discrete time LTI fier has the following data : Poles are at 0.2 and 0.6, Zeros are at ~ 0.4 and origin. Gain of filter is 5. ‘Show direct form-Il realization and cascade form realization. Soln. : Given Zeros = Z, = 0 and Z, =-04 Poles => P, = 0.2 and P,=06 ' Gain = k=5 Pi ‘The transfer function of system is expressed as, Z-Z,)(Z-Z,) (Z=P, )(Z-P,) H(Z) " H(Z) = 3202404) — = oll (@-02)(2-06) © 52422 H(z) = = 422 _ = Bosz+012 Converting into negative powers of Z we get, ; 5+2z7! H(Z) = —2*42_—___. +) -08Z7140.12Z { Direct form-l realization : Using shortcut method, direct form-II realization is shown in Fig. I-13. x(n) win) 0) | (n)-—+ —o- x(n y(n) 08 2 | O12 | Fig. 1-13 i Cascade form realization : According to Equation (1), = _5Z(Z+04) { H(Z) ~ (Z=0.2)(Z-06) { SZ \ = : 8) H(Z) = o> (3) | = 52 | Let Hy (Z) = 5°55 and H,(Z) = 795 Using shortcut method H, (Z.) and H, (Z.) are realized as shown in Fig, I-14 and 1-15, x(n) win) yo) x(n) win) yin) e 2 yin) @— —Q— x(n) 0) oy | yin) E 02 06 oa re I) ig. I-1 Fig. 1-14 Fig, I-15 R ‘The cascade realization is shown in Fig. 1-16. (0) xo 02 oa Fig. 1-16 Prob. 6 : Determine direct-form-II realization for each of the following UTI system (@ 2y(n)+y(n=1)-4y(n—3) = x(n) +3x(n-1) (i) y(n) = x(n) ~x(n=1)+2x(m-2)-3x(n-4) Soin. : @ — Given, 2y(n)+y(n—1)-4y(n—3) = x(m)+3x(n—1) Taking Z-transform of both sides. 2Y(Z)+Z-'¥(Z)-4Z-3¥(Z) = X(Z)+3Z7'!x(z) y(z)[24+z-!-42-8] = x¢zyp143z-4) a1 YZ) _ yz) 14320 2427-47 " Using short-cut method, the direct form-II structure is drawn as shown in Fig, I-17. Fig. 1-17 @ We have, y(n) = x(n)~x(n—1)+2x(n—2)~3x(n~4) Taking Z-transform of both sides we get, Y(Z) = X(Z)-Z7'X(Z)+2Z-?X (Z)-32-*X(Z) Y(Z) = X(Z)(1-Z7!42z°>?-3274] YC2) 2 yz) 21-27! 42272-3274 X(Z) Using short-cut method, the direct form-II realization is obtained as shown in Fig. I-18. xin) wen) yo) x(n) —+ y(n) Prob. 7 : The transfer function of discrete time causal system is given by, 1-z"' 1-022>'-0.15Zz-? Draw cascade and parallel realization. H(Z) = Soin. : The given transfer function is, “1 H(Z) = ——1-2 —_ 5 a) 1-0227!-0.152~ Cascade realization : First we will obtain the roots of denominator, by using the equation, = bt Vb" —dac roots = —PELY = Ane 2a Here a = 1, b =-0.2 and c = -0.15 +¥o00s06 roots = 224 00406 02208 95,93 Thus (1-02Z7'-0.15Z>?) = (1-05z7!)(1403z7!) Putting this value in Equation (1) we get, -1 H(Z) = Zo 22) (1=035271)(1403274) For the cascade realization we have to express H(Z.) as, H(Z) =H, (Z)-H,(Z) Let H,(Z) -@) and let H,(Z) = a) © 1+03z1 Using shortcut method, we can obtain direct form-II structures for A, (Z) and H,(Z) as shown in Fig. I-19(a) and I-19(b) respectively. x0) win) yo) x(n) yin) 0s Fig, 1-19(a) + Direct form-II realization of H, (Z) x(n) wn) yo) oO x(n) > yin) -03 Fig. 1-19(b) : Direct form-II realization of H, (Z) Now for the cascade connection we will have to connect H, (Z) and H, (Z) in series. This series connection is shown in Fig. L-19(0). x(n) -G)}—>- >—(+}»>-G)}> > yin) 0s « “03 Fig. 1-19(¢) : Cascade realization Parallel realization : For the parallel form realization we have to use partial fraction expansion (PFE). It is similar to PFE which we have studied in Z, transformation. ~The given transfer function is, tz! -0227'-0.152~? To convert this equation in terms of po denominator by 2. H(Z) = ive powers of Z; multiply numerator and 0.2Z-015 “ 2 -02Z-0.15 Z =a. 5) 2 -02Z-015 Equation (5) is in the proper form. The roots of denominator are 0.5 and ~0.3. That means poles are at, P, = 0.5 and P, = -0.3 H(2Z) Z-1 Z (Z-05)(Z+03) © In the partial fraction expansion form Equation (6) can be written as, A n@ 4, Z * (Z=-05)*(zZ+03) @ Now we will calculate the values of A, and Ay =(Z- H@ : = (Z-p,) Z 12=p, 5)(Z~1) )(Z+03) Z=08 05+0.3 ~ 0.625 (8) Now A, =(Z-p,) #2) Z », (Z#03)(Z-1) (Z=05)(Z+03) | Z=-03 = 203= ® = Z93-05 A, = 1.625 9) . 2 Putting the values of A, and A, in Equation (7), H(Z 625 , 1.625 Z 5 Z+03 H(z) = = OS2SZ , 16252 ao Z-05 ° Z+03 Remember that, to realize the given transfer function H (Z.); it should be in terms of negative powers of Z. So we will convert Equation (10) in terms of negative powers of Z. as follows : H(z) = 206252) 2°71 (16252) Z'(Z-05) 2-"(2+03) = 0.625 1.625 Panera H(Z) —_——— 1-052"! 1+03Z7! a1) The general structure of parallel form realization is as shown in Fig. 1-19(d). The equation is. H(Z) = H,(Z)+H,(Z) ‘ | { x(n) > +} yin) Hy) > Fig, 1-19(d) : General structure of parallel form realization Now let H,(Z) = 283 (12) 1-052 and H,(Z) = +B (13) 14032 Using shortcut meth he direct form-II realization of H, (Z) and H,(Z.) is obtained as shown in Fig. I-19(e) and Fig. 1-19(f) respectively. x) wry vin) (0.625) x(n) {-—> yin) Hl - 05 (©) Direct form-II realization of Hy (Z) x(n) win) —-yla) . (1.625) x(n) yin) Zz 08 (©) + Direct form-II realization of H, (Z) Fig. 1-19 To obtain the parallel form realization; we have to connect Fig. 1-19(e) and Fig. -19(f) in parallel as shown in Fig. 1-19(g). “os Fig, 1-19(g) : Parallel form realization Prob. 8: A system has an impulse response, hen) =(05)"u(n)+n(0.2)"u(n) show parallel realization of system. Sotn. : First we will obtain transfer function H (Z ‘We have, h(n) = (05)"u(n)+n(0.2)"u(n) wl) 1 Recall the standard Z-transform pairs, Zz Zz 7 oMu(n) os 2 and nau(n) — —#% Z-a (Z-a ‘Thus Z-transform of Equation (1) can be written as, H(z) = 24092 2-05 "(z~02) ® : et 1 { Le (2) = 5 1-05z"! ' The direet form-MI realization of H, (Z.) is shown in Fig. 1-20(a) ! x(0) wo) y(0) x(o) yin) Let H,(Z) = —0.4Z+0.04 Multiplying numerator and denominator by Z~? we get, 02Z7! H,(Z) = — ——s 2 1-04271+0.04z> ‘The direct form-I realization of H, (Z.) is shown in Fig. 1-20(b). x(n) wo) yn x(n) y(n) N 2 z] —__.__| 0.04 Fig. 1-20(b) ‘The general structure parallel form realization is shown in Fig. 1-20(c). > Hy(2) x(1_4] yin) a) Fig. 1-20(¢) Thus using Fig. 1-20(a) and Fig. 1-20(b); we can draw the parallel form realization of H(Z) as shown in Fig. -20(d). x(n) —>} C & os 02 re 0.04 Fig. £-20(4) Prob. 9: Develop parallel form realization for the digital filter with transfer function. 2 1+2Z7'4 1-0.752-'40.1252-* Using first order systems. H(Z)= Soln. : To obtain the parallel form realization we have to use partial fraction expansion, The given transfer function is, 142z7'4Z7? 1-0.7527'+0.1252~? To convert if in terms of positive power of Z; multiply numerator as.d denominator by 22. _ 24+ H(Z) = Al) H(Z) = 2075740125 HZ) _ Drei % 2 22 ~0157+0.125) Now we will obtain roots of Z?— 0.75 Z + 0.125 0.75 and c = 0.125 abe Ve Here a = 1, b roots 40.125) _ 0.75 £0.25 a) roots = 0.5, 0.25 ‘Thus Equation (2) becomes, H(Z) _ D+IZ+1 @ Z ~ Z(Z-05)(Z-025) Thus poles are at p, = 0, p,=0.5 and p, = 0.25 In the partial fraction expansion form, Equation (3) can be written as, H(Z) _ 4) Zz Now A, = », ~ Z(Z-05)(Z-025) ~~ | 2=0 A = 8 (5) A) y¢7_ PP «(Z-p) 24h | A Z(Z-025) 2 A, = 18 (6) H(Z) and Ay Z *(Z—P3) z=», 1 x(Z-0.25) 5)(Z-025) 25) | 7 = 02s a =f 25 )?+2(0.25) +1 3 0.25 (0.25 -0.5) Ay = -25 : ) Putting the values of A,, A, and A, in Equation (4) we get, H(Z Zz H(Z) (8) To realize H(Z); we want the expression in terms of negative powers of Z. H(Z) = 84-2 108Z)__Z71(25z Z-'\(z-05) Z-1(z-025) H(Z) = 8+—8__ 3 (9) -05Z-! 1-0252~ Let H, i (Z) H(z) = —B_ 1-05Z xo) wo) 0) and Hy (2) = 38 18 1-0.25Z x(n). 5s vin) Using shortcut method; direct form-II realization of H,(Z) and H, (Z) is obtained as shown in Fig. L21(a) 3 and I-21(b) respectively. Os Fig, 1-21(a) : Direct form-II realization of Ho (Z) x(0) mo) yl) wre vio) 025 Fig. 1-21(b) : Direct form-II realization of H, (7° Now H, (Z.) = 8; which is constant. So it can be expressed as, Y,(Z) H(Z) = X@ Y,(Z) = H,(2)-X,(Z) = 8X,(Z) Taking IZT of both sides we get, y(n) = 8x,(n) (10) Using Fig. 1-21(a), Fig. 1-21(b) and Equation (10); the parallel form realization is drawn as shown in Fig. I-21(c). 0.25 < Fig. I-21(c) : Parallel form realization Prob. 10 : Sysiem has transfer function as shown in Fig. 22, | HZ) \ x(n) —4 +] Hal2) >in) He) Fig. 1-22 H,(Z) and H, (Z) has poles at +1 and ~ 1 H, (Z) has two zeros at origin, H, (Z) has only one zero at origin. The transfer H, (2) is given by, H,(Z) = 141527'-152-7~ ‘Show realization diagram of overall transfer function. Soin. : First we will obtain expressions of Hy (Z) and H,(Z), For H,(Z): Zeros => Z, = 0 and Z, = 0; two zeros at origi Poles = P, = (Z-2,)(Z (Z=P,)(Z-P,) Now H,(Z) = W@ = GaGa For Hp(Z) : Zeros =Z, oO Poles = P, = 1 and P, Now H,(Z Gy) mM) = eae Zz "(= Gay Realization of H,(Z) : 2 We have Hy (Z) "pa ea 1 1-27? Direct form-II realization of A, (Z) is shown in Fig. 1-23(a), H,(Z) = (0) win) ¥(0) +O $y x(n) ‘ Fig. 1-23(a) Realization of Hy (Z) : Zz We have, H,(Z) = man H,(Z) Z2 (1) (2) { 1 Direct form-II realization of H, (Z) is shown in Fig. 1-23(b). x0) wa) y(n) 1 y(n) 1 Fig. 1-23(b) Realization of H3(Z) : We have, H,(Z) = 1415Z°1-15Z77- Direct form-II realization of H, (Z) is shown in Fig. 1-23(c). xin) win) yin) x(n) —+- y(n) a Fig. 1-23(¢) Realization of overall transfer function : As shown in Fig. 1-22, H,(Z) and H,(Z) are connected in parallel and this parallel combination is cascaded with H,(Z.), Thus realization of overall transfer function is shown in Fig. 1-23(@), Fig. 1-23(4) Prob. 11 : For the graphs of Figs. -24(a) and (b) wile difference equation and ayalem Tunclon x(n) xn) (b) Given graph Fig. 1-24 ‘ Soln. : For graph (a) : By looking at the graph; we can easily conclude that it is a cascade connection. We know that in direct form-II structure poles are realized first and then zeros are realized. That means first part of Fig. 1-24(a) indicates all pole system and second part indicates all zero system. We can easily write the difference equation for the graph shown in Fig, I-24(a). It is, 1 1 5 1 y(n) = x(n)+ex(n-1)+gy(n-1)-3F (n-2)-Fyy(n-3) (1) This is the difference equation for the given graph. Now system transfer function is denoted by H(Z). It is obtained by taking Z. transform of Equation (1). dyn Iy-ty(zy-S2-2v(zy- 4g Y(Z) = X(Z)+gZX(Z)+gZY(Z)-gaZ°¥(Z) 22 ¥(Z) Y(Z) xcan[ gz eva] 52 * Ye@)-¥D)] FE 3g 24 1S reat ~ yz (2) ‘The system transfer function H(Z) is given by, H(z) =X X(Z) Thus from Equation (2) we get, YZ H(Z) (Z) (3) x N For graph (b) : Now consider the graph shown in Fig. I-24(b). From this graph we cannot directly write the difference equation because first part of Fig. 1-24(b) indicates the feedback operation (observe the directions of arrows). So we have to write the equations by considering w (1). own) = x(n) +3w(n=1)+1w(n=2) 4) and y(n) = w(n)+ly(n-1)+2y(n-2) (5) Taking Z transform of Equation (4), W(Z) = X(Z)+3Z°'W(Z)+Z-? W(Z) W(Z)-3Z7'W(Z)-Z7? W(Z) = X(Z) w(z)[1-327!-2-?] = x(z) w(Z) 6) X(Z) 1- © Now taking Z transform of Equation (5), Y(Z) = W(Z)+Z7!¥(Z)+2Z7?¥(Z) Y(Z)-271¥(Z)-2Z77¥(Z) = W(Z) y(z)[1-z-!-2277] = woz) xy 4 aa) W(Z) -Z"'-27 Now system transfer function H (Z.) can be expressed as, nz) = YZ). YZ), WZ) X(Z)” W(Z)" X(Z) H(z) = Y@l = xy (1-27'-2277)(1-32-!-272) H(z) = YZ) poo X(Z) 0 -3g-t 8 Z'432-7 423-972 462-342z-4 YZ 1 H(z) = YZ (8) . X(Z) 1 -42-1472-342774 ‘ Equation (8) gives the transfer function of overall system. To obtain the difference equation of overall system; we will take IZT of Equation (8). Rearranging Equation (8) we get, Y(Z)(1-4Z7 44727342774) = x(z) * ¥(Z)-4Z7!¥(Z)+7Z-4Y (Z)42Z-4¥(Z) = X(Z) & Y(Z) = X(Z)+4Z-''¥(Z)-7Z-9¥(Z)-27-4¥(Z) Now taking IZT of both sides, y(m) = x(n)+4y(n-1)-Ty(n-3)-2y(n—-4) (9) Equation (9) represents the difference equation of overall system. Prob. 12 : Using first order sections, obtain cascade realization for (qatz-tVWqyto ue \(vae ) H(Z) = ——~—___ AA ta-1)(qy 4 z-1)fy 45-1 eee) Soln. : We know that for cascade realization the given transfer function can be expressed as, H(Z) =H, (Z)-H,(Z)-H,(Z).. Thus the given transfer function can be expressed as, (4 H(Z) = | } ly-1 143271 y(Z) Here H,(Z) X(Z) 2 cr 1-32"7) 2xcay(1492"') Y,(Z)-g21Y,(Z) = X(Z)+$2Z"'X(Z) ¥,(Z) = X(Z)+42Z°X (Z)+G ZY, (Z) Taking IZT of both sides, y(n) = x(n) +gx(n=1) 459, (0-1) (1) It is realized as shown in Fig. 1-25(a) xin) + = > ¥4(0) x(t) 12 42 y(r-1) ~ Fig. 1-25(a) Is direct form-II realization is as shown in Fig. I-25(b). x(n) yy() 12 12 Fig. I-25(b) : Direct form-IT 15-1 1g) wy) 1 X,(Z) Now H,(Z) = a dy-1). dy y,(z)(1-42 Josm(ige } Y,(Z)-42-1Y,(Z) = X,(Z) +421 X, (2) 1y-1 1y-1 2 Y,(Z) = X,)(Z)+gZX,(Z)+ G2" Y,(2Z) Taking IZT of both sides, : 1 Ym) = x (m)+Gx(n=1) +49, (n= 1) 2) Its realization is as shown in Figs. 1-25(c) and -25(@). (©) Direct form-1 [ee (@y Direct form-It Fig. 125 Now H,(Z) =. (2) Ze! X(Z) 15-1 vea(qz ) = X,(Z) vate i2) =x,2) Y(Z) 0 Lyn X(Z)+gZ Y,(Z) Taking IZT of both sides, y(n) = y(n) +h y(n-1) 3) Its realization is as shown in Fig. 1-25(e) x3(n)- tT yin) z ve yin) Fig. 1-25(e) Now cascade realization is obtained by cascading the direct form- Il structures of H,(Z), 1H, (Z) and H, (Z) as shown in Fig. 1-25(0) lg y(n) ; 1) ya{n) = x31) P ? 8 z 12 12 14 14 118 Fig. 1-25(0) Prob. 13 : Determine the parallel realization of the IIR digital fiter transfer functions. fy _ 8022? +5244 O M2) = Core ty(Z42) (i) H(z) = S2082=2) “Gl (23 ee _ 3002-5244) @ Given H(Z) = Oy z42) Multiplying numerator and denominator by ; we get, (22245Z44) Pz H(Z)= 3 H(Z) = 1 ag jezea) 2,15 wiz) ep Z+ 2 2{z+} \z+2) In the partial fraction expansion form we can write, vie +p) —41_.%, =3/4 3 (242)(3+Bz40 -12 and A, = 2(z+3 }i2s2) | 12-15+12) 9 (af-2eg) -2)f- 12Z 3Z. Z)=2- 3Z_ H(Z)=12 Z42 | H(Z) = 12-—2_ ,_3 ape! ieac! In the general form we can write, (2) =H, (Z)+H,(Z)+H,(Z) Here H,(Z) = 12 H(z) = -—— =i 144z 2 and H,(Z) = —3— 143271 | ‘The general structure of parallel form realization is shown in Fig. 1-26(a) H(z) Tre E)—> Yon) x(n) He Fig. 1-26(a) Using short cut method, it can be realised as shown in Fig, 1-26(b). w H(Z) = Yr) H(Z)___3(52~2) z+} \(az-1) 2 (292 ]o2-» 15Z-6 . (ez ]}o%-) Multiplying numerator and denominator by 3 we get, SZ-2 In partial fraction expansion from we can write, and HZ) _ H(Z) = GUS)Z_(215)Z * Z+p 0 Z~ In the general form we can write, H(Z) = H,(Z)+H,(Z) Using short cut method it can be realized as shown in Fig. 1-26(c). 2715 © oy 12 > xin ? Y(n) 215 ® va Fig. I-26(c) 18 Lattice Structure for IIR Filters : We have studied lattice structure for FIR filters. For the reference, recall system transfer | function of M™ order FIR filter. It is, M Hy(Z) =1+ DY BYy(K)Z-% Med wa) K For this transfer function, we have obtained single stage lattice structure as shown in Fig. 1-27, x(n) Ly, Bo(n) Fig. 1-27 With the help of this structure shown in Fig. 1-27, we will discuss how to draw’ lattice structure for IIR filters. Consider all pole UR system, For this system the transfer function can be expressed as, . 1 H(Z) = —~y——_ 2) 1+ YD By(Kyz-¥ K=1 We know that H (2), is a transfer function, which can be written as, H(Z) = 72. By (K)2-* Y¥(Z)#¥(Z)} YL By(K)Z-*] = X(Z) H Kel | Here Y (Z) is independent of summation. So it can be transferred inside the summation. N | ¥(Z)+ YD By(K)Y(Z)Z-K = x(Z) 1 Kel = N et | o¥(Z)= - DY By(K)Y(Z)- 2-8 + x(Z) (3) ! K=1 Taking inverse z of both sides we get, 1) N ( y(n) = - Y By(K)y(m-K) + x(n) a) in It Kel Now we will interchange the role of x(n) and y(n). x(n) =~ YD By(K)-x(n-K)+y(n) K=l Rearranging the terms we get, N y(n) =x(n)+ YD By(K)x(n-K) (5) K=1 Taking Z transform of both sides we get, N ¥(Z) =X(Z)+ DY By(K)-Z-*x(z) ce K=1 N ¥(Z) =X(Z)| 1+ DY By(K)Z-* K=1 . H(z) =X. N -K xz) XD ByK)Z O) 1+ K=1 Observe Equations (6) and (1). Equation (1) is for all zero FIR system and Equation (6) is for all pole IR system. Both equations are same, That means we can obtain lattice structure of IR system by interchanging the role of input and output. ‘Thus interchanging the role of input and output; from Fig. 1-27, we can draw single stage lattice structure of IIR system as shown in Fig. 1-28, Forward, —es Ax(n) = x(n) By(n) Fig. 1-28 slems always require feedback which is shown in Fig, cusacs| Here we have interchanged x(n) and y(n); thus the directions of arrow lof x(n) and y(1)] are also reversed. This same structure is drawn properly as stiown in Fig. 1-29. Forward oe Feedback Fig. 1-29 To obtain two stage lattice structure we will put N = 2 in Equation (4) 2 = y(n) = = Do BY(K)y(n-K) + x(n) a) K=1 ‘This is the difference equation of two stage lattice structure. We know that two stage lattice structure is obtained by cascading two single stage lattice structures. It is shown in Fig. 1-30. — yin) i Single stage > Single stage ———+ Fig, 1-30 Similarly we can draw n"" order lattice structure as shown in Fig. 1-31. (0 Ayiln) Ate) Ag(n) = y(n) Output x) >—-E ce ¢ Anta) kn ke Ky ky ke ky Buln) Byln) Bon) Fig. 1-31 1.9 Lattice-ladder Structure of IIR Filter : Consider all pole IIR system. For this system the transfer function can be expressed as, H(Z) = _) a+ Y BycKyz K=1 ‘The difference equation for this IIR system is N y(n) =x(n)- Y By(K)y(n-K) K= This equation is realized in lattice form as shown in Fig. 1-31. Consider an IIR filter with system function, (2) For numerator of Equation (2) we have constructed a ladder structure as shown it. Fig. 1-32(a), Thus, a lattice structure for Equation (2) can be constructed by first 1 -lizing an all-pole lattice coefficients for the denominator and then adding a ladder part as shown in 13, 132(b). wo t= Ay(n) ky “ < t ri \« Byln) Z z Bo(n) 1Cy Cy y(n) (b) Lattice-ladder structure for realizing a pole-zero IIR filter Fig. 1-32 ‘The output of the ladder part can be expressed as a weighted linear combination of B,(n), Thus, output is given as, N yiny= DY CBA (n) m=0 where Co are called the ladder coefficients. 1.9.1 Conversion from Lattice Structure to Direct Form : The difference equation for an IR filter is given as, N y(n) =x(n)~ YY By(K)y(n-K) +) K=1 For N = 3, Equation (1) becomes, y(m) = x(n)—B (1) y(m~1)~B, (2) y(n-2)~B, (3) y(n—3) Q) | ( i | | ‘The general equations from the lattice structure shown in Fig. I-31 are, given as, y(n) x(n) An (2) B, (a) For N = 3, y(m) x(n) Aj(n) A,(n) Ay(n) A\(n-1) B,(n) B,(n-1) B,(n-1) B, (n-2) Ay(n) =By() Ay(n) A,-1(2) + KB, )(2-1) m= NN-1,..41 Ky Ag-1 (2) + B,_,(n-1) m= N,N-Ly.e51 ., Equations will become, Ag(n) =B,(n) Aj(n) A, (0) +K,B, (-1) A, (1) +K,B, (n-1) Ag(n) +K, By(n-1) Ag (n= 1) #K, By (0-2) K,A,(n)+B,(n-1) KA, (0-1) +B, (n-2) K, Ay(n-1)+B,(n~2) K, Ay(n-2)4By (0-3) From Equation (8), x(n) = A,(n) x(n) = A,(n)+K,B,(n-1) A, (9) +K,B, (n= 1) +K] KA, (n= 1) +B, (1-2) ] y(n) +K, By (n= 1)+K,] Ky Ay (m1) +By (m= 2) ] +K[K[Ap(n- +, By(n=2)] +K,A,(n-2)+By(n—3) ] ~-@) (4) (5) fT) sn(8) (9) (10) (1) (12) (13) AA) 13) (16) Ay (m)+K, By(n=1)+K, K, Ay(n-1)+K, By(n-2)+K, K, Ay(n—1) +K,K,K,B,(n-2)+K, K, A,(n—2)+K, By(n—3) y(n+ [Ky + KK + KK] y(n) +[Kk K,+K, KK, ] y(n-2)+K,y(n-3) = 9094+ [ Ky HFK) HIG KG Jy (0-1) 4 K+, K 14K] y(a-2) +K,y(n-3) We have, By (1) = K, (14+K,) x(n) = ¥C™# [BCD + B29, (3)] y(n) *[B2(2)+B,(1)B,(3)]y(n~2)+B,(3)¥ (m3) s y(n) = ¥(n)~ [By(1)B,(2) 8, (3)]y(n~1) ~[Ba(2) + B,1)B,(3)] ¥(m~2) ~ B(3yy(n~3) a7) Comparing Equations (2) and (17) we get, B,(0) = 1 Bs(1) = B,(1)+B,(2)B,(3) By(2) = B,(2)+B,(1)B,(3) B,(3) = B,(3)=K, ‘Thus, above equations in general form can be written as, B,, (0) = Bu (K) = By (K) + By) (K~1)B, (my B,(m) = K,, Using these equations, we can convert lattice structure to direct form. 1.9.2 Conversion from Direct Form to Lattice Structure : For N = 2, Equation (1) becomes, ym) = x(n)-B, (1) y(n=1)-B, (2) y(n=2) as) From equations (8), (9) and (13) we can write x(n) = A,(n)= A,(n)#K,B, (n=1) +19) and B,(n) = K,A,(n)+B,(n—1) B,(n-1) = B,(n)-K,A,(n) Putting in Equation (19), we get, x(n) = A; (1) = A, (0) +K,B, (n)~K3A, (n) se Ay(n) = 4,()[1-K3] + K,B,(n) A, (n) ~ K,B,(n) 1-K} 2 AS(n) = (20) URFT-59 Now let us first find value of A,(n)~K,B;(n) 2 Ay(n)-K,B, (nm) = A, (0)+K,B, (2-1) “Ky KA, (0) +B, (2-1) ] = Ay (1) +K,B, (0-1) + Kl KA (a1) + By(n=2)] -K, [Ka[ Ao(m)+K By(a~1) ] +K, A, (n-1)+B,(n-2)} Ag (1) +K, By(n-1)+K, [Ki 406m?) + By(n-3)] #K Ky [Ap (9 1)+K, By (n—2)] +Ky[K, Ay (9-2) #By(~3)] ~K,K, Ay(n)-K, K, K, By(n—1)-K, K, Ay(n-1)-K, By(n-2) = Ay (nm) +K, By (n-1)+K, K, Ay (n-2)+K,By(n-3) +K,K, A, (n-1) +K, K, K,B,(n-2)+K, By(n—3) +K, K, Ag (n-2)-K, Ky Ap (n)~K, K, K, By (n=1) ~K, Ky Ay(n-1)-K,B) (0-2) y(n) +B, (1)y (n= 1) +B; (2) y (m2) +B, (3) (n= 3) -K,B,(3)y (1) -K,B,(2)y(n-2)-K, B, (1) y(n-1) ~B,(3)y(n-3) [1-82 ]y(s [BBs BB] yD + [B,(2)-B,(2)B, (3) ]y(n=2) Putting in Equation (20), we get, - (1-5 reo 8,099, 2) B27 Jy O14 8,2), BD] >) Ayia) = 4 (OK B,(1)~B, (2) By (3) 8, (2)-B, (2) B,(3) 2 A (n)s y(n) + y(n) p(n?) 21) 1-K, 1 K Comparing Equations (18) and (21), we get, B,(0) =1 _ By(1)~B(3)Bj(2) BCD) = 1-B3(3) MRFT-60 2)- 2 3 g(a) = P(D=B2B) 1-B5(3) Thus, in general these equations can be written as, B,,(m) = K, B,_,(0) = 1 By (K)~B,, (1m) B,, (m1) 8, (K) = 1-B2 (m) Using these equations. we can convert direct form to lattice structure, 1.10 __ Ideal Filters and Approximations : ‘Two important characteristics of ideal filters are (1) Ideal filters have constant gain in the passband and zero gain in the stop band (2) Ideal filter has linear phase response, In order to realize (design) digital filter, an important condition is that; the response of filter should be causal. We have studied a causal LTT system. Impulse response of causal LT! system is denoted by h(n). Now system is causal when h(n) has some value for positive values of ‘n’ and h(n) is zero for negative values of ‘n'. Thus the condition of causality can be summarized as, h(n) =0 forn<0 oO) AS an example, let us consider the magnitude response of. IH(o)l ideal low pass filter (L.P.F.). It is shown in Fig. 1-33(a). | Here, ©, = Cutoff frequency Pass: A ae Fig. 1-33(a) : Magnitude response of ideal LPF and 1H (@)1 = Magnitude of filter As shown in Fig. 1-33(a), the magnitude is ‘1’ in the frequency range -@, 0 +0, That means, 1 for~@. y(n) Fig. 134 @.2 Realize the following transfer function using direct form-Il structure 41402Z-'-0.27-% HQ) 2 02Z°'+03Z7-74279 Ans. + Fig. 1-35 @.3 Obtain cascade realization of discrete time linear causal system defined by difference equation 3 1 = tyne yon) Gy (n-1) + gy(n—2) =x(n)+gx(n-1) Ans. : @ Gi) ii) . Fig. 1-36 A system is described by transfer function H(Z) is given by H@) = 3442-2, Z-5 z-4 2 4 (Does this H(z) represent FIR or IIR filter, why 2 (ii) Give difference equation realization of this ‘system using direct form-! and draw the structure. (il) Draw the block diagram for direct form-II canonic realization and give the governing equations for implementation. The given system has poles as well as zeros. So it represents IIR filter ; because FIR filter is always all zero system, x(n). + yin) 076 {x} 9.125 Fig. 1-37(a) x(n): Fig. 1-37(b) eR @ i) A system function is specified by its transfer function, (Z-1)(Z-2)(Z41) (2) [2-(242)][2-(2 3 Ves )eo] Realize the system function in folowing forms (Direct form (i) Direct form. (il) Cascade of two biquadratic sections. HQ) (jv) Parallel realization in constant, linear and biquadratic sections. x(n) z +(e) A 2 7 +1 3 5 Fig. 1-38(a) x(n) yin) Fig. 1-38(b) Wy) Q.6 = Obtain H(Z) = Ans, : Fig. 1-38(0) 5.5966 x(0) —| 914 z ooges HF Fig. -38(d) parallel realization of a system described by, (4-0527')(1-2"') (1-02Z°1)(1+08Z7')(1-08Z 04 L_,__} 08 Fig. 139 @.7 A system is cascade combination of two subsystems z Zz and H,(Z) = 5<— Hy(z Z+4 )* y257z408 () Realize it using parallel form (ii) -—_Draw its poles and zeros. ‘Ans. : @ aj z i -0.196 x) O~ yin) 7 o 29 ogy 7 z 2.28 i) Fig. 1-40(b) Q.8 A system is described by the following difference equation 1 1 - Y(M) $Y (M1) -Fy(n~2) = x(n) () Find step response of system. (i) Realize the system using parallel realization. Compare the number of elements used for parallel and for direct forme. (til) Draw its poles and zeros. Ans. : @ ym = 3(z] wa) Jocasfa rac 3 > 5 | Zz. x(n) + y(n) 2 D+ 5 7 z at 3 (a) Parallel form Fig. 1-41 (i) Comparison between parallel and direct form-II Parallel Ans, : @ i) Gail) ‘System function of initially relaxed causal system is given by, 0.7 (2+08)(Z-06 H(z) = 272408) (2-06) @ 2-012-0.72 (Find the corresponding difference equation of system. (ii) Realize the filter using parallel form. (ii) Find impulse response of the fiter. y(n) = Ol y(n—1)+0.72y (n= 2) +0.7 x(n) -0.252x(n=2) 0.35 x00) mance ) -T 09 © 144 Fig. 1-42 h(n) = 0.35 +0.205 (0.9 )"u(n) +0.144 (-0.8 Pu(n) @.10 A causal LTI system has a transfer function, H(Z) = H,(Z)-H,(Z) where, 1-02z7' Hy (Z) = 4-922 — ' 140527! 4 Hy(Z) = =I ° 1+03Z°' () If the system is stable, give its ROC condition. (i) Show cascade and parallel realization, (ii) Find impulse response of the system. (iv) Find the system response if X(Z) = —1_ 14+02Z71 (¥) Draw the pole-zero diagram. Ans. : @ ROC: ZI>05 Gi) x0) —e>4 a) 1 x 7 + + 05 02 -03 Fig, 1-43(a) : Cascade realization } x(0) LE yy 05 02 | zi “os Fig. 1-43(b) : Parallel realization Gi) h(n) = 3.5(-0.5)"u(n)-25(-0.3)"u(n) (iv) y(n) = 5.83(-0.5)"u(n)-7.5(-0.3)"u(n)+2.67(-0.2)"u(n) ww) unit circle Re (2) . @. 11 Fig. -44(a) shows direct form-II realization of !IR filter. (a) Obtain direct form-! structure. (b) Find transfer function H(Z) of filter. (©) Realize the filter using cascade form using first order modules. (d) Find impulse response of filter. (e) _ Show pole-zero diagram of fiter. Fig. I-44(a) | Ans. : | @ | | ' | Fig. 1-44(b) ) H@) { | © x0) +@}— > >) >A OP vi ( { a i z z : < > < +. i We va ve 12 Fig, L-44(@) @ © ha) = 25cnrea(d]ecnr-s(gfocm 2 8 Fig. 1-44(a) FIR Filter Design zz Ld mE mE | _ Name of the Topic Introduction Symmetric and Antisymmetric FIR Filters Design of FIR Filters using Windows Design of Linear Phase FIR Filters using Frequency Sam Alternation Theorem in Equiripple Linear Phase FIR Filters FIR Differentiators “Coie: ses | 1.1 Introduction : FIR stands for Finite Impulse Response. FIR filters are called as non-recursive filters because they do not use the feedback. Before studying the design of FIR filters; we will discuss one important characteristic of FIR filter. 1.1.1 FIR Filters are Inherently Stable : We know that LSI system is said to be stable if bounded input produces bounded output (BIBO). We have the difference equation of FIR filter, M-1 y(m) = Yb x(n-k) eo) k=0 Taking Z transform of Equation (1) we get, M-1 Y(Z) = Yb z-*x(z) (2) k= Now transfer function, H(Z) = xD ‘Thus from Equation (2) we get, Y(Z) H(z) = “ = <7) ® ‘Taking IZT of Equation (3) we get >, For 0Snh(0 (8-1-0)=h(7) Forn=1 = h(1)=h(8-1-1)=nh(6) ete. If h(n) is symmetric then, the filter is symmetric. Now unit sample response of FIR filter is antisymmetric if it satisfies the condition, h(n) = -h(M-1-n), n=0,1..M-1 (2) If this condition is satisfied then the filter is antisymmetric Now the phase of FIR filter is given by, -o(*S*) for 1H(@)I > 0 2 ZH(o) = 3) -o zs for |H(@)1 <0 This equation shows that the phase of FIK filter is piecewise linear. Thus for the symmetric FIR filler can be characterized by, M-1 H(Z) = ¥ h¢(kyz-* 4) k=0 Here M is the length of filter and M—1 is the order of filter. The frequency response for different conditions is as follows a @ 3) If M is odd and symmetric then, H(al®) =e =iOM=D) If M is odd and antisymmetric then, H(e®) = »l If Mis even and symmetric then, My 2 H(e) = 2 yr h(n) cos n=0 (4) If Mis even and antisymmetric then, M F-1 H(e) = 2 z menan( Je n=0 1.2.1 Magnitude Specifications : ‘The magnitude specifications of FIR filter are as shown in Here 6, = Peak passband deviation 8, = Stopband deviation ©, = passband edge frequency ©, = Stopband edge frequency o,- 0, Af = Transition width = 2m Passband ripples Fig. J -1 : Magnitude specifications Thus the magnitude specifications of FIR filter can be written as, 1-85 IH(@)Is1+8, for 0 < asa, and 0 $ 1H(@)I<8, for oS @sn ‘These are the magnitude specifications. For the phase response, we have assumed a linear phase. Therefore while designing the FIR filter only the symmetry of the filter is indicated, A FIRFD-S 1.2.2 General Filter Coefficient Equation : ‘The FIR and TR filters are basically Linear shift Invariant (LSI) systems which are characterized by unit sample response. The FIR system has finite duration unit sample response, as follows, h(n) =0 for n <0 andn>M. FIR system is a nonrecursive system i.e. it depends only on past ‘and present input, The difference equation of LST system is given as, N M y(n) = - DY ay(n-K) + Y) bx(n-K) (1) K K=0 But, the first term represents past outputs and second term represents past and present input, Hence, the difference equation for FIR. system is, M y(n) = Y byx(n-K) (2) K=0 If we consider ‘M’ coefficients, then M-1 y(n) = DY dgx(n-K) (3) K=0 Taking ‘Z’ transform of both sides, M-1 ¥(Z) = DZ *EK(Z) K=0 yi) un = y y&z* (4) K=0 Y(Z us, 1D = nz) 6) which is a system function of FIR system. Hence, from Equation (4) and (5), M-1 H(Z) = DY &z* (6) K=0 ‘Taking inverse ‘Z’ transform of Equation (6) we get, unit sample response of FIR system as, b, for O h(n)Z"=0 (2) n=0 We have to show that 1 of Z;1 is also zero of H(Z). M-1 o XY aay (Z n=0 M-1 ) XY biz (3) For the linear phase FIR filter, we have the condition h(n) = h(M-1-n). Putting this value in Equation (3) we get, M H(Z>') = YY h(M~1~n)z* (a) n=0 Substitute M—1-n = p> n=M-1-p ‘The limits’ will change as follows : When n=0,p=M-1 and when n = M—1, =0 M-1 d= XY h(pyzh-t-e p=0 H(Z, M-1 H(Z> XD h(pzi'2yr p=0 M-1 H(Z;') = 2M! YS h(p) zy? ~) p=0 Now changing the variable in summation; p by n we get M-1 H(Zy*) = 2) Yn) ze a) n=0 According to Equation (2); the summation term is H(Z, ) and it is zero. 2s H(Z; ZM-l.gs0 +) Thus from Equation (7) we can conclude that Z> 1 or $ is also zero for linear phase FIR 1 filter. Prob, 2: A fourth order FIR filter has following two pairs of complex conjugate zeros, aif alt 3 3 2.2% and Z,,Z,=2¢ State whether the filter has linear phase property. Soin. : ‘The order of FIR filter is given by N~1; in this case order is 4. Thus N—1 = 4. That means these are four poles and four zeros. Given zeros are = iz 3 3 e ix 3 Z,=2e°, Z,=2e -ins3 For FIR filter zeros occur in reciprocal order. That means if Z, is the zero of system then + 1 is also zero of the system. But for Z; and Z, this condition is not satisfied. Thus this filter will not have linear phase property. Prob. 3: Frequency response of a fter is given by, H(e) = 8 [2+ 1.8 cos 30+ 1.2 cos 20+ 0.5 cosm) Find impulse response h(n) of a fitter. Soin. : Given frequency response is, H(e) =e 1241.8 cos 3@ + 1.2 cos 20 +.0.5 cos w } 1) FIRFD-8 Now the phase is given by, = ejo(Ma1) . Moles Ms O(@) =e 7 Sook oMs7 That means length of filter is 7 and order of filter is 6. Since length is odd we have the ‘expression for frequency response as : H(e®) = Here M = 2 eM! n(3)+ Y n(n) cos{o(n~3)} n=0 He) H(e®) = eF5 Fh (3)+2h (0) cos 30+ 2h( 1) cos 20+ 2h (2) cose} (2) ‘Comparing Equations (1) and (2) we get, h(3)=2, 2h(0)=18 = h(0) =09 Mh(1)=12> CL and 2h(2) = 0.5 = h(2) = 0.25 Since length of filter is M = 7; there are 7 samples in the impulse response from h (0) to h(6) ‘Now for linear phase filter we have the condition, h(n) =h(M~1-n) n= 0,1 .M=1 For n = 0 > h(0)=h(7-1-0) =n(6) (6) =h(O) Forn = 1 = h(1)=h(7-1-1) =h(5) obj) =h(1) For n = 2 = h(2)=h(7-1-2)=n(4) (4) =h(2) = 0.25 Thus impulse response h(n) is, h(n) = { hO), b(), 2), m3), W), h(S), h6) } h(n) = { 09, 0.6, 0.25, 2, 0.25, 0.6, 0.9 } Prob. 4: 4 tinear phase FIR titer has response given by e-". What ls the order of fiter 2 Justity your answer, Soln. : Assume filter is symmetric, When M is odd and symmetric then the frequency response is given by, M-3 io( Met H(e®) se? the 2) Here represents phase 0 ( ©). given phase is 6(@) = e270 Comparing these two equations, a oM-1=4 Here M represents length of filter = 5 and M1 represents order of filter. Thus order of filter is 4. Prob. 5: Prove that a linear phase FIR filter having antisymmetric coefficients cannot be a high-pass filter. oR To design a high pass linear phase filter, which type of linear phase filter can be used ? Soln. : Let ‘M’ be the order of filter. When M is even and antisymmetric we have, M zh [He | =2 ¥ h(n)sin A) n=0 ‘And when M is odd and antisymmetric, +2 > eapan (2) n=0 In Equation (1), at @ = 0, 1H (e)! = 0 and in Equation (2) for oS ). 0; at @ = 0, 1H (e)| = 0, Thus low pass filter cannot be designed using antisymmetric coefficients. Now when M is even then at the frequency @ = m, the response 1H (e™)| is zero. Thus it is not possible to design a high pass filter. For the design of high pass filter Hilbert transforms can be used, 1.3 Design of FIR Filters using Windows : Different types of windows are used to design FIR filter. First we will discuss the design of FIR filter using rectangular window. The rectangular window is as shown in Fig. 3-2 It is denoted by Wy (n). Its magnitude is 1 for the range, n = 0 to M1. Now let hy(n) be the impulse resporise having infinite duration. If hy(n) is multiplied by Wa(n) then a finite impulse response is obtained as shown in Fig. J-3. That means we will get only limited pulse of h(n); not all (cc) pulse. Since we are truncating the input sequence by using a window, this Process is called as truncation process. Since the shape of window function is rectangular; it is called as rectangular window. (& & Matipication 4 1 1 | »n tt test Mi Fig, J-3 : Truneation process Magnitude response of rectangular window : ‘The rectangular window is defined as, 1 forn = 0,1,2...M=1 Wa(n) = (1) 0 otherwise Let hy (mn) be infinite duration impulse response. We know that the finite duration impulse response h (n) is obtained by multiplying hy (n) by Wp (1). h(n) = hy(n)- Wp (n) (2) We will denote fourier transform of Wp (n) by Wp (@). Thus using the definition of fourier transform we can write, M-1 ~jon wa(o) = ED Wale” 3) n=0 But the value of Wp (n) is 1 for the range n = 0 to M~1. M-1 Walo) = DY ie ea(4) n=0 We can represent the window sequence as, W,(n) = u(n)-u(n-M) here u (n) is unit step having duration n = 0 to n =e and u(n~M) is delay unit step. Thus Equation (4) becomes, Now consider the second term. It represents the fourier tranform of delayed unit step. -jon Wa() = Y (u(n)-a(n-M) Ie” n=0 jan -jon | wa(o) = Y w(nye "= Y u(n-Mye? (5) n=0 n=0 Consider the first term at IHS. It represents fourier transform (FT) of unit step. And we have, Fr. ofu(n) = Y te ?**= ¥ (e’*) n=0 n=0 | FT. of u(n-M) <3 e)™ F{a(n)} -joM ‘Thus Equation (5) becomes, Wa(@) = * Wa(@) * Loe a) We will rearrange Equation (6) as follows, ) We have the trignometric identity, 9 4j0 eve” = 2sino Thus Equation (7) becomes, Wa (@) = Wa (0) .( oo W(@) =—Toy e =(8) Now Wa () can be expressed in terms of magnitude and angle as; »(*") 8) LW, (o Wa (@) = 1We(o) le 8 0) Comparing Equations (8) and (9) we can write, (10) 1.3.1. Properties of Commenly used Windows : Some other types of window functions are as follows 1) Hamming window 2) Hanning window 3) Triangular (Bartlett) window 4) Blackman window 5) Kaiser window We will consider that the range of each window is from ~Q to Q. Here Q is positive integer number. (1) | Hamming window : ‘Hamming window function is given by, 2nn Ww, [n] = | 054#046 c08 ° elesewhere Fig. J-4 shows shape of Hamming window. Rectangular Magnitude Fig. J-4 Wy, [11] is a bell-shaped sequence that is symmetric about n = 0 @) Hanning window function : Hanning window function is also called as Raised-cosine window. The function is denoted by, Refer Figs. J-5(a), (b) and (c) to have a look to the spectrum, <_FIRFD-14 We in) Wele"l t q o o a OOF = 3 ~15n 0 16n ° N (a) Hanning window sequence (N = 31) (b) Spectrum wae" “31 ~100 + o ° z (©) Log-magnitude spectrum Fig. J-S Magnitude of first side-lobe level is ~31 dB relative to maximum value, (3) Triangular window function OR Bartlett window : ‘Triangular function is like tapering the rectangular window sequence linearly from the middle to the ends. Triangular window function can be given by 2Int M-1 Window and its spectrum is shown in Fig. 3-6 for Inih(1)=h(1)= For n = 2=9h(2)=h,(2)= For n = 3=9h(3)=h,(3)= For n = 4=h(4)=h,(4)= Prob. 4: response as 7. Soin, : Cutoff frequency 200 He f, = 1 KHz = 1000 Hz Sampling frequency Length = M=7 Step 1: From the piven specifications, expressed as, 1, H,(@) = o, the desired response of ideal low pass filter can be O200 He (4) ‘Thus the desired frequency response can be expressed in terms of @, as, 1, 0S@s1257 Hy(@) = a) 0, 1257 50 B=} 05842(A-21)"*+0.07886(A-21) for2i< A<50 0 for A<21 Step IV: The length of filter is M+ 1. Then calculate value of M using the ‘equation, A-8 2.285 Ao Here Aw = transition width and is given by, A@ = @,-a, Where @, = Stopband edge frequency and @, = Passband edge frequency. Step V: Select the desired impulse response depending on type of filter e.g. low pass, high pass ete. Step VI: Calculate the FIR filter coefficients using the relation h(n) = hy(n)- Wn). Solved problems : Prob. 1: Design an FIR linear phase filter using Kaiser window to meet the following specifications 099 02m 0.2% in() 1 TRUE | jon h(n) = 35 Joe "do -02% 02m as 1 ~jo 115 jon iny=5- fe 28 do -02% 02n : 1 +io(a-1115) - hyn) = 5 Joe do -028 jo(n—auis) 7?* é 2 hy(n) [ | ‘4 ~ 2n| j(m-1115) | 1 fj02m(n-115) —-jo2x(n-1115) h(n) = ——1 __ - 6(™ = aia nnsy Le . ] We have the trignometric identity ve) ee sin@ = Se sin (0.2m (n-111.5)] = al .- form LS h(n) (r-ilis) for n# 11 Now for n = 111.5, using Equation (5) we get, oun 1S: ) 1 jocins—mis hy(m) =e Je do -02% 02m 02" . =i an = shy ase fF Pdo= 2b J ido -02n ~02" 1 hy(n) = 55 [02n-(-02n)] h(n) = 02 for n = 111.5 Now combining Equations (6) and'(7) we can write, sin[O2n(M= 115) gen eins hy(n) = m(n-1115) forn=111.5 (02 AS) (6) a (8) Step VI: The filter coefficients are calculated using the equation h(n) = hy(n)-W(n) (9) We have, @(n) = We have a = 2 | n n-1115 abot (eate} ” = ——— 0 ain) 1, (3.395) ao) ‘Thus using Equations (8) and (10), we can calculate the required filter coefficients. 14.4 Design of Linear Phase FIR Filters using Frequency Sampling Method : (1) The desired frequency response is denoted by Hy (©). (2) This frequency response is sampled uniformly at M points. (3) The frequency samples are given by, Qn @ = pk K=O 1 Mod (4) A set of samples determined from Hy (0) are identified as discrete fourier transform (DFT) coefficients. It is denoted by H.(k). ‘There are two types of design as follows : (A) Type: Here frequency samples are 2nk ee () | ‘The sampled desired frequency response is denoted by H (k ). | and H(k) = Hyon | K=O Vw o=o 2nk woo = 4284) ore ae ‘The filter coefficient h(n) can be obtained by taking IDFT of K(k) e h(n) = YD way eam M=1 k=0 Now according to symmetry property of DFT we can write, H(M-k) = H*(k) ‘Then the filter coefficients can be determined using the equation, (M~1)/2 prin /M hon) = yg] HCO)42 YL ReL Hye] | when M is odd k=l ‘oat | 2 ei jam kn | M is eve and h(n) = foe? zy Re[ H(k)e ]}- when M is even t kel J (8) Type i: In this method frequency samples are taken at, 2n(k+1) . a, = 22). k=0)1..M=1 ‘The DFT coefficients are obtained by using, ~ gg | EQRD _ cay = [BED k=0.1..M=1 The filter coefficients are obtained by using the equation, (M~3)/2 hon) = BD Re {HCY wis oad k=0 My 2? a (2k41)/M} ant hin) = 275 Re [cay ™*CH1) aes een k=0 Solved Problems : +3) (4) (3) 6) 7) (8) (9) (10) Prob. 1: technique for N = 17. Soin. : We will use type I design. The value of H(k) is given by, nan =, (225) Design a low-pass digital fiter with cut-off frequency w, = 5 using frequency sampling He Su Note that in the given problem notation N is used instead of M. 3) . . noo =, (75) . (1) Hy (@) is the desired frequency response and for low-pass filter it is given by, ) H,(o) 0s@so, (2) Now we have, 4 H(k) = H,(o) a o = tk N _j28K(N=1) ) .H(kyse N42) NowN = 17. ~ tsa H(k) =e @) Here N is odd so we will calculate the filter coefficients by using the equation, (N-1 | > h(n) = @ 1H (0)+24 y ) Re [ (ky em! ] | =1 k 8 1 kn h(n) =) wove E nefware™”] “ ( kel J Substituting the value of H(k) from Equation (3), 8 1, | = i067 jak 17 cna etd & Re[e can ij *K(g—n).| h(n) = | (5) Putting k = 0-in Equation (3) we can obtain the value of H (0). =j16 (0) HOO) =e 7 f 8 Soak aj] j h(n) omy yr ree 7 I} (6) Now using Euler’s identity we can write, ~jtnk(8—n) 2nk(8~n) 2nk(8-n) . 7 co cia [PERI] v7 7 2nk(8-n) = co[ SEEN) _ 8 2nk(8—n) 1 Ty tt? L cos —S5— (8) Now we will obtain different filter coefficients by putting n = 0 to N-1 that means for the values of n from n = 0 to 16. 8 _ —. cos 2k (8-0) Forn=0= h(O)= 75] 1+2 z 7 k=l _ | (CQRx1x8) | (2mx2%8) (2ex3x8) (Inx4x8) (0) = 75 1+a[ eo T7608 + 08 SEAS 7 (2nx5%8) | (2nx6x8) (2ex7%8) (20x 8x8) |: 005 Ey 008 ETS) + cos ETE con CAE | = h(0) = 3b [1421098 +093 085+ 0.73 - 0.64044 -027+0.092)} ) on solving, you will observe that (2) =h(14), h(3) = (13)... N(7) = H(9) AC separately. Thus, all 16 values need not be calculated, 0 1.5 Alternation Theorem Equiripple Linear Phase FIR Alternation theorem is basically used to determine the filter parameters that minimize the ‘maximum absolute value of error E.(«) over the frequency bands in which approximation is to be performed, It is a theorem applicable in the theory of Chebyshev approximations. (7) (8) the | ‘The real-valued frequency response characteristic of filter is given as, H.(@) = Q(@)P(@) (1) where, fi case 1 |. @ 0s case 2 Qo) | sine — case3 |. (sing cased L and P(@) = >, a(k)cos@k 0 Here, L = (M~1)/2 for case 1 L = (M-3)/2 for case 3 L = M/2-1 for case 2 and 4 A necessary and sufficient condition for P(w) to be unique, best weighted Chebyshev approximation to Hy, (@) in compact subset of interval (0, m ),($.) is that the error function E (@) exhibit at least (L+2) external frequencies in $. That is, there must exist at least (L+2) frequencies {@,} in S such that @, <0) to +s, the corresponding locus of points in Z plane is a circle of 1 radius > and its centre at Z = 3 J. This mapping is shown in Fig. K-10). In@ Unit Circle Fig. K-1(b) : Mapping between s and Z plane IRFD-6 This mapping shows that, i) LHS. of s plane is mapped onto the points inside the circle in Z plane havin,. radius =} and centre at Z.= 5, ii) RH. of s plane is mapped onto the points outside the circle in Z plane. iii) The stable analog filter is converted into stable digital filter. Limitation of approximation of derivatives method : This method is suitable only for designing of low pass and bandpass [IR digital filters with relatively small resonant frequencies. 1.2.2 Impulse Invariance Method : In this method, the design starts from the specifications of analog filter. Here wi have to replace analog filter by digital filter. This is achieved if impulse response of digital filter r sembles the ‘sampled version of impulse response of analog filter. If impulse response of both, analog and digital filter matches then, both filters perform in a similar manner. Before studying this method we will list out the different notations, we are going to use. h(t) = Impulse response in time domain H,(s) = Transfer function of analog filter; here ‘s’ is laplace operator 5 8 h(nT,) = Sampled version of h(t), obtained by replacing t by n'T, H(Z) Z transform of h(n T,). This is response of digital filter. Q = Analog frequency © = Digital frequency ‘Transformation of analog system function H, (5) to digital system function H(Z) : Now let the system transfer function of analog filter be H,(s). We can express H,(s) in terms of partial fraction expansion. That means, A, A, 1 2 Hi (s) —— -P, s-P, N A H(s)= Y (1) a -P, . k=1 & Here A, = A,,A,.. Ay are the coefficients of partial fraction expansion. and P, k P,,P, « Py, ate the poles. Here ‘s’ is the laplace operator. So we can obtain impulse response of analog filter, h(t) from H, (s) by taking inverse laplace of H, (s_). So using standard relation of inverse laplace we get N Pe h(t) = DY Ae® oo(2) k=1 Now unit impulse response for discrete structure is obtained by sampling h(t). That means, h(n) can be obtained from h(t) by replacing ‘t’ by nT, in Equation (2). N hay = YD Aes 3) Here T, is the sampling time. The system transfer function of digital filter is denoted by H(Z). It is obtained by taking Z-ansform of h(n. According to the definition of Z-transform for causal system, H(Z) = Y h(nyz" oA) n=0 Putting Equation (3) in Equation (4) we get, co N H(Z)= > [ YD aeens |.zoe n=0| k=1 n=0 Equation (5) becomes, (6) ‘This is the required transfer function of digital filter. ‘Thus comparing Equation (1) and Equation (6), we can say that the transfer function of digital filter is obtained from the transfer function of analog filter by doing the transformation, AT) Equation (7) shows, how the poles from analog domain are transferred into the digital domain. This transformation of poles is called as mapping of poles. Relationship of s-plane to Z plane : We know that the poles of analog filters are located at s = Pj, Now from Equation (7) we ccan say that the poles of digital filter, H (Z) are located at, P Z=er' (8) ‘This equation indicates that the poles of analog filter at s = Py are transformed it v the poles >, of digital filter at Z = e * *, Thus the relationship between Laplace (‘s’ domain) and Z domain is given by, zee% (9) Heres = P, and T, is the sampling time. Now ‘s’ is the laplace operator and it is expressed as, 8 =o+jQ (10) Here = Attenuation factor and Q = Analog frequency We know the ‘Z’ can be expressed in polar form as, Z=re? al) Here ‘r" is magnitude and ‘a is the digital frequency. Putting Equations (10) and (11) in Equation (9) we get, jo (o4ja)t ro? ae * jo oT, jar ere I (12) Separating real and imaginary parts of Equation (12) we get, oT, ree 13) ar and? = bs © = QT, (14) Now we will find the relationship between s plane and Z plane. Basically plot in ‘s’-domnain means, @ is plotted on X-axis and jQ is plotted on Y- axis. And Z-domain representation means real Z is plotted on X- axis and imaginary Z is plotted on Y-axis, Now consider Equation (13), it is oT, ree! (10) (uy) (12) 13) 14) rain WRFD-9 We will discuss the following conditions : @ — Ifo <0, then r is equal to reciprocal of ‘e” raise to some constant. Thus range of r will be 0 tol. (15) Now o < 0 means negative values of o. That is L.H.S. of s plane. We know that ‘r’ is the radius of circle is Z plane. So ‘0 0 then, r is equal to ‘e’ raise to some constant, That means r > 1. Now 6 > 0 indicates R.H.S. of ‘s’ plane and ‘r’ > 1 indicates exterior part of unit circle. ‘Thus, RS. of ‘s’ plane is mapped outside the unit circle. Combining all conditions; this mapping is shown in Fig, K-2, Fig. K-2 : Relationship of s plane to Z-plane Disadvantages of impulse invariance method : (1) We know that ‘Q” is analog frequency and its range is from 7 to ~ 7. While the digital i mi he frequency ‘a varies from —m to 7. That means from 7 to ~ 7 ‘@" maps from —n to x. Let T, k be any integer. Then, we can write the general range of @ as (k~ 1) to (k+1)2s but for this range also; ‘o’ maps from ~7 to m. Thus mapping from analog frequency ‘2° to 4igital frequency ‘c” is many (o one. This mapping is not one to one. 2) Analog filters are not band limited so there will be aliasing due to the sampling process. Because of this aliasing, the frequency response of resulting digital filter will not be identical to the original frequency response of analog filter. (3) The change in the value of sampling time (T,) has no effect on the amount of aliasing, @ © Grae [= 2e [eos br, Ze , «iy. —*,_, — “to i) * (stay+b? =2e*"s[ cos bT, JZ Design steps for impulse invariance method : Step 1: Analog frequency transfer function H(s) will be given. If it is not given then, obtain expression of H(s) from the given specifications Step II : If required expand H (s) by using partial fraction expansion (PFE). Obtain Z transform of each PFE term using impulse invariance transformation equation. Obtain H (Z.), this is required digital IR filter. Solved Problems : Prob. 1: Find out H(Z) using impulse invariance method at § Hz sampling frequency from H(s) as given below : HO) = here Soin. : . Step 1: Given analog transfer function is, 2 H(s) -Gpen Al) Step I: We will expand H (s ) using partial fraction expansion as : * H(s) = A + An a2) (stl) (s#2) ‘Thus poles are at Py = —1 and P, = —2. Now values of Aj and A, are calculated as follows : A, = (s-P,)H(s)

You might also like