You are on page 1of 23
CHAPTER OUTLINE 3.1 Digital Signals... 3.1.1 Common Digital Sequences, 3.1.2 Generation of Digital Signals 3.2 Linear Time-Lovariant, Causal Loops B21 Linearity .a.ecsnenne 3.2.2 Time Invariance sano: 3.2.3 Causality on nencnnan 2.3 Difference Equations and impulse Responses. 3.3.1 Format of the Difference Equation sa... 3.3.2 System Representation Using Its Impulse Response... ‘3.4 Bounded-In and Bounded-Out Stability 3.5 Digital Convolution. 3.6 Summary OBJECTIVE This chapter introduces notations for digital signals and special digital sequences that are widely used in this book. The chapter cantinues to study same properties of linear systems such as time invariance, BIBO (bounded-in and bounded-out) stability, causality, impulse response, differance equations, and digital convolution. 3.1 DIGITAL SIGNALS In our daily lives, analog signals appear in forms such as speech, audio, seismic, biomedical, and communications signals. To process an analog signal using a digital signal processor, the analog signal must be converted in toa digital signal, that is, analog-to-digital conversion (ADC) must take place, as discussed in Chapter 2. Then the digital signal is processed via digital signal processing (DSP) algorithm(s), ‘A typical digital signal x(n) is shown in Figure 3.1, where both the time and the amplitude of the digital signal are discrete. Notice that the amplitudes of the digital signal samples are given and sketched only at their corresponding time indices, where x(n) represents the amplitude of the nth sample and 1 is the time index or sample number. From Figure 3.1, we learn that 4x(0): zeroth sample amplitude at sample number 1 = 0, (1): first sample amplitude. at sample number = = 1, FIGURE 3.1 Digital signal notation, x(2): seoond sample amplitude at sample number = 2, 1x(3): third sample amplitude at sample number n = 3, and so on. Furthermore, Figure 3.2 illustrates the digital samples whose amplitudes are the discrete encoded ‘values represented in the digital signal (DS) processor. Precision of the data is based on the number of bits used in the DSP system. The encoded data format can be either an integer if a fixed-point DS processor is used or a floating-point number if a floating-point DP processor is used. As shown in Figure 3.2 for the floating-point DS processor, we can identify the first five sample amplitudes at their time indices as follows: x(0) = 2.25 x(1) = 20 12) = 10 x) = -L0 x(4) = 00 Again, note that each sample amplitude is plotted using a vertical bar with a solid dot. This notation is ‘well accepted in DSP literature. 3.1.1 Common Digital Sequences Let us study some special digital sequences that are widely used. We define and plot each of them as follows: Unit-impulse sequence (digital unit-impulse function): wy ={} =e en 0 n#0 20) ‘The plot of the unit-impulse function is given in Figue 3.3. The unit-impulse function has unit amplitude at only n = O and zero amplitude at other time indices. Unitestep sequence (digital unit-step function): 1 n>0 Wi) = 45 Aco 2) ‘The plot is given in Figure 3.4. The unit-step function has unit amplitude at n = 0 and at all the positive time indices, and zero amplitude at all negative time indices. ‘The shifted unit-impulse and unitestep sequences are displayed in Figure 3.5. As shown in the figure, the shifted unit-impulse function 6(71 — 2) is obtained by shifting the unét-im pulse function 6(72) to the right by two samples, and the shifted unitestep function u(n ~ 2) isachieved by shifting the unite step function u(n) to the right by two samples; similarly, 4(n +2) and u(n+2) are acquired by shifting 6(n) and u(n) two samples to the left, respectively FIGURE 3.3 Unit-impuise sequence. FIGURE 3.4 Unit-step sequence &n-2 un-2) Bin +2) dn $2) Sinusoidal and exponential sequences are depicted in Figures 3.6 and 3.7, respectively. For the sinusoidal sequence x/t) = Acos(0.125zn)u(n),and A = 10, we can calculate the digital values for the first eight samples and list their values in Table 3.1 For the exponential sequence x(n) = A(0.75)"u(m), the calculated digital values For the first eight samples with A = 10 are listed in Table 3.2. a FIGURE 3.6 Plot of samples of the sinusoidal function. xn) FIGURE 3.7 Plat of samples of the exponential function Table 3.1 Sample Values Calculated from the Sinusoidal Function a x(n) = 10¢08(0.1252n)u(n) 10.0000 9.2388 70711 3.8828 0.0000 3.9828 70711 9.2388 Table 3.2 Sample Values Calculated from the Exponential Function a 10(0.75)"uin) 10.0000 7.5000 5.6250 42188 8.1641 23730 1.798 1.3948 EXAMPLE 3.1 Sketch the following sequence a(n) = 5(0-+ 1) +0.55(0 = 1) +250 —2) Solution: ‘Accotding to the shift operation, (n+ 1) is obtained by shitting (7) to the left by one sample, while (n — 1) and 4(n~ 2) areyielded by shifting 2(n) to right by ane-sample and two samples, respectively. Using the amplitude of each Impulse function, we oblain the sketch in Figure 3.8, tn) FIGURE 3.8 Plot of digital sequence in Example 3.1 3.1.2 Generation of Digital Signals Given the sampling rate of a DSP system to sample the analytical function of an analog signal, the corresponding digital function or digital sequence (assuming its sampled amplitudes are encoded to have finite precision) can be found. The digital sequence is often used to 1. Calculate the encoded sample amplitude for a given sample number 2. Generate the sampled sequence for simulation ‘The procedure to develop the digital sequence from its analog signal function is as follows. Assuming that an analog signal x(7)is uniformly sampled at the time interval of Ar = T. where T'is the sampling period, the comesponding digital function (sequence) x(n) gives the instant encoded valves of ‘the analog signal x(r) atall the time instants ¢ = n dr = n7’ and can be achieved by substituting time 1 = nf into the analog signal a(1), that is, a(t) = (heer = MT) 63) Also notice that for sampling the unit-step function u(t), we have WDhagr = ule) = u(r) Ga) ‘The following example will demonstrate the use of Equations (3.3) and (3.4). EXAMPLE 3.2 Assume we have a DSP system witha sampling time interal of 125 microseconds. a. Convert each of following analog signals x(t) to a digital signal x(n) 1. x(i) = 1020/4) 2 A(1) = 1sin(2,0002t)u(0) 1b, Determine and plot the sample values tram each obtained digital function. Solution: 2. Stee T = 0.000125 seconds in Equation (3.3), substituting ¢ = AT = nx 0.000125 = 00001250 into the analog signal x(t) expressed in (1) leads to the digital sequence 1. x(a) = (at) 1062000000128 nT) = 10¢-25"y(n) Similaly, the digital sequence for (2) is achieved as follows: 2. xfn) = a(n) = 10sin(2,000x x 0.0001250)u(nT) = 10sin(0.25xn)u(n) . The frst five sample values for(1) are calculated and plotted in Figure 3.9. 10e-2825*0,(0) = 10.0 102-881 (1) = 5.3526 Th Sample tates 4 Mieronacoods (see) © 135 20 35 OS tee FIGURE 3.10 Plat of the digital sequence far (2) in Example 32, 2(2) = 10022242) MQ) = 102225348) a{4) = 102224414) “The first eight amplitudes for (2) are computed and sketched in Figure 3.10, 2(0) = 103in(0.25x x 0)u(0 a(1) = 10sin(0.28ar 1)u( 2{2) = 10sin(0.25x x 2)ul2 2) x5) x(6) x7) 3.2 LINEAR TIME-INVARIANT, CAUSAL SYSTEMS. In this section, we study linear time-invariant causal systems and focus on properties such as linearity, time-invariance, and causality. 3.2.1 Linearity ‘Alinear system is illustrated in Figure 3.11, where y(n) is the system output using an input (n), and Yan) the system output with an input x(n). Figure 3.11 illustratesthat the system output due to the weighted sum inputs ax; (n) + B(n) isequal tothe same weighted sum of the individual outputs obtained from their corresponding inputs, that is, y(n) = ayi(n) + By2(n) 65) where a and 8 are constants. 0) oe 50) eee Lt) xn) + Peso ate) +r) ‘System FIGURE 3.11 Digital near system. For example, assuming a digital amplifier is represented by y(n) = 10x(n), the input is ‘multiplied by 10 to generate the output. The inputs x1(n) = u(n) and x2(n) = 6(n) generate the outputs, yi(n) = 10u(n), and yo(n) = 108(n), respectively If, as described in Figure 3.11, we apply the combined input x(n) to the system, where the first input ‘multiplied by a constant 2 while the second input multiplied by a constant 4, x(n) = 2x) (n) + 4xa(n) = 2u(n) + 46(n) then the system output de to the combined input is obtained as y(n) = 10x(n) = 10(2u(n) + 44(n)) = 20u(n) + 406(n) G6) If we verify the weighted sum of the individual outputs, we see that, 2yuln) +Ayx{n) = 2u(n) + 406(n) en Comparing Equations (3.6) and (3.7) verifies that y(n) = 2yuln) +4yn(n) 68) Hence, the system y(n) = 10x(n) is a linear system. The linearity means that the system obeys the superposition principe, as shown in Equation (3.8). Let us verify a system whose output is asquare of itsinput, y(n) = 2 (n) Applying the inputs x1(n) = u(n) and x(n) = 6(n) to the system leads to pula) = 12m) = u(n), and yan) = Pn) = O(n) Itis very easy to verify that 2(n) = u(n) and (0) = &(n). We can determine the system output using a combined input, which is the weighed sum of the individual inputs with constants 2 and 4, respectively. Using algebra, we sce that y(n) = 27(n) = (Axa (n) + 2ea(n))? = (4u(n) + 24(n))? = 16u?(m) + 16u(n)d(n) + 462(n) G9 16u(m) + 205(n) ‘Note that we use the fact that u(m)5(n) = 3(m), which can be easily verified. ‘Again, we express the weighted sum of the two individual outputs with the same constants 2 and 4 as yi (n) + 2ya(n) = 4u(n) +25(n) G.10) Itis obvious that y(n) #4yi(m) + 2y2(m) By Hence, the system is a nonlinear system, since the linear property, superposition, does mot hold, as shown in Equation (3.11). 3.2.2 Time Invariance ‘A time-invariant system is illustrated in Figure 3.12, where y(n) is the system output for the input xy(n). Let x(n) = xi(m— no) be the shifted version of x1(n) by no samples. The output y2(vt) obtained with the shifted input .x9(nt) = x1(1~ no) is equivalent to the output yx(it) acquired by shifting yi(n) by mo samples, y2(st) = yi(n — no) This can simply be viewed as the following: lf the system is time invariant and y(n) i the system output due tothe input x(n), then the shifted system input ,(0— ho) ill produce a shifted system output y(t) by the same amount of time no, aun system am) =50 =m) ab bt wl shifted byn, samptes FIGURE 3.12 lMustration of the linear time-invariant digital system, EXAMPLE 3.3 Determine whether the linear systems a. yo) = 2x(0—8) b ¥(0) = 2x@n) ‘are time invariant Solution: 2. Let the input andoutput be (7) andy; (0), respectively; then the system output is p(n) = 2m (n— 5). Again, let 10(7) = 11 (n= no) be the shifted input and ya(n) be the output due to the shifted input. We determine the system output using the shifted input as 22(0) = 2x2(0- 5) 2ex(n= 9-5) Meanwhile, shifting % (0) = 2x (m5) by ng samples leads to yi(0~ mm) = 2n (9-5-9) We can verify that y(n) = yi(n— na). Thus the shifted input of no samples causes the system output to be shifted by the same nig samples. The system is thus time invariant. 'b. Letthe inputand output be x (0) and y; (0) respectively: then the system outputis y(n} = 2x1(3a). Again, let the inputandoutput be (0) andya(n), where x9(0) = 2 (7 ~ no), astifted version andthe coresponding output is yo(n). Weget the output due tothe shifted input x(n) = xa(0 — rp) and note that x2(3n) = x(3n — no) 2x Ba) = 2x1(30— ry) (On the other and, if we shift (0) by ng samples, and replace a in yi (1) = 2n (30) by a — no, we obtain vale) (0 ng) = 261(8(0 — A9)) = 24, (3 3) Clearly, we know that ya(n) #ya(0 — fp). Since the system output a(n) using theinput shifted by no samples. & rot equal to the system output j (7) shifted by the same no samples, the system is not time invariant. 3.2.3 Causality ‘A causal system is the one in which the output y(n) attimen depends only on the current input.x(n) at time n, and its past input sample values such as.x(n— 1), (r — 2)..... Otherwise, if a system output depends on future input values such as.x(n+ 1),x(n +2), ..., the system is noncausal. The noncausal system cannot be realized in real time. EXAMPLE 3.4 Determine whether the systems a. y(0} = 0.5x(n) + 2.5x(—2), forn > 0 b. yo) = O.2x(n— 1) +OSx(a4 1) —O.4y( 0A), fora > 0 are causal Solution: ‘2 Since for n > 0, the output y(n} depends on the current input a(n) and its past value x(n —2), the system is causal b. Since for n >0, the output y(n) depends on the current input x(n) and its future value x(n-+), the system is eneausal 3.3 DIFFERENCE EQUATIONS AND IMPULSE RESPONSES Now we study the difference equation and its impulse response. 3.3.1 Format of the Difference Equation Accausal, linear time-invariant system can be described by a difference equation having the following ‘general form: y(n) + ary(n— 1) +P ayy(n = N) = byx(n) + ian 1) + + dyn =) G12) where ay,....4y, and bo, bi,..., bag are the coefficients of the difference equation, Equation (3.12) can also be written as y(n) = -ayn 1) + = N) + box (n) + Bix =I) +o byx(n—M) G13) ES: or if Me y(n) = — Sawn - i) + Salm -j) B14) is Notice that y(n) isthe current output, which depends on the past output samples ‘the current input sample x(n), and the past input samples, x(t — 1).....(n— A). We will examine the specitie difference equations in the following examples. = Neeoay(n WN), EXAMPLE 3.5, ‘Given the difference equation (0) = O25y(0— 1) +x(0) identify the nonzero system coefficients. Solution: ‘Comparison with Equation (3.13) leads to bo 25, thatis, a = 0.25 EXAMPLE 3.6 ‘Given a linear system described by the difference equation (a) = x(0) 40.5x(n—1) determine the nanzera system coefficients ‘Solution: By comparing Equation (2.13), we have bo = 1 and by = 0.5 3.3.2 System Representation Using Its Impulse Response ‘A linear time-invariant system can be completely described by its unit-impulse response, which is defined as the system response due to the impulse input 6(m) with zero initial conditions, depicted in Figure 313. ‘With the obtained unit-impulse response /i(r), we can represent the linear time-invariant system as shown in Figure 3.14, 8m) hn) Linear me-ovartant stem FIGURE 3.13 Unit-impulse response of a linear time-invariant system, xn) ve) 0) FIGURE 3.14 Representation of a linear time-invariant system using the impulse response. EXAMPLE 3.7 ‘Assume we have a linear time-invariant system on) = O5x(0) + 0.25x(n—1) ‘with an initial condition x(—1) = 0. a. Determine the unitimpulse response h(n) 1b. Drawthe system block diagram. Write the output using the obtained impubse response. ‘Solution: a According to Figure 3.13, let x(a) = d(), then nen) = Y(n) = 0.5x(n) + 0.28x(n—1) = 0.580) +0.250(0 ~ 1) Thus, for this particular near system, we have os ha) = | 025 ° . The block diagram of the linear time-invariant system ie shown in Figue 3.15. The system output can be rewritten as, yoy m(O)a(m) + md x(a 2) x) van) 4] tn) =0.501m) +0.2500n=1) | FIGURE 3.15 The system black diagram for Example 3.7. From the result Example 3.7, it is noted that the difference equation does not have the past output terms, y(n = 1),..., (ot = N), thatis, the corresponding coefficients 1... .dy,are zeros, andthe impulse response h(t) has. finite number of terms, We call this systema finite impulse response (FIR) system. In ‘general, Equation (3.12) contains the past output terms and the resulting impulse response fn) has an infinite number of terms. We can express the output sequence of a linear time-invariant system using its impulse response and inputs as + A(—1 a(n + 1) + HOYAKn) + h(a = 1) + HQ 2) + G5) vn) = Equation (3.15) is called the digital convolution sum, which will be explored im a Later section. We can verify Equation (3.15) by substituting the impulse sequence x(n) = 6(n) to get the impulse response n(n) = => + A(—1)O(n +1) + A(O)AKn) + A(L)O(M = 1) + e(2)0(n = 2) where ... A(—1), (0) ,/(1), (2) ... ate the amplitudes of the impulse response at the corresponding time indices. Now let us look at another example. EXAMPLE 3.8 Consider the difference equation la) = 0.25y(0—1)+x(0) for 90 and (-1)=0 a Determine the unit-impulse response (7). ‘b. Draw the system black dhagram. Cc. Write the output using the obtained impulse response. 4d. Forastep input x(n) = u(a), verity and compare the output responses forthe fst three cutput samples using the diference equation and digital convolution sum (Equation (3.1 5). Solution: ‘a Let a(n) = a(0), then (a) = 0.25h(0—1) +410) To sohe for h(n), we evaluate 'n(0) = 0.25h(~1) +50) = 025x041 25h(0) +4(1) = 025x140 = 0.25 xt) a) 4a) = 50) 40.2550 FIGURE 3.16 ‘The system block diagram for Example 38. 2) 0.25m(1) + 42) 25 «0.540 10625 With the calculated results, we can predict the impulse response as hn) = 0.25)" 0(0) = 5(n) +0.259(n — 1) +0.08285(n— 2) + The system block diagram is given in Figure 3.16, «. The output sequence is a sum of infinite terms expressed as 00 P(O)x(n) + A(2)xG0—1) + H(2)x(0 —2) + x(n) +0.28.(0 1) +0.0625x(n—2) + d. From the diference equation and using the ero initial condition, we have 0) 0.28y(0— 1) + 2(0) fora > Oand (2) =O 0, y(0) = 025y(-1) +0) = uO) = 1 1, y(1) = 0.25y(0)+x(1) = 025 x u(0) +u(2) = 125 = 2,y(2) = 025)(1) +x(2) = 025% 125+ u@) = 13125 ‘Applying the convolution sur in Equation (3.16) yields He) = x(0)+0.25x(0— 1) +0.0625x(9—2) + (0) = (0) +0.25x(-1) + 0.0625x(-2) + 0) +0.25 x u(—1) +0.125 x uf-2) + = 1 ¥(Q) = 9(1) +0.25x(0) +0.0625x(-1) + UQ) £0.28 « uf0) + 0.128 x u(—1) + = 1.25 ve) x(2) + 0.25x(1) +0.06254(0) + (2) +0.25 x u(1) +0.0625 x u(0) + 13125 ‘Comparing the results, ve verify that a linear time-invariant system can be represented by the convolution sum using its impulse response and input sequence. Nate that we verifyanly the causal system fr simplicity, and the principle works for both causal and noncausal systems, Notice that this impulse response h(n) contains an infinite number of terms in its duration due to the past output term y(n —1). Such a system as described in the preceding example is called an infinite impulse response (HIR) system, which will be studied in Eater chapters, 3.4 BOUNDED-IN AND BOUNDED-OUT STABILITY We are interested in designing and implementing stable linear systems. A stable system is one for which every bounded input produces a bounded output (BIBO). There are many other stability defi- nitions. To find the stability criterion, consider the linear time-invariant representation with all the inputs reaching the maximum value M for the worst case. Equation (3.15) becomes y(n) = MC + h(=1) + A(O) +h) +h(2) + >>) G16) Using the absolute values of the impulse response leads to Hn) < MG + a —1)] + 1A(O)] + CAL + Y(2)] +o) G17) If the absolute sum in Equation (3.17) is a finite number, the product of the absolute sum and the maximum input value is therefore a finite number. Hence, we have a bounded input and bounded ‘output. In terms of the impulse response, a linear system is stable if the sum of its absolute impulse response coefficients is a finite number. We can apply Equation (3.18) to determine whether a linear time-invariant system is stable or not stable, that is, > ba Figure 3.17 describes a linear stable system, where the impulse response decreases to zero in a finite ‘amount of time so that the summation of its absolute impulse response coefficients is guaranteed to be finite. + W(—1)] + fa) + [ACL] + < (3.18) olny an) linear stable system FIGURE 3.17 ustration of stability of the digital linear system. EXAMPLE 3.9 Given the linear system in Example 2.8, ¥(0) = 0.25y(0-1)+x(0) for 920 and y(-1)=0 which is described by the unit-impulse response Alo) = (0.25)"u(a) determine whether this system fs stable, ‘Solution: Using Equation (3.16), we have S= > Mbl= > fost] ‘Applying the definition of the unitstep function u(k) = 1 for k > 0, we have s= 3525} = 1402540257 + Using the formula fora sum of the geometic series (see Appendix F), yf whee 2 = 0.25 < 1, weeonelute s $0254 0.25 tu = Since the summation is finite number, the linear system is-table, 3.5 DIGITAL CONVOLUTION Digital convolution plays an important role in digital filtering. As we verified in the last section, a linear time-invariant system can be represented using a digital convolution sum. Givena linear time- invariant system, we can determine its unit-impulse response h(n), which relates the system input and ‘output. To find the output sequence y(n) for any input sequence x(n), we write the digital convolution shown in Equation (3.15) as ven) = She ~ 8) ew + h(=1)x(n + 1) + WO) x(n) + H( Lan — 1) + h(2)xGn = 2) + + ‘The sequences h(k) and x(k) in Equation (3.19) are interchangeable. Hence, we have an alternative form: Tae 8) aan + x(—1Dh (n+ 1) + x(O)h Gn) + (1 h(n — 1) + x(2)h(n — 2) 4 + Using conventional notation, we express the digital convolution as y(n) = ln) af) 62 Note that for a causal system, which implies an impulse response of in) =0 for n<0 6.19) the lower limit of the convolution sum begins at 0 instead of 2, that is Mn) = ST A(R)AQn —K) = xR) G2) a ms ‘We will focus on evaluating the convolution sum based on Equation (3.20). Let us examine fist a few ‘outputs from Equation (3.20): 40) = YOR a H(AYA(A) = => + (= )h(1) + a()(0) + (1) h(—1) + (2) dC yQ) = Yip. (A = K) yQ) = Tes. MAG —K) 2)+- + x(=I)h(2) + (OAC 1) +x(1)A(0) + x2VA(=1) +--+ ++ x(—1)h(3) + (O)h(2) +2(1)a(1) + (29h) + ++ ‘We see that the convolution sum requires the sequence h(n) to be reversed and shifted. The graphical, formula, and table methods for evaluating the digital convolution will be discussed via several examples. To evaluate the convolution sum graphically, we need to apply the reversed sequence and shified sequence. The reversed sequenceis defined as follows: if h(n) isthe given sequence, h(—n) is the reversed sequence. The reversed sequence isa mirrorimage of the original sequence, assuming the vertical axisas. the mirror. Letus study the reversed sequence and shifted sequence via the following example. EXAMPLE 3.10 Consider a sequence 3. 1 ky = 23 0 elsewhere where is the time index or sample number a. Sketch the sequence h(k) and reversed sequence h(—K). ‘b Sketch the shifted sequences h(—K-+3) and hk ~2) Solution: 2. Since h(k) is defined, we plat tin Figwe 3.18, Next, we needito ind thereversed sequence h(—k). We examine the following: One can verily that k <—4, h(—K) = 0. Then the reversed sequence h(—K) is shown as the second plat in Figue 3.18, FIGURE 3.18 Plats of the digital sequence and is reversed sequence in Example 3.10. ‘As shown in the sketches, h(—K) is just a minor image ofthe oviginal sequence hk). b. Based on the definition ofthe original sequence, we know that h(0) = h(1) = 3, h(2) = (3) others are 2eros, The time indices correspond ta the fellawing: hea 3 mke3=1 k=? ke 3=2 k=l =ke3 ° and the ‘Thus we can sketch h(—k-+3) as shown in Figure 3.19. Similarly, hk — 2) is shown in Figure 3.20. bk) 3 1 FIGURE 3.19 Pilot of the sequence (— +3) in Example 3.10. Wika FIGURE 3.20 Pilot ofthe: sequence h(~K —2) in Example 3.10. \Wecan get fk + 3) by shifting h(~K) totherightby three samples, and wecan obtain hk ~2) by shifting (—K) tothe left by two samples. In summary, given h{—K), we can obtain h(n — k) by shifting h(—k)n samples to the right or the left, depending on whether a is positive or negative. ree we understand the shifted sequence and reversed sequence, we can perform digital convolution of the two sequences f(A) and x(&), defined in Equation (3.20) graphical. From that equation, we see that each ‘comolution value y(n) is the sum of the products of two sequences x(k) and h(m— 4), the latter of which isthe ‘shifted version of the reversed sequence h(—k) by fn] semples. Hence, we can summarize the graphical convo- lution procedure in Table 3.3. ‘We ilustrate the digital convolution sum in the following example. Table 3.3 Digital Convolution Using the Graphical Method Stop 1. Obtain the versed sequence hk). Stop 2. Shift h(—k) by Jl samples to got h(n — k). F'n > 0, I{—K) willbe shied to ight by n samples: butif 1 < 0, H{-A) walbe shifted to the left by al sarmoies ‘Stap3. Perfoan the convolution Sum, which isthe sum ofthe products. two sequences x(K) and h(n — ko get y(a). Stop 4. Repeat Steps 1 103 for the next convolution value y(n). EXAMPLE 3.11 Using the sequences defined in Figure 3.21, evaluate the digital convolution Yo) = x(k = &) a. Bythe graphical method. 1b. By applying the formula directly. Solution: a To obtain y(O), we need the reversed sequence (Kk); and to ebtain y(1), we need the reversed sequence (1—K), and 9 on Using the technique we have discussed, sequences MK), A-K41), (—Kk+ 2) ‘h{—k-+ 3), and hk +4) are obtained and plotted in Figure 3.22. ‘Again, using the information in Figures 3.21 and 3.22, we ean compute the convolution sum as. my ae FIGURE 321 Pats of digital input sequence and impulse sequence in Example 3.11. 3 2 ; | ‘ neta : 2 1 ‘ keten 3 2 FIGURE 3.22 ilustation of convelutin of two sequences x(k) and A(X) in Example 3.11 yn) 0 FIGURE 323 Plot of the convolution sum in Example 3.11. ‘sum of product of x(4) and h(—K): ¥(Q) ‘sum of product of x(k) and h(L — K): y(L) ‘sum of product of x(k) and h(2 — k): (2) sum of product of x(k) and h(3 — K): (3) = 2x 2211 =5 sum of product of x(k) and h(a — &): y(@) = 2x 1= 2 ‘um of product of x(K) and h(5— A): y(n) = 0 for n > 4, since sequences x(X) and f(a — A) do nat overlap. xan x343x2=9 x341<2+3x1=11 Finally, we sketch the output sequence (n) in Figure 3.23, ». Applying Equation (3.20) with zero initial conditions leads to (0) = x(O)ia) + xC1VACA— 1) + x(Z)M(n—2) n= 0, y(0) = 4(0)M(0) + x(1)h(—1) +x(2)M(-2) = 3x341x042x0=9 1, (1) = X(O)PA) + x(1)M(0) +412 )0(—1) = Bx 241 x3+2x0 2. y(2) = x(O)h(2) + x(1)0(1) + x12)0(0) = Bx 141x242 x3 3, y(B) = x(O)M(3) + x(1)h(2) 4 x(2)A(1) = Bx O41 x 1422 4, y(8) = x(O)h(2) + x(1)h(3) + x(2)h(2) = Be 041x042 <1 2 > 8, y(n) = x(O)b(n) + x{1}(0— 1) + a(2)h(a —2) = 3xO+1x0+2~0 =0 Insimplecases suchas this example, itis notnecessary to use the graphical or formula methods. Wecan compute the comolution by treating the input sequence and Impulse response as number sequences and sliding the reversed impulse response past the input sequence, crass-multiplying, and summing the nonzerooverlap terms at ‘each step. The procedure and calculated results are listed in Table 2.4. Table 3.4 Convolution Sum Using the Table Method ke =) 2 ba Ba ee x(k): a ai wo 1 2 8 (0) =3x3=9 nak) 1 203 1) =3x241x3=9 hk) 1 2 3 W2) =8x141x242"S=11 n@-k) 1-2 8 V3) 1142x225 nak) 1 2 5 4) =2x1=2 ni -k) 1 2 8 (5) = O(n0 overtap} ‘Wecan see that the calculated results usingall the methods are consistent. The steps using the table method ‘are summarized in Table 3.5. Table 3.5 Digital Corwolution Steps via the Table Method ‘Stop 1. List the index k covering a sufficient range. ‘Stop 2. List the input x(k), ‘Step 3. Obtain the reversed sequence h(—), and align the rightmost elament of hima — k) to the leftmost ‘elamant of x(k). ‘Stop 4. Gross-multiply and sum the nonzew overlap terms to produce y(n). ‘Stop 5. Side h(n — &) to the right by one postion. ‘Stop 8. Repeat Sten 4; stop if all the output values are zero or if required. EXAMPLE 3.12, Comoe the following two rectangular sequences using the table method: 0 ° 1 ne oe xo={ and hia) =) 1 amie 0 othemise 0 ethenvise Solution: Using Table 3.5 as 2 guide, we list the operations and calculations in Table 3.6. Note thatthe output should show the trapezoidal shape. Table 3.6 Convolution Sum in Example 3.12 ke eee eee (6) aie 4 wey UT 8 (0) = 9(n0 overtap) (1 Ky aiigiae y=txt=1 2 -K) 1 3 yQ)= 1x 141xt=2 n@ -k) toa 0 3) =1x141K1=2 nak) 1 1 0 Wa) =1xt=1 nak) 11 © y(n) = 0,2 5 (no.overap) ‘Stop Let us examine convolving a finite long sequence with an infinite long sequence, EXAMPLE 3.13 [Asystem representation using the unit-impulse response forthe linear system ¥(o) = 0.25y(0-1)+x(n) ‘or 920 and y(-1) was determined in Example 38 as v0) = xionn=¥) where h(n) = (0.25)"u(n).For astepinput x(0) = u(n), determine the output response fr the fist three output ‘samples using the table method. Solution: Using Table 3.Sasa guide, we listthe operations and calculations in Table 3.7. Asexpected, the output values ae the same as those obtained in Example 3.8 Table 3.7 Convolution Sum in Example 3.13. ke: [eee wee atk) 1 a 8 nk): 00825 02501 (0) = 1x1 nt) 00625 0251 Y(t) = 1x0.2541«1 = 1.25 ne -k) 00625 025 1 (2) =1 x 0.0825 +1 x 025+ txt = 18125 ‘Stop as required 3.6 SUMMARY 1. Digital signal samples are sketched using their encoded amplitude versus sample numbers with vertical bars topped by solid circles located at their sampling instants, respectively. The impulse Sequence, unit-step sequence, and their shifted versions are sketched in this notation. 2. The analog signal function can be sampled to its digital (discrete-time) version by substituting time 1 =n into the analog function, that is, s(n) = shear = (27) ‘The digital function values can be calculated forthe given time index (sample number) ‘3. The DSP system we wish to design must be a linear, time-invariant, causal system. Linearity means that the superposition principle exists. Time invariance requires thatthe shifted input generate the corresponding shifted output inthe same amount of time. Causality indicates thatthe system output depends on only its current input sample and past input sample(s) 4. The difference equation describing a linear, time-invariant system has a format such that the current output depends on the current input, past inputs), and past output(s) in general

You might also like