000 Digital Control Lectures
000 Digital Control Lectures
1
A follow-up system causes an output to follow a set path that has been
specified in advance. An example is an industrial robot moving parts
from place to place.
An event control system controls a sequential series of events. An
example is a washing machine cycling through a series of programmed
steps.
The natural control systems have existed since the beginning of life,
regulates the human body temperature.
3
The sensor samples the system output that convert measurements into
electric signal that passes to the controller. Then the controller adjusts to
keep output.
The signal from the controller to the actuator is the forward path, and
the signal from the sensor to the controller is the feedback. The feedback
signal is subtracted from the set point at the comparator to get the
system error. The controller is working to minimize this error signal. A
zero error means that the output is exactly what the set point says it
should be.
The self-correcting features of closed-loop CS makes it preferable over
the open-loop control in many applications, despite the additional
hardware required, since it provides reliable.
4
2) Implementation errors. Digital processing of control signals
involves addition and multiplication by stored numerical values.
The errors that result from digital representation and arithmetic
are negligible.
3) Flexibility. An analog controller is difficult to modify or
redesign once implemented in hardware. A digital controller is
implemented in firmware or software and its modification is
possible without a complete replacement of the original
controller.
4) Speed. Increasing in computer processing speed has made it
possible to sample and process control signals at very high
speeds. Because the interval between samples, the sampling
period, can be made very small, digital controllers achieve
performance that is essentially the same as that based on
continuous monitoring of the controlled variable.
5) Cost. Advances in very large-scale integration (VLSI)
technology have made it possible to manufacture better, faster,
and more reliable integrated circuits and to offer them to the
consumer at a lower price. This has made the use of digital
controllers more economical even for small, low-cost
applications
Transfer Functions
The control system is a collection of components and circuits connected
together to perform a useful function. Each component in the system
converts energy from one form to another; for example, we might think
of a temperature sensor as converting degrees to volts or a motor as
converting volts to revolutions per minute.
A transfer function (TF) is a mathematical relationship between the
input and output of a control system component. It is expressed as
5
value. Currently, we will consider only steady-state values for the transfer
function, which is sometimes called simply the gain, expressed as
Example:
Find the TF of a potentiometer, where 0° of rotation yields 0 V and 300°
yields 10 V?
SOLUTION
The transfer function is output divided by input.
𝑜𝑢𝑡𝑝𝑢𝑡 10
𝑇𝐹 = = = 0.33 𝑉/𝑑𝑒𝑔
𝑖𝑛𝑝𝑢𝑡 300
Example:
For a temperature-measuring sensor, the input is temperature, and the
output is voltage. The sensor transfer function is given as 0.01 V/deg.
Find the sensor output voltage if the temperature is 600°F?
𝑜𝑢𝑡𝑝𝑢𝑡
𝑇𝐹 = => 𝑜𝑢𝑡𝑝𝑢𝑡 = 𝑖𝑛𝑝𝑢𝑡 𝑥 𝑇𝐹 = 600 𝑋 0.01 = 0.6 𝑉
𝑖𝑛𝑝𝑢𝑡
6
We can calculate the total transfer function (TFtot), as follow:
𝑇𝐹𝑡𝑜𝑡 = system gain = TF1 x TF2 x TF3
TF1, TF2 . . . = individual transfer functions
TF can be used to analyze an entire system components.
Example
Consider the system consists of an electric motor driving a gear train,
which is driving a winch. The motor turns at 100 rpmm for each volt
(Vm) supplied; the output shaft of the gear train rotates at one-half of the
motor speed; the winch (with a 3-inch shaft circumference) converts the
rotary motion (rpmw) to linear speed.
Solution
The individual transfer functions are given as follows:
𝑜𝑢𝑡𝑝𝑢𝑡 100 𝑟𝑝𝑚
𝑀𝑜𝑡𝑜𝑟: 𝑇𝐹𝑚 = = = 100 𝑟𝑝𝑚/𝑉
𝑖𝑛𝑝𝑢𝑡 1𝑉
𝑜𝑢𝑡𝑝𝑢𝑡 1 𝑟𝑝𝑚
𝐺𝑒𝑎𝑟: 𝑇𝐹𝑔 = = = 0.5 rpm/rpm
𝑖𝑛𝑝𝑢𝑡 2 𝑟𝑝𝑚
𝑜𝑢𝑡𝑝𝑢𝑡 3 𝑖𝑛/𝑚𝑖𝑛
𝑊𝑖𝑛𝑐ℎ: 𝑇𝐹𝑤 = = = 3 𝑖𝑛/𝑚𝑖𝑛/𝑟𝑝𝑚
𝑖𝑛𝑝𝑢𝑡 1 𝑟𝑝𝑚
7
as a robot arm or a radar antenna. A numerical control (NC) control
system directs a machine tool, such as a lathe, to machine a part
automatically.
General requirements of control system
1. A control system must be stable.
2. A control system must have a reasonable relative stability that is, the
speed of response must be reasonably fast and this response must show
reasonable damping.
3. A control system must be capable of reducing errors to zero or to some
small tolerable value
Sampling Theory
A signal is a set of data or information, e.g telephone or TV signal. The
signals are divided into analog and digital, each of them is represented as
continues-time and discrete-time signals. .
Continuous-time signal: A signal defined over a continuous range of time
(a continuous range of values, at every instant of time t.)
Discrete-time signal: A signal can be defined only at discrete instants of
time (a finite number of distinct values). , it can be obtained by sampling
a continuous-time signal.
8
can be used to measure changes in some physical phenomena such as
light, sound, pressure, or temperature.
The transmission process of digital signal is easy in digital communication
systems. While analogue signals (like Audio and video signals) cannot
process or transmit directly unless making prior treatment to convert
continues-time signals to discrete-time signals. To process these signals
using digital electronics such as computers, it must convert them to
"digital" form. To convert a signal from continuous time to discrete time,
the sampling process is used.
The sample rate is the number of times per second a controller reads in
sensor data and produces a new output value
The Nyquist Sampling Theorem explains the relationship between the
sample rate and the frequency of the measured signal. The sample rate
fs must be at least twice the bandwidth of the signal 𝑓𝑠 ≥ 2𝑓𝑚𝑎𝑥 , 𝑓𝑚𝑎𝑥 is
the maximum frequency component if the analog signal to be sampled. Half
of the sampling frequency (𝑓𝑠 /2) is called Nyquist frequency or folding
frequency. fS = (1/TS), in
9
• Nyquist rate = 2 fmax
• Nyquist frequency = fs/2.
11
For example, a sampled signal one could fit infinite continuous signals
through the samples as shown in the following figure 8.
12
Sometimes the highest frequency components of a signal are simply noise,
or do not contain useful information. To prevent aliasing of these
frequencies, we can filter out these components before sampling the
signal. Because we are filtering out high frequency components and letting
lower frequency components through, this is known as low-pass filtering.
Improperly sampled signals will have other sine wave components.
Correcting for aliasing is called anti-aliasing
13
The sequence of digital values is converted into a series of impulses at
discrete time intervals before being reconstructed into a continuous-time
signal.
14
2. Difference equation & numerical analysis:
3. Transfer method: Z-transform replaced the role of Laplace
transform in continuous domain.
4. State-space theory: The discrete time representation of state model
are obtained considering the system only at sampling point
Z - Transform
Introduction
The z-transform is a very important tool in describing and analyzing digital
systems. Z-transform is a transform technique used for discrete time
signals and systems. It is a powerful method for solving difference
equations.
The Z-transform is simply a power series representation of a discrete-time
sequence. For example, if we have the sequence X[0]; X[1]; X[2]; X[3] the
Z-transform simply multiplies each coefficient in the sequence by a power
of z corresponding to its index.
𝑋(𝑧) = 𝑋[0] + 𝑋[1]𝑍 −1 + 𝑋[2]𝑍 −2 + 𝑋[3]𝑍 −3
The development and extensive applications of the Z-transform are much
enhanced as a result of the use of digital computers.
The differences between Laplace transform and z-transform are following:
Difference equations
15
Difference equations arise in problems where the independent variable,
usually time, is assumed to have a discrete set of possible values.
The nonlinear difference equation.
Example
16
Z - Transform Definitions
Given a finite length signal X[n], the z-transform of a sequence is defined
as:
∞
Definition:
Causal Signals: A sequence x[n] is a causal sequence if x[n] = 0 for n < 0.
Note: The notation Z{X[n]} = X(z) to mean that the z-transform of the
sequence {X[n]} is X(z).
Z-Plane
The Z-plane is a complex plane with an imaginary and real axis referring
to the complex valued variable z. The position on the complex plane is
given by rejw, and the angle from the positive, real axis around the plane is
denoted by 𝜔 .
Figure: z-plane
As with the Laplace transform, the z-transform of a signal has associated
with it both an algebraic expression and a range of values of z, referred
to as the region of convergence (ROC), for which this expression is valid
18
1. The unit impulse, also called Dirac delta function, sequence is denoted
by δ(n), figure 1, and defined by:
1 𝑛=0
𝛿(𝑛) = {
0 𝑛≠0
Then only the n = 0 term in the sum is non
zero. Figure 1
The z-transform of the unit pulse, 𝛿(𝑛) = 1.
∞
𝑍 { 𝛿(𝑛𝑇)} = ∑ 𝛿(𝑛𝑇) 𝑍 −1 = 𝑍 0 = 1
𝑁=0
3. sampled exponential
𝑎𝑘 , 𝑘 ≥ 0
It is defined by 𝑋(𝑛) = {
0 , 𝑘<0
19
Sampled exponential
𝑛𝑇 𝑛≥0
𝑋(𝑛𝑇) = {
0 𝑛<0
Then 𝑋(𝑧) = ∑∞
𝑛= 0 𝑛𝑇 𝑧
−𝑛
= 𝑇 ∑ 𝑛 𝑧 −1
𝑛=0
𝑑 𝑑
Since 𝑛𝑧 −𝑛 = −𝑧 (𝑧 −𝑛 ) 𝑡ℎ𝑒𝑛 𝑋(𝑧) = −𝑇𝑧 (∑∞
𝑛=0 𝑧
−𝑛
𝑑𝑧 𝑑𝑧
𝑧
Since ∑∞
𝑛=0 𝑧
−𝑛
= (𝑧−1)
𝑡ℎ𝑒𝑛
Then
21
It is defined by
𝑎𝑛 𝑛≥0
𝑎𝑛 𝑢(𝑛) = {
0 𝑛≠0
𝑋(𝑧) = 1 + 𝑎 𝑧 −1 + 𝑎2 𝑧 −2 + 𝑎3 𝑧 −3 + 𝑎4 𝑧 −4 + . . . + 𝑎2 𝑧 −𝑛 + ⋯
This sum can be written as,
1
𝑋(𝑧) =
1 + 𝑎𝑧 −1
Example 6: Find the z-transform of the following causal sequences
Solution:
Table 1:
21
Poles and zeros representation
1 . Linearity [17]
For two sequences and their associated z-transforms and ROC’s, the
linearity property states:
𝑍(𝑎𝑋1 (𝑛) + 𝑏𝑋2 (𝑛)) = 𝑎𝑍(𝑋1 (𝑛) + 𝑋2 (𝑛))
Where a and b are constants.
The ROC contains 𝑅𝑥1 ∩ 𝑅𝑥2
Example 10: Find the Z-transform of 𝑋[𝑛] = 𝑢[𝑛] − (0.5)𝑛 𝑢(𝑛)?
22
From the ROC, this is a right-sided sequence. Rewriting,
Note that this result could also have been easily obtained using a partial
fraction expansion.
Example 11: Find the Z-transform y(n) = (0.5)(n-5).u(n-5) where u(n-5)=1
for n ≥ 5 and u(n-5) =0 for n<5?
Solution
𝑧
Using the property 𝑎𝑛 𝑢[𝑛] =
𝑧−𝑎
4.4 Convolution
This property states that
𝑋1 [𝑛] ∗ 𝑥2 [𝑛] = 𝑋1 (𝑧)𝑋2 (𝑧) 𝑅𝑂𝐶 = 𝑅𝑋1 ∩ 𝑅𝑋2
Example 12: Find the Z-transform of the convolution for the following
sequences?
Solution
Applying z-transform on the two sequences,
23
Therefore the result is
24
The region of convergence (ROC) is the set of z values in the complex
plane for which the Z-transform of a signal X[n] converges, the region
where z-transform exists. The ROC for a given x [n] must satisfy
∞
∑ |x[n]z −n | < ∞
n=−∞
Which means that z-transform therefore exists (or converges). The ROC
therefore consists of a ring in the z-plane, figure 3.
Clarification
The sum of 𝑋(𝑧) = ∑∞ 𝑛 −𝑛
𝑛=0 𝑎 𝑧 𝑐𝑜𝑛𝑣𝑒𝑟𝑔𝑒𝑠 𝑜𝑛𝑙𝑦 𝑓𝑜𝑟 |𝑧| > |𝑎|
The sum of 𝑋(𝑧) = ∑−1 𝑛 −𝑛
𝑛=−∞ 𝑎 𝑧 𝑐𝑜𝑛𝑣𝑒𝑟𝑔𝑒𝑠 𝑜𝑛𝑙𝑦 𝑓𝑜𝑟 |𝑎| > |𝑧|
They have the same X(z) but they differ in ROC.
25
X[n] = {. . . , 0.5-3, 0.5-2, 0.5-1, 1, 0.5, 0.52, 0.53 . . .}
There are no values of z that satisfy this condition.
Solution
∞
𝑋(𝑧) = ∑ (𝑋[𝑛] 𝑍 −𝑛 )
𝑛=−∞
∞
= ∑ (𝛼 𝑛 𝑢[𝑛] 𝑍 −𝑛 )
𝑛=−∞
∞
= ∑(𝛼 𝑛 𝑍 −𝑛 )
𝑛=0
∞
= ∑ ((𝛼𝑍 −1 )𝑛 )
𝑛=0
Figure:
This sequence is an example of a right-sided exponential sequence because
it is nonzero for n ≥ 0. It only converges when |αz−1| < 1. When it converges,
1 𝑧
𝑋(𝑧) = =
1 − 𝛼𝑧 −1 𝑧−𝛼
If |𝛼𝑧 −1 | ≥ 1 then the series ∑∞ −1 𝑛
𝑛=0((𝛼𝑧 ) ) does not converge. Thus the
ROC is the range of values where |𝛼𝑧 −1 | < 1 𝑜𝑟 |𝑧| > |𝛼|
Properties of the region of convergence
The ROC has a number of properties that depend on the nature of the
signal. These properties are:
1) The ROC is a ring or disk in the z-plane, centered about the origin.
2) The Fourier transform of x[n] converges absolutely if and only if the
ROC of the z-transform includes the unit circle.
26
3) The ROC cannot contain any poles. By definition a pole is a
where X(z) is infinite. Since X(z) must be finite for all z for
convergence, there cannot be a pole in the ROC.
4) The ROC for finite-length sequence is the entire z-plane except perhaps
at z = 0 or z = ∞.
5) The ROC for a right-handed sequence, X[n], extends outward from the
outermost pole possibly including z=
6) The ROC for a left-handed sequence extends inward from the
innermost pole possibly including z=0
1) 𝑋1 (𝑧) = ∑∞ 𝑛
𝑛=−∞ 𝑎 𝑢[𝑛]𝑧
−𝑛
𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 (1)
27
2)
1 𝑛 −1 𝑛
Example: Find the ROC for 𝑋1 [𝑛] = ( ) 𝑢[𝑛] + ( ) 𝑢[𝑛]
2 4
1 𝑛
The Z-transform of ( ) 𝑢[𝑛]𝑖𝑠
2
𝑧 1
𝑤𝑖𝑡ℎ 𝑅𝑂𝐶 𝑎𝑡 |𝑧| >
1 2
𝑧−
2
−1 𝑛
The Z-transform of ( ) 𝑢[𝑛]𝑖𝑠
4
𝑧 −1
𝑤𝑖𝑡ℎ 𝑅𝑂𝐶 𝑎𝑡 |𝑧| >
1 4
𝑧+
4
28
29
31
Inverse of Z-Transform
Let X[n] is the continuous time function whose Z-transform is X(z) then
the inverse transform is not necessarily equal to X[n], rather it is equal to
X(nT) which is equal to X[n] only at the sampling instants. Once X[n] is
sampled by an the ideal sampler, the information between the sampling
instants is totally lost and we cannot recover actual X[n] from X(z),
𝑋[𝑛𝑇] = 𝑍 −1 [𝑋(𝑧)]
The transform can be obtained by using
1. Inspection method
2. Long division method.
3. Partial fraction method
4. Power series method.
𝑋1(𝑧) = 𝑋0 + 𝑋1 𝑍 −1 + ⋯ + 𝑋𝑛 𝑍 −𝑛 = ∑ 𝑋[𝑛]𝑍 −𝑛
𝑛=0
b) Use the coefficients of the expansion to write the time sequence (X1,
X2, … , Xi). where i is number of points in the time sequence.
0.5 𝑍 2 +0.5 𝑍)
Example: Finding the inverse Z transform of 𝐻(𝑧) = ?
𝑍 2 −𝑍+0.5
31
Answer
The long division is
Ans:
1. Long division
2) Inverse transform
X[n] = {0,1,0.8, -0.26}
32
3. Partial-Fraction Expansion (PFE) Method
This method expand X(z)/z rather than X(z). The PFE is used to express
the X(z) as a sum of simple terms for which the inverse transform may be
recognized by inspection method ( available in Z-transform table).
33
b) Obtain the inverse transform X[n] using the Z-transform tables.
The ROC plays a critical role in this process.
𝐴(𝑧) ∑𝑀
𝑘=0 𝑏𝑘 𝑍
−𝑘
𝑋(𝑍) = = ∑𝑁 −𝑘
𝑖𝑓 𝑀 < 𝑁
𝐵(𝑧) 𝑘=0 𝑎𝑘 𝑍
34
𝐺(𝑧) 2𝑍 + 2 𝐴 𝐵
= = +
𝑍 (𝑍 + 3)(𝑍 − 1) 𝑍+3 𝑍−1
. Z= -3 ونعوضZ بالمعادلة االصلية الناتجة من القسمة علىA نضرب مقامA اليجاد
2𝑍 + 2 −4
𝐴= |𝑍→−3 = =1
𝑍−1 −4
2𝑍 + 2 4
𝐵= |𝑍=1 = = 1
𝑍+3 4
𝐺(𝑧) 1 1
= +
𝑍 𝑍+3 𝑍−1
𝑍 𝑍
𝐺(𝑧) = +
𝑍+3 𝑍−1
Example 1
Find the Z-transform using partial fraction expansion for
1− 𝑍 −1
𝑋(𝑧) = 1 1 ?
(1− 𝑍 −1 )(1− 𝑍 −1)
2 3
Answer
1 1
To solve for A1 and A2, multiply both sides by (1 − 𝑍 −1 )(1 − 𝑍 −1) ) to
2 3
obtain
So,
To check:
35
Now, we have
Possible of ROCs
And
36
And
𝟏− 𝒁−𝟏 −𝟑 𝟒
𝐴𝑔𝑎𝑖𝑛, 𝑓𝑜𝑟 𝒀(𝒛) = 𝟏 𝟏 = 𝟏 + 𝟏 ?
(𝟏− 𝒁−𝟏 )(𝟏− 𝒁−𝟏) 𝟏− 𝒁−𝟏 𝟏− 𝒁−𝟏
𝟐 𝟑 𝟐 𝟑
There are three possible of ROCs for a signal with this z-transform.
𝟏 𝟏
< |𝒛| <
𝟑 𝟐
𝟏
|𝒛| <
𝟑
37
Power Series Expansion:
The defining expression for the z-transform [Eq. (4.3)] is a power series
where the sequence values x[n] are the coefficients of z-n. Thus, if X(z) is
given as a power series in the form
𝑿[𝒛] = ∑∞
𝒏=−∞ 𝑿[𝒏]𝒁
−𝟏
a) Since the ROC is |z| > |a|, that is, the exterior of a circle, X[n] is a right-
sided sequence. Thus, we must divide to obtain a series in the power of z –
1
. Carrying out the long division, we obtain
38
Thus
So, we have
And we obtain
(b) Since the ROC is lzl < lal, that is, the interior of a circle, x[n] is a left-
sided sequence. Thus, we must divide so as to obtain a series in the power
of z as follows, Multiplying both the numerator and denominator of X(z)
by z, we have
39
Thus
So, we have
Examples
Example 4 Find the inverse Z-transform of
Answer
41
Z-Transform solution of difference equations
Difference equation is an equation that defines s sequence recursively,
each term in the sequence is defined as function of the previous terms in
the sequence. The linear form of it is:
𝑦(𝑘 + 𝑛) + 𝑎𝑛−1 𝑦(𝑘 + 𝑛 − 1) + ⋯ , 𝑎1 𝑦(𝑘 + 1) + 𝑎0 𝑦(𝑘)
= 𝑏𝑛 𝑢(𝑘 + 𝑛) + 𝑏𝑛−1 𝑢(𝑘 + 𝑛 − 1) + ⋯
+ 𝑏1 𝑢(𝑘 + 1), 𝑏0 𝑢(𝑘)]
We further assume that the coefficients ai, bi, i=0, 1, 2, … , are constant.
The difference equation is then referred to as linear time invariant, or
LTI. If the forcing function u(k) is equal to zero, the equation is said to be
homogeneous.
Example : For each of the following difference equations, determine the
order of the equation.
Is the equation (a) linear, (b) time invariant, or (c) homogeneous?
1. 𝑦(𝑘 + 2) + 0.8𝑦(𝑘 + 1) + 0.07𝑦(𝑘)𝑢(𝑘)
2. 𝑦(𝑘 + 4) + sin(0.4𝑘) 𝑦(𝑘 + 1) + 0.3𝑦(𝑘) = 0
3. 𝑦(𝑘 + 1) = −0.1𝑦 2 𝑦(𝑘)
Ans:
1. The equation is second order. All terms enter the equation linearly
and have constant coefficients. The equation is therefore LTI. A
forcing function appears in the equation, so it is nonhomogeneous.
2. The equation is fourth order. The second coefficient is time
dependent, but all the terms are linear and there is no forcing
function. The equation is therefore linear time varying and
homogeneous.
3. The equation is first order. The right-hand side (RHS) is a
nonlinear function of y(k), but does not include a forcing function
or terms that depend on time explicitly. The equation is therefore
nonlinear, time invariant, and homogeneous
41
and inverse z-transformed. To transform the difference equation, we
typically use the time delay or the time advance property. Inverse z-
transformation is performed using the methods of discrete time signal.
time delay and time advance البد من ان نستذكر قوانين، قبل البدء بشرح الموضوع
مع التطرق لمثال على كل منهم
Time delay
The equation of the time delay property is
𝑍{𝑋[𝑘 − 𝑛]} = 𝑍 −𝑛 𝑋(𝑧)
Example 5-1: Find the z-transform of the causal sequence
4 𝑓𝑜𝑟 𝑘 = 2,3,4 …
𝑋[𝑘] = {
0 𝑜𝑡ℎ𝑒𝑟 𝑤𝑖𝑠𝑒
Solution
The given sequence is a sampled step starting at k52 rather than k50 (i.e.,
it is delayed by two sampling periods). Using the delay property, we have
4𝑧 4
𝑋(𝑧) = 𝑍{4 ∗ 1(𝑘 − 2)} = 4𝑍 −2 𝑍{1(𝑘)} = 𝑍 −2 =
𝑧−1 𝑧(𝑧 − 1)
تبدأ منsampled step sequence فان المتسلسلة تعود الى4 الن القيمة ثابتة وهي:مالحظة
. بدال من الصفر2 القيمة
Time advance
𝑍{𝑋[𝑘 + 1]} = 𝑧𝑋(𝑧) − 𝑧𝑋[0]
𝑍{𝑋[𝑘 + 𝑛]} = 𝑧 𝑛 𝑋(𝑧) − 𝑧 𝑛 𝑋[0] − 𝑧 𝑛−1 𝑋[1] − ⋯ − 𝑧𝑋[𝑛]
Example 5-2
Using the time advance property, find the z-transform of the causal
sequence {X[k]} = { 4, 8, 16, …}?
Solution
The sequence can be written as
42
𝑋[𝑘] = 2𝑘+2 = 𝑦[𝑘 + 2] 𝑘 = 0,1,2, …
Where y[k] is the exponential time function
𝑦[𝑘] = 2𝑘 , 𝑘 = 0,1,2,…
Using the time advance property, the transform is
𝑋(𝑧) = 𝑧 2 𝑦(𝑧) − 𝑧 2 𝑦[0] − 𝑧𝑦[1]
𝑧 4
𝑋(𝑧) = 𝑧 2 − 𝑧 2 − 2𝑧 =
𝑧−2 𝑧−2
1. z-transform
We begin by z-transforming the difference equation using time advance
equation to obtain.
3 1
[𝑧 2 𝑋(𝑧) − 𝑧 2 𝑋[0] − 𝑧𝑋[1]] − 2 𝑧𝑋[𝑧] − 𝑧𝑋[0] + 2 𝑋[𝑧] = 1[𝑘]
2. Solve for X(z)
Then we substitute the initial conditions and rearrange terms to obtain
3 1 𝑧 5 3
[𝑧 2 − 𝑧 + ] 𝑋[𝑧] = + 𝑧2 + ( − ) 𝑧
2 2 𝑧−1 2 2
Which we solve for
𝑧[1 + (𝑧 + 1)(𝑧 − 1)] 𝑧3
𝑋(𝑧) = =
(𝑧 − 1)(𝑧 − 1)(𝑧 − 0.5) (𝑧 − 1)2 (𝑧 − 0.5)
3. Find the Partial Fraction Expansion
43
The partial fraction of X(z)/z is
𝑋(𝑧)
=
𝑧
Where
Thus, the partial fraction expansion in this special case includes two
terms only. We now have
4. Inverse z-transformation
From the z-transform tables, the inverse z-transform of X(z) is
44
Substitute the values of y(0) and y(1) and arrangement the equation
𝑧
𝑧 2 𝑦(𝑧) + 𝑧 2 − 𝑧 + 5𝑧 𝑦(𝑧) + 5𝑧 + 6𝑦(𝑧) =
(𝑧 − 1)2
𝑧
𝑦(𝑧){𝑧 2 + 5𝑧 + 6} + 𝑧 2 + 4𝑧 =
(𝑧 − 1)2
𝑧
𝑦(𝑧){𝑧 2 + 5𝑧 + 6} = − 𝑧 2 − 4𝑧
(𝑧 − 1)2
𝑧 𝑧 2 − 4𝑧
𝑦(𝑧) = −
(𝑧 − 1)2 (𝑧 2 + 5𝑧 + 6) 𝑧 2 + 5𝑧 + 6)
−𝑧 4 − 2𝑧 3 + 7𝑧 2 − 3𝑧
𝑦(𝑧) =
(𝑧 − 1)2 (𝑧 2 + 5𝑧 + 6)
𝑦(𝑧) −𝑧 3 − 2𝑧 2 + 7𝑧1 − 3 𝐴 𝐵 𝐶1 𝑐2
= = + + +
𝑧 (𝑧 − 1)2 (𝑧 + 3)(𝑧 + 2) 𝑧 + 2 𝑧 + 3 𝑧 − 1 (𝑧 − 1)2
After finding A, B, C1, C2, we get
17 15 7 1
𝑦(𝑧) −
= 9 + 16 − 144 + 12
𝑧 𝑧 + 2 𝑧 + 3 𝑧 − 1 (𝑧 − 1)2
17 15 7 1
𝑦(𝑧) = (−2)𝑘 + (−3)𝑘 − 𝑢[𝑘] + 𝑘
9 16 144 12
𝑋(𝑧) 𝑍−3
=
𝑍 (𝑍 − 1)(𝑍 − 2)(𝑍 − 4)
𝑍−3 𝐴 𝐵 𝐶
= + +
(𝑍 − 1)(𝑍 − 2)(𝑍 − 4) 𝑍 − 1 𝑍 − 2 𝑍 − 4
Using partial fraction A= – 2/3, B = 1/2 , C=1/6
−2/3 1/2 1/6 −2 𝑍 1 𝑍 1 𝑍
𝑋(𝑧) = + + = . + +
𝑍−1 𝑍−2 𝑍−4 3 𝑍 − 1 2𝑍 − 2 6𝑍 − 4
Taking inverse Z-transform of both sides
−2 −1 𝑍 1 𝑍 1 𝑍
𝑍 −1 {𝑋(𝑧)} = .𝑍 { } + 𝑍 −1 { } + 𝑍 −1 { }
3 𝑍−1 2 𝑍−2 6 𝑍−4
−2 1 1
𝑢(𝑛) = . (1)𝑛 + (2)𝑛 + (4)𝑛
3 2 6
−2 1 1
𝑢(𝑛) = + (2)𝑛 + (4)𝑛
3 2 6
More examples
Example: Using Z-transform, solve the difference equation?
𝑦(𝑘 + 1) − 3𝑦(𝑘) = −6 , 𝑤ℎ𝑒𝑟𝑒 𝑦(0) = 1
Ans.
1. z-transform
𝑍{𝑦(𝑘 + 1) − 3𝑍{𝑦(𝑘) = 𝑍{−6}
−6𝑧
𝑍{𝑦(𝑘 + 1) = 𝑧 𝑍{𝑦(𝑘)} − 𝑧 𝑦(0) =
𝑧−1
−6 𝑧 −6𝑧 + 𝑧(𝑧 − 1) 𝑧 2 − 7𝑧
(𝑧 − 3) 𝑍{𝑦(𝑘) = +𝑧 = =
𝑧−1 𝑧−1 𝑧−1
46
𝑍 2 − 7𝑍
𝑍{𝑦(𝑘)} =
(𝑍 − 1)(𝑍 − 3)
𝑍{𝑦(𝑘)} 𝑧−7
=
𝑧 (𝑧 − 1)(𝑧 − 3)
Applied partial fraction
𝑍{𝑦(𝑘)} 𝐴 𝐵
= +
𝑧 𝑧−1 𝑧−3
𝑧−7 1 − 7 −6
𝐴= |𝑧=1 = = =3
(𝑧 − 1)(𝑧 − 3 1 − 3 −2
𝑧−7 3 − 7 −4
𝐵= |𝑧=3 = = = −2
(𝑧 − 1)(𝑧 − 3 3−1 2
3𝑧 2𝑧
𝑍{𝑦(𝑘)} = −
(𝑍 − 1) 𝑧 − 3
𝑧 𝑧
𝑦(𝑘) = 3𝑍 −1 { } − 2𝑍 −1 { }
𝑧−1 𝑧−3
𝑦(𝑘) = 3𝑢(𝑘) − 2(3𝑘 )
1
Example: For the difference equation [𝑛] − 𝑦[𝑛 − 1] = 𝑢[𝑛] 𝑓𝑜𝑟 𝑛 ≥ 0
2
, where y[-1]=0?
Answer
Example: Solve
Ans.
47
First, shift the equation so that we can take advantage of the form of the
initial conditions. We replace 𝑘 → 𝑘 − 2 to obtain
48
Second order difference equation
To solve 2nd order linear constant coefficient difference equation two
initial conditions are required. typically either y0 and y1 or y−1 and
y−2..
Example: Solve the difference equation
𝑦(𝑛 + 2) = 𝑦(𝑛 + 1) + 𝑦(𝑛)?
Sol.
Begin by taking the z-transform, then insert the initial conditions and
solve the resulting algebraic equation for Y (z), the z-transform of {yn}:
49
Now solve the quadratic equation z2 − z − 1 = 0 and hence factorize the
denominator.
This form for Y (z) often arises in solving second order difference
equations. Write it in partial fractions and find y(n), leaving a and b as
general at this stage:
With an appropriate computational aid you could (i) check that this
formula does indeed give the familiar sequence
{1, 1, 2, 3, 5, 8, 13, . . .}
51
Example 2:
Use the right shift property of z-transforms to solve the second order
difference Equation 𝑦(𝑛) − 7𝑦(𝑛 − 1) + 10𝑦(𝑛 − 2) =
0, 𝑤𝑖𝑡ℎ 𝑦(𝑛 − 1) = 16 𝑎𝑛𝑑 𝑦(−2) = 5?
Sol:
51
The convolution summation for causal system (whose impulse response
is zero for negative time) can be calculated by
𝑘
52
2. Alternatively, z-transforming the difference equation yields the transfer
function.
𝑌(𝑧) 1
𝐻(𝑧) = =
𝑈(𝑧) 𝑧 − 0.5
Inverse-transforming with the delay theorem gives the impulse response
𝑖−1,
ℎ(𝑖) = {(0.5) 𝑖 = 1,2,3, …
0 𝑖 <1
𝑖 + 1, 𝑖 = 0,1,2, …
𝑦(𝑖) = {
0, 𝑖<0
Note: For higher-order difference equations, obtaining the response in
closed form directly may be impossible, whereas z-transforming to obtain
the response remains a relatively simple task
53
and magnitude scaling. The scale factor and phase shift define a complex
function of frequency known as the frequency response.
For a sinusoidal input at frequency f, the output is
a sinusoid at the same frequency,
scaled in amplitude, and
Phase shifted.
This can be represented by a single complex number H(f ).
The frequency response is the behavior of the system for sinusoidal
input.
So, the relationship of a linear time invariant system in the time domain
and frequency domain are as follow:
Digital Processor
Input signal Output signal
54
There are two methods to obtain frequency response:
1. Using the impulse response.
Knowing the impulse response of LTI system, the frequency response of
the system will be the Fourier transform of the impulse response ( the
spectrum of h(n).
∞
∑ 𝑎𝑘 𝑦(𝑛 − 𝑘) = ∑ 𝑏𝑘 𝑥(𝑛 − 𝑘)
𝑘=0 𝑘=0
𝑦(𝑤) ∑𝑀
𝑘=0 𝑏𝑘 𝑒
−𝑗𝑤𝑘
= 𝐻(𝑤) = 𝑁
𝑋(𝑤) ∑𝑘=0 𝑎𝑘 𝑒 −𝑗𝑤𝑘
55
The general equation to find the frequency response, H(w), for any
recursive or nonrecursive LTI processor.
Example: Determine the frequency response of the following system?
Ans:
Y(n)= X(n) – X(n-1) – 0.8 y(n-1)
1) Frequency response using Impulse response
ℎ(𝑛) = 𝛿(𝑛) − 𝛿(𝑛 − 1) − 0.8ℎ(𝑛 − 1)
ℎ(−1) = 0 − 0 − 0 = 0
ℎ(0) = 1 − 0 − 0 = 1
ℎ(1) = 0 − 1 − 0.8 × 1 = −1.8
ℎ(2) = 0 − 0 − 0.8(−1.8) = 0.8(1.8)
ℎ(3) = 0 − 0 − 0.8(0.8(1.8)) = −0.82 (1.8)
ℎ(4) = 0 − 0 − 0.8(−0.82 (1.8)) = 0.83 (1.8)
.
.
∞
1
𝐻(𝑤) = 1 − 1.8𝑒 −𝑗𝑤 ( )
1 + 0.8𝑒 −𝑗𝑤
1.8𝑒 −𝑗𝑤 1 + 0.8𝑒 −𝑗𝑤 + 1.8 𝑒 −𝑗𝑤
=1− =
1 + 0.8𝑒 −𝑗𝑤 1 + 0.8𝑒 −𝑗𝑤
𝑒 −𝑗𝑤
𝐻(𝑤) = 1 −
1 + 0.8𝑒 −𝑗𝑤
56
2) Using the difference equation of a LTI system
𝑏0 𝑒 0 + 𝑏1 𝑒 −𝑗𝑤 1 − 𝑒 −𝑗𝑤
𝐻(𝑤) = =
𝑎0 𝑒 0 + 𝑎1 𝑒 −𝑗𝑤 1 + 0.8 𝑒 −𝑗𝑤
The result is the same as the first method.
By substitute 𝑒 −𝑗𝑤 = cos(𝑤) − 𝑗𝑠𝑖𝑛(𝑤)
1 − cos(𝑤) + 𝑗𝑠𝑖𝑛(𝑤)
𝐻(𝑤) =
1 + 0.8 cos(𝑤) − 𝑗0.8 sin(𝑤)
√(1 − cos(𝑤))2 + (sin(𝑤))2
|𝐻(𝑤)| =
√(1 + cos(𝑤))2 + (0.8sin(𝑤))2
sin(𝑤) −0.8 sin(𝑤)
∅𝐻(𝑤) = 𝑡𝑎𝑛−1 − 𝑡𝑎𝑛−1
1 − cos(𝑤) 1 + 0.8 cos(𝑤)
w |H(w)| w ∅H(w)
0 0 0 𝜋/2
𝜋/2 1.1 𝜋/2 45+38.6=83.6
𝜋 10 𝜋 0
3 𝜋/2 1.1 3 𝜋/2 -83.6
2𝜋 0 2𝜋 𝜋/2
|H(w)|
𝜋 2𝜋 𝜋 2𝜋
Note: sampled sinusoids are only periodic if the ratio of the period of the
waveform and the sampling period is a rational number
(equal to a ratio of integers). However, the continuous
envelope of the sampled form is clearly always periodic
57
Properties of the frequency response of discrete-time systems
1) DC gain: The DC gain is equal to H(1).
𝐻(𝑒 𝑗𝑤𝑇 )|𝑤=0 = 𝐻(𝑧)|𝑧→1 = 𝐻(1)
2) Periodic nature: The frequency response is a periodic function of
frequency with period ωs52π/T rad/s.
3) Symmetry: For transfer functions with real coefficients, the
magnitude of the transfer function is an even function of frequency
and its phase is an odd function of frequency.
Notes:
1) We only need to obtain H(ejωT) for frequencies ω in the range
from DC to ws/2.
2) The frequency response for negative frequencies can be
obtained by symmetry, and for frequencies above ws/2 the
frequency response is periodically repeated.
3) Frequency response H(ejwT) is periodically repeated for above
ws/2.
4) Negligible frequency response amplitudes H(jw) for w> ws/2,
has no overlap of repeated frequency response cycles.
5) Sampling with no overlap periodic repetition of the
frequency response of a continuous time system.
6) Frequency responses of physical systems are not bandlimited
overlapping of the repeated frequency response cycles (folding).
7) Ws/2 is known as the folding frequency.
8) Folding results in distortion of the frequency response and
should be minimized by proper choice of the sampling
frequency Ws/2 or filtering.
Figure bellow shoe the magnitude of the frequency response of a
second-order underdamped digital system.
58
Fig: Magnitude of the frequency response of a digital system.
59
Zero – Order Hold (ZOH)
تحتاج الى عملية وسطية تسمىdigital الىanalog ان عملية تحويل االشارة من
holding باالضافة الى عملية اخرى هيsamplingال
Analog Sampling Holding Digital
بمسك القيمة التيZOH تقوم دائرة، ZOH تنفذ من خالل استخدامholding ان عملية
حيث يقوم بتحويل النبضات. لفترة من الزمن لحين وصول نبضة جديدةsampler يوجدها ال
.plant الى مستويات ضمن فترة زمنية العطاء وقت لحساب ارتفاعها ثم يمررها الى ال
ZOH G(S)
X(t) y(t)
61
61
62
63
64
65
66
67