Digital Signals and Systems Exercise 1 Calculate the first eight sample values and sketch each of the following sequences: Solution 1 Exercise 2 Generate and plot each of the following sequences over the indicated interval using MATLAB. Solution 2 Unit sample sequence Function Using MATLAB Unit sample sequence: Unit sample sequence: Exercise 3 Let Determine and plot the following sequence. Solution 3 The first part is obtained by shifting x(n) by 5 and the second part by shifting x(n) by −4. Two signals addition function. Signals shifting function. Exercise 4 Given the digital signals 𝑥 𝑛 in Figures write an expression for each digital signal using the unit-impulse sequence and its shifted sequences. Solution 4 Exercise 5 Assume that a DS processor with a sampling time interval of 0.01 second converts the following analog signals 𝑥 𝑡 to a digital signal 𝑥 𝑛 ; determine the digital sequence for each of the analog signals. Solution 5 Exercise 6 Determine whether the following systems are linear Solution 6 a Solution 6 b Solution 6 c Exercise 7 Determine whether the following linear systems are time-invariant. 𝑎. 𝑦 𝑛 = 𝑇 𝑥 𝑛 = −5 𝑥(𝑛 − 10) 𝑏. 𝑦 𝑛 = 𝑇 𝑥 𝑛 = 10 sin 0.1 𝜋 𝑛 𝑥(𝑛) Solution 7 𝑎. 𝐹𝑜𝑟 𝑦 𝑛 = 𝑇 𝑥 𝑛 = −5 𝑥(𝑛 − 10) The response due to shifted input is while the shifted output is 𝑦𝑘 𝑛 = 𝑇 𝑥 𝑛 − 𝑘 = −5 𝑥(𝑛 − 10 − 𝑘) 𝑦 𝑛 − 𝑘 = −5 𝑥 𝑛 − 𝑘 − 10 = −5 𝑥 𝑛 − 10 − 𝑘 = 𝑦𝑘 𝑛 Hence the given system is time-invariant. 𝑏. 𝐹𝑜𝑟 𝑦 𝑛 = 𝑇 𝑥 𝑛 = 10 sin 0.1 𝜋 𝑛 𝑥(𝑛) The response due to shifted input is 𝑦𝑘 𝑛 = 𝑇 𝑥 𝑛 − 𝑘 = 10 sin 0.1 𝜋 𝑛 𝑥(𝑛 − 𝑘) while the shifted output is 𝑦 𝑛 − 𝑘 = 10 sin[0.1 𝜋 (𝑛 − 𝑘)] 𝑥(𝑛 − 𝑘) ≠ 𝑦𝑘 𝑛 Hence the given system is not time-invariant. Exercise 8 Determine which of the following linear systems is causal. Solution 8 Exercise 9 Find the unit-impulse response for each of the following linear systems. Solution 9 Exercise 10 Determine the stability for each of the following linear systems. Solution 10 Exercise 11 Using the sequence definitions, evaluate the digital convolution Solution 11 k -4 -3 -2 -1 x(k) h(-k) h(1-k) h(2-k) h(3-k) h(4-k) h(5-k) h(6-k) 1 0 1 2 2 1 1 3 4 5 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 2 1 1 2 2 6 y(0)=4 y(1)=6 y(2)=8 y(3)=6 y(4)=5 y(5)=2 2 y(6)=1 Exercise 12 Let the rectangular pulse be an input to an LTI system with impulse response Determine the output Given that the output of the system is given by either of the following two equivalent forms of the convolution sum: Solution 12 There are three possible conditions under which u(n − k) can be evaluated. In this case the nonzero values of x(n) and h(n) do not overlap. 0 ≤ n < 9: Then u(n − k) = 1, 0 ≤ k ≤ n. In this case the impulse response h(n) partially overlaps the input x(n). n ≥ 9: Then u(n − k) = 1, 0 ≤ k ≤ 9 Exercise 13 a. Find the even and the odd components of the discrete-time signal b. Use MATLAB function to decompose x[n] sequence into its even and odd components. Solution 13 a The odd component Solution 13 a Using MATLAB operations discussed so far, we can obtain the following evenodd function. MATLAB program to determine and plot its even and odd parts of x[n]. Exercise 14 Consider an autoregressive system represented by a first-order difference equation . system a. Find the impulse response h[n] of the b. Compute the response of the system to c. Verify results with MATLAB. using the convolution sum. Solution 14 a The impulse response ℎ 𝑛 can be found recursively. Letting 𝑥 𝑛 = 𝛿 𝑛 , 𝑦 𝑛 = ℎ 𝑛 , and initial condition 𝑦 −1 = ℎ −1 = 0, we have. from which a general expression for the impulse response is obtained as: ℎ 𝑛 = 0.5𝑛 𝑢[𝑛] Solution 14 b The response to 𝑥 𝑛 = u[n]−u[n−3] using the convolution sum is then given by Since as functions of 𝑘, 𝑢 𝑘 𝑢 𝑛 − 𝑘 = 1 𝑓𝑜𝑟 0 ≤ 𝑘 ≤ 𝑛, zero otherwise, and 𝑢 𝑘 − 3 𝑢 𝑛 − 𝑘 = 1 𝑓𝑜𝑟 3 ≤ 𝑘 ≤ 𝑛, zero otherwise (in the two cases, draw the two signals as functions of 𝑘 and verify this is true), y[n] can be expressed as Another way to solve this problem is to notice that the input can be rewritten as and since the system is LTI, the output can be written as which gives which coincides with the above more general solution. Solution 14 c The following MATLAB script is used to verify the above results. The MATLAB function filter is used to compute the impulse response and the response of the filter to the pulse. The output obtained then with filter coincided with the output computed using MATLAB function conv, as it should.