You are on page 1of 7

14

Lecture 3 Implementation of Discrete-Time Systems
Lets start with 1st order system: y(n) = -a1y(n – 1) +box(n) + b1 x(n – 1) or

∑ ak y(n − k ) = ∑ bk x(n − k )
k =0 k =0

M

N

This can be considered as v(n ) = bo x(n ) + b1 x(n − 1) and
y (n ) = a1 y (n − 1) + v(n )
x(n) bo v(n)

+

+ z-1

y(n)

z-1

Direct Type 1

b T1 T2

-a1

But for the LTI system, we can interchange the order and write T = T2 • T1 = T1 • T2
x(n) w(n) bo + y(n)

+ z-1 -a1

z-1 b1

From this figure we can write: w(n ) = − a1w(n − 1) + x(n )

y (n ) = bo w(n ) + b1w(n − 1)
Now we can combine the two delays and get
x(n) w(n) + z1 -a1 w(n-1) b1 bo y(n)

+

Direct form type II realization

15

So in general form

∑ ak y(n − k ) = ∑ bk x(n − k ) if N > M (always ao = 1) can be
k =0 k =0

N

N

represented as the following.
x(n) + w(n) z1 + -a1 z1 + -a2 b2 + b1 + bo + y(n)

+

-aM z1

bM

+

+

-aN

Correlation of Discrete-Time Signals Cross-Correlation
rxy (l ) = ∑ x(n )y (n − l )
n=∞
+∞

l = 0, + 1, + 2

Definition:

= ∑ x(n + l )y (n ) = x(l ) * y (− l )
n =∞

+∞

ryx (l ) = rxy (− l )
When y(n) = x(n), then it is called auto-correlation. A symmetric (even) function rxx (l ) = ∑ x(n )x(n − l ) = ∑ x(n )x(n + l ) = x(n ) * x(−n)
n =∞ n =∞
+∞ +∞

Properties

rxx (0) =

ns −∞

∑ x(n) • x(n) = ∑ x(n)
ns −∞

+∞

+∞

2

= E x energy

rxy (l ) ≤ rxx (0)ryy (0) = E x E y

16

and

rxx (l ) ≤ rxx (o ) = E x

Normalized auto or cross correlation:

ρ xx (l ) =

γ xx (l )
rxx (0)

≤1

ρ xy (l ) =

rxx (0)ryy (0)

rxy (l )

≤1

For periodic signals, the correlation function is defined in one period: rxy (l ) = lim
M 1 ∑ x(n)y(n − l ) , M →∞ 2 M + 1 n=− M

where M is the number of observed samples. If x and y are both periodic with period N, then
rxy (l ) =

1 N

∑ x(n)y(n − l ) ⇒ correlation is also a periodic sequence with period N.
n =o

N −1

Question: Consider a signal x(n ) = cos 2π 1 n for 100 samples. Its autocorrelation is 3

( )

periodic with the same 1 frequency but its magnitude decreases as l increases. Why? 3
Answer: Because we have a finite set of data recorded at M samples. So many of the

products of x(n )x (n − l ) are zero when l increases. Therefore, we should avoid computing rxx l for large lags, say l > M . 2 A Practical Application at Usage of Autocorrelation Function Lets say we have a signal with unknown period N and it is corrupted by additive white noise. Then rxx (l ) can be used to detect its periodicity y(n) = x(n) + w(n).
ryy (l ) = = = 1 M 1 M
M −1 n =o

∑ y(n )y(n − l )
M −1 n =o M −1

M >> N

∑ [x(n ) + w(n )] [x(n − l ) + w(n − l )]

1 ∑ [x(n )x(n − l ) + x(n )w(n − l ) + w(n )x(n − l ) + w(n )w(n − l )] M n >o = rxx (l ) + rww (l ) + rxw (l ) + rwx (l )

If w(n) is a white noise then it has value only at lag 0 (only rww(0) is not zero). rxw and rwx are almost zero and therefore, only rxx (l ) is showing some peaks for every period.

17

Solving Difference Equation With MatLab
Example
y (n ) − y (n − 1) + 0.9 y (n − 2 ) = x(n ) ∀n ∑ a K y (n − k ) = ∑ bK x(n − 1)
K =0 o M N

