Вы находитесь на странице: 1из 7

COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, LAHORE

Department of Electrical Engineering


EEE-324 Digital Signal Processing (BCE-SP10 Spring 2012) Instructor: M. Adnan Siddique

S OLUTION OF A SSIGNMENT #1 (Compulsory submission, 20 points) (Due date: Wednesday, March 7, 2012)

Question 1 (3 points): Let h[n] = 3 1 2

u[n] 2

1 3

n1

u[n]

be the unit-sample response of an LTI system. If the input to the system is a unit step, i.e. x[n] = u[n], nd limn y[n]. Solution 1: For LTI system,

y[n] = =

k=

h[k]x[n k] 3 1 2 1 2
k

k=

1 2
k

2 2

1 3 1 3 1 3

k1

u[n k]
k1

k=0 k=0

k1

=3 Applying series summations, y[n] = 6 1 In the limiting case,


n

2
k=0

1 2

n+1

9 1

1 3

n+1

lim y[n] = 6 [1 0] 9 [1 0] = 3

Question 2 (3 points): The input to an LTI system is periodic with period N. 1. Show that the output of the system is also periodic with period N. 2. If the system is linear, but time-variant, is the output guaranteed to be periodic? 3. If the system is non-linear, but time-invariant, is the output guaranteed to be periodic? Solution 2: 1. If the input is periodic with periodic N, then it means x[n N] = x[n]. For an LTI system,

y[n] = y[n N] = =

k=

h[k]x[n k] h[k]x[n N k] h[k]x[n k] x[n] is periodic

k=

k=

=y[n] 1

Therefore, the ouput is also periodic with period N. 2. No, because if the system in time-variant, then shifts in the input do not lead to corresponding shifts in the output. 3. To ensure that the output remains periodic as well, the systems response to shifted input x[nN] (which is equal to x[n]) should be y[n N]. If time-invariance is guranteed than, periodicity will be guaranteed. However, due to non-linearity, the impulse reponse can not be used to generate the actual system output. Question 3 (3 points): Given below are the unit sample responses of some linear time-invariant systems. For each system, determine the conditions on the parameter a in order for the system to be stable. 1. h[n] = an u[n] 2. h[n] = an {u[n] u[n 100]} 3. h[n] = a|n|

Solution 3: We need to check the absoluted summability of the impulse responses. 1. |a| > 1 2. any nite value (corresponds to an FIR system) 3. |a| < 1 Question 4 (3 points): Find the average power and energy of the following sequences, check if they are power or energy signals. 1. unit step sequence, x[n] = u[n] 2. complex exponential sequence, x[n] = e jn for all n. 3. unit ramp, x[n] = n for n 0 and 0 otherwise.

The energy and the power of a signal x[n] is given by, respectively,
N

E = lim

N= n=N

|x[n]|2

P = lim 1. For x[n] = u[n],

N 1 |x[n]|2 N= 2N + 1 n=N

E = lim

N= n=N N

|u[n]|2

= lim

1 N=
n=0

P = lim = lim Therefore, unit step is a power signal.

N 1 1 N= 2N + 1 n=0

1 N +1 = N= 2N + 1 2

2. For x[n] = e jn , E . P = lim


N 1 1 N= 2N + 1 n=N

= lim Therefore, complex exponential is also a power signal. 3. For unit ramp,

N=

2N + 1 =1 2N + 1

E = lim

|n|2 N=
n=0 N N= n=0

= lim

n2

P = lim Hence, it is neither power, nor energy signal.

N 1 n2 N= 2N + 1 n=0

Question 5 (3 points): Many computers and calculators compute the square root of a positive number A using the following iterative algorithm, sn = 1 A sn1 + 2 sn1 , n = 0, 1, 2 . . .

where s1 is the initial guess (estimate of A). As the iteration converges, we get sn sn1 . Then it easily follows that sn A. Consider now the recursive system, y[n] = 1 x[n] y[n 1] + 2 y[n 1]

Use the initial condition y[1] = 1, and x[n] = Au[n]. Find the estimate of A in 3 iterations. Compute the percentage error in computation. Solution 5: 1 x[0] 1 A A+1 y[1] + = 1+ = 2 y[1] 2 1 2 1 x[1] 1 A+1 A y[0] + = + A+1 2 y[0] 2 2 2 1 (A + 1)2 + 4A A (4A + 4) + 2 4A + 4 (A + 1)2 + 4A = 1 (A + 1)2 + 4A 2 2(A + 1)

y[0] = y[1] = y[2] =

y[2] is the estimate after 3 iterations. The percentage error would be different for different values of A. The following graph gives percentage error values for different values of A (on the x-axis).
Error in square root estimate, with 3 iterations 1.4

1.2

1 Percentage Error

0.8

0.6

0.4

0.2

1 2 3 4 5 6 7 8 9 10 Input to the algorithm (numbers whose square root estimate we need

It can be seen here that the error increases with an increase in the value of A. Can the error be reduced by increasing iteration. The following gure shows the (logarthmic) error curves for different number of iterations.
Logarithmic Error in square root estimate, with different number of iterations 20 3 Iterations 4 Iterations 5 Iterations 6 Iterations

20 Percentage Error(logarithmic)

40

60

80

100

120

140

2 3 4 5 6 7 8 9 Input to the algorithm (numbers whose square root estimate we need

10

Now, it can be seen that the error reduces by many orders (since its logarithmic scale), and not just by a few fractions, with increase in the number of iterations of algorithm. Please note that the MATLAB code used here is provided to you. You are advised to study it.

Question 6 (5 points): Consider the cascade of LTI systems with unit sample responses h1 [n] and h2 [n] depicted below:

Suppose we are given the following information: h2 [n] = [n] [n 1] If the input is x[n] = u[n] u[n 2] then the output is as depicted below:

Find h1 [n]. Hints: 1. You may use the commutative property, i.e. swap positions of h1 [n] and h2 [n]. 2. A useful fact to remember in performing the convolution of two nite-length sequences is that if x[n] is of length L1 and h[n] is of length L2 , y[n] = x[n] h[n] will be of length L = L1 + L2 1. Furthermore, if the non-zero values of x[n] are contained in the interval [Mx , Nx ]and the non-zero values of h[n] are contained in the interval[Mh , Nh ], the non-zero values of of y[n] will be conned to the interval [Mx + Mh , Nx + Nh ] [Courtesy MIT Opencourseware]: Since convolution is commutative, we can convolve x[n] with h2 [n] rst followed by a convolution with h1 [n] to get y[n]. Lets start by convolving x[n] with h2 [n] and denote the result of this as x2 [n]. x[n]and h[n] are given by the following:

So, x2 [n] is given by the following 5

Now, we need to gure out the sequence h1 [n] that when convolved with x2 [n] produces y[n]. First, based on the starting and ending points of y[n], we can determine the rst and last non-zero points of h1 [n]. This is because the rst non-zero point of y[n] is at the time index that is the sum of the rst non-zero indices of x2 [n] and h1 [n]. Which means that the rst non-zero point of h1 [n] is at n = 2. Similarly, we know that the ending point is at the index n = 0 We can use ip and slide mechanics to determine the values of the samples between n = 2 and n = 0. Let the following be a general stem plot of h1 [n]:

If we ip and slide x2 [n] against h2 [n] and compare against the given y[n], we have the following:

We next use these plots to nd the values of the unknowns.

y[2] = a + 0 a=2

y[1] = b + 0 b=1 y[0] = c a c=2 Hence, we get,

Вам также может понравиться