Discrete-Time Systems 499

8.3 Discrete-Time Systems 499

to signals we can then see that the output of a causal LTI discrete-time system can be written in terms of the convolution sum as

y[n] X = x[k]h[n − k] = x[k]h[n − k] = x[k]h[n − k]

where we first used the causality of the input (x[k] = 0 for k < 0) and then that of the system (i.e., h[n − k] = 0 whenever n − k < 0 or k > n). According to this equation the output depends on inputs {x[0], . . . , x[n]}, which are past and present values of the input.

■ Example 8.25

So far we have considered the convolution sum as a way of computing the output y[n] of an LTI system with impulse response h[n] for a given input x[n]. But it actually can be used to find either of these three variables given the other two. The problem is then called deconvolution. Assume the input x[n] and the output y[n] of a causal LTI system are given. Find equations to compute recursively the impulse response h[n] of the system. Consider finding the impulse response h[n] of a causal LTI system with input x[n] = u[n] and output y[n] = δ[n]. Use the MATLAB function deconv to find h[n].

Solution

If the system is causal and LTI, the input x[n] and the output y[n] are connected by the convolu- tion sum

X y[n] X = h[n − m]x[m] = h[n]x[0] + h[n − m]x[m]

m =0

m =1

To find h[n] from given x[n] and y[n], under the condition that x[0] 6= 0, the above equation can

be rewritten as

h[n] =

y[n] −

h[n − m]x[m]

x[0]

m =1

so that the impulse response of the causal LTI can be found recursively as follows:

y[1] − h[0]x[1]

x[0]

h[2] =

y[2] − h[0]x[2] − h[1]x[1]

x[0] .. .

C H A P T E R 8: Discrete-Time Signals and Systems

For the given case where y[n] = δ[n] and x[n] = u[n], we get, according to the above,

y[1] − h[0]x[1] = 0 − 1 = −1

x[0]

h[2] =

y[2] − h[0]x[2] − h[1]x[1] =0−1+1=0

x[0]

h[3] =

y[3] − h[0]x[3] − h[1]x[2] − h[2]x[3] =0−1+1−0=0

x[0] .. .

and, in general, h[n] = δ[n] − δ[n − 1]. The length of the convolution y[n] is the sum of the lengths of the input x[n] and of the impulse

response h[n] minus one. Thus, length of h[n] = length of y[n] − length of x[n] + 1 When using deconv we need to make sure that the length of y[n] is always larger than that of x[n]. If

x[n] is of infinite length, like when x[n] = u[n], this would require an even longer y[n], which is not possible. However, MATLAB can only provide a finite-support input, so we make the support of y[n] larger. In this example we have found analytically that the impulse response h[n] is of length

2, so if the length of y[n] is chosen so that length y[n] is larger than the length of x[n] by one, we get the correct answer (case (a) in the script below); otherwise we do not (case (b)). Run the two cases to verify this (get rid of % symbol to run case (b)).

%%%%%%%%%%%%%%%%%%%%%% % Example 8.25 --- Deconvolution %%%%%%%%%%%%%%%%%%%%%% clear all x = ones(1, 100); y = [1 zeros(1, 100)]; % (a) correct h % y = [1 zeros(1, 99)]; % (b) incorrect h [h, r] = deconv(y, x)