a) Calculate and plot h(n) for n = -20,…., 120 b) Calculate and plot the unit step response c) Is the system stable? Solution a) a = [1,−1,0.9 ], b = [1];
n = [− 20 : 120];

no = 0; x = [(n − no ) = 0]; % creates impulse at 0 h = filter (b, a, x);

stem (n, h); title (‘Impulse Response’); ylabel (‘h (n)’); xlabel (‘n’); b) x = [(n − no ) > = 0 ];
s = filter (b, a, x);

stem (n, s) title (‘Unit Step Response’); C) As can be seen h(n) is decaying → ∑ h(n ) can be determined by sum (abs (h )) = 14.87 < ∞ Alternative method:
z = roots (a); (characteristic roots) magz =abs(z) magz = 0.9487 0.9487
< 1 → stable

18

Z-Transform (Chapter 3)
Z-Transform plays the same role as the Laplase Transform for CT signals. It is defined

as x( z ) =

n = −∞

∑ x(n ) z

+∞

−n

x(n) Z x(z)

x(z) exists only for values that this power series converges.

The Region of Convergence (ROC) is the set of all values of z, where x(z) attains a finite value. Example 1
x1(n) = {1, 2, 5, 7, 0, 1} X1(z) = 1 + 2z-1 + 5z-2 +7z-3 +z-5 x2(n) = {1, 2, 5, 7, 0, 1} X2(z) = z2 +2z + 5 +7z-1 + z-3

ROC: entire z plane except z = o

ROC entire z plane except z = 0, ∞

Conclusion 1– In order to uniquely define x(n) from x(z), we have to know ROC. Conclusion 2 – For a finite duration signal, ROC = entire z plane except z = 0/∞
Exponential Signals

Example 1
α n x(n ) =  0

Im

n≥0 n<0
n

ROC

X ( z ) = ∑ α n z −n = ∑ α z −1
n =o n =o

(

)

α

Re

If α z −1 < 1 or z > α , then X ( z ) = In general, z = re jω → z = r > α

1 1 − α z −1

. If z = rejω, then

outside of the circle α.

X (z ) =

+∞

n = −∞

∑x

(n ) r − n e − jω n .

19

In the ROC of X(z), X ( z ) < ∞ But X ( z ) =

n = −∞

∑ x(n) r

+∞

− n − jωn

e

+∞ −∞

x(n )e − jω n r − n =

+∞ −∞

x(n ) r − n < ∞

Therefore, |x(z)| is finite if x(n)r-n is absolutely summable. In order to find the range of r, we rewrite the above as:
x( z ) ≤ ∑ x(n )r −n + ∑
−∞ −1 ∞ ∞ x(n ) ∞ x(n ) = ∑ x(− n ) r n + ∑ n n r r n =1 0

n =0

The convergence of the first term means there must exist values of r1 < ∞ such that

1 ∞

x(− n ) r1n < ∞
ROC r1

The second term implies that there exists values o < r2 < ∞ that
ROC r2


0

x(n ) <∞ r2n

Combing the two, therefore ROC is a ring 0 < r2 < r < r1 < ∞ . If r2 > r1, then there is no ROC. Example 2
 0 x(n ) = −α nU (− n − 1) =  n − α n≥0 n ≤ −1

X (z ) =

−1

−∞

(− α ) z
n

−n

=−

n =1

(α z ) , if α
−1 n

−1

z < 1 then X ( z ) =

1 − α −1 z = −1 1 − α z 1 − αz −1

20

As can be seen, X(z) of this example is the same as the one in Example 1, but their ROC are different. Here, α − 1 z < 1 →

z

α

z

α

<1→ z < α
ROC r1

Comparing Example 1 and 2: 1) We have to know ROC in order to define x(n) from X(z) uniquely. 2) ROC of a causal signal is the exterior of a circle of some radius while the ROC of a non-causal signal is the anterior of a circle. Example 3

x(n ) = α nu (n ) + β nU (− n − 1)
Z

X (z ) =
but each of these terms exists if

1 1 −α z
−1

1 1 − βz − 1

z > α and z < β
Therefore, X(z) exists if ∃α and β such that α < β . Then α < z < β is the ROC

α

β

Conclusion ROC for an infinite two-sided duration signal is a ring. Read the summary on page 159 of the textbook.