Uploaded by Muhammad Mazhar

dsp lab manual3

advertisement
LABORATORY
EXPERIMENT
NO. 03
LINEAR TIME INVARIANT
SYSTEMS & THEIR PROPERTIES
Objectives:
•
Familiarizing students with Linear Time Invariant systems verifying its properties
Equipment required:
•
MATLAB installed on PCs
Background Knowledge:
A system is a mathematical model, a piece of code/software, a physical device, or a black box which
takes an input, processes the input signal, and generates an output. A system is a defined by the type
of input and output it deals with. A discrete time system has inputs and outputs that are discrete time
signals, and a continuous time system has inputs and outputs that are continuous time signals.
Let D[·] denote a discrete time system that has discrete time input x[n] and discrete time output y[n].
Then we denote this input/output relationship as y[n] = D [x[n]], where, we emphasize that D[·]
operates on the entire input signal x[n] to produce the output signal y[n].
Let C[·] denote a continuous time system that has continuous time input x(t) and continuous time
output y(t). Then we denote this input/output relationship as y(t) = T [x(t)].
Generally, systems are characterized into following categories:
i.
ii.
iii.
iv.
v.
vi.
Linear and non-linear systems
Time variant and time invariant systems
Static and dynamic systems
Causal and non-causal systems
Invertible and non-invertible systems
Stable and unstable systems
1|Page
Linear and Non-Linear Systems:
If a system obeys the principle of homogeneity and superposition, then it is known as a linear system.
Principle of Homogeneity:
If an input x is passed through the linear system L and results in output y, then according to principle
of homogeneity, if x is scaled by a value α and is passed through the same system L, the output will
also be scaled by α.
Superposition Principle:
According to the principle of superposition, if two inputs are added together and passed through a
linear system, the output will be the sum of the individual inputs' outputs. For instance, a system
which gives an output 𝑦1 for an input 𝑥1 and an output 𝑦2 for an input 𝑥2, must produce an output [𝑦1
+ 𝑦2] for an input [𝑥1 + 𝑥2].
The principle of homogeneity mentioned above holds in conjunction with the superposition
principle. Therefore, if the inputs x1 and x2 are scaled by factors 𝑎1 and 𝑎2 , respectively, then the sum
of these scaled inputs will give the sum of the individual scaled outputs.
A continuous-time system is said to be linear if it satisfies the principle of superposition, such as:
𝐿[ 𝑎1 𝑥1 (𝑡) + 𝑎2 𝑥2 (𝑡) ] = 𝑎1 𝐿[ 𝑥1 (𝑡)] + 𝑎2 𝐿[𝑥2 (𝑡) ] = [𝑎1 𝑦1 (𝑡) + 𝑎2 𝑦2 (𝑡)]
Similarly, a discrete-time system is said to be linear if it satisfies the principle of superposition, such
as:
𝐿[ 𝑎1 𝑥1 [𝑛] + 𝑎2 𝑥2 [𝑛] ] = 𝑎1 𝐿[ 𝑥1 [𝑛]] + 𝑎2 𝐿[𝑥2 [𝑛] ] = [𝑎1 𝑦1 [𝑛] + 𝑎2 𝑦2 [𝑛]]
Therefore, a system is called linear system if the output of the system due to weighted sum of inputs
is equal to the weighted sum of outputs.
If x[n] is an input signal and y[n] is output signal, then:
𝑦[𝑛] = 𝐿(𝑥[𝑛])
𝑦1 [𝑛] = 𝐿[ 𝑥1 [𝑛] ] 𝑎𝑛𝑑 𝑦2 [𝑛] = 𝐿[ 𝑥2 [𝑛] ]
𝑥3 [𝑛] = 𝑎1 𝑥1 [𝑛] + 𝑎2 𝑥2 [𝑛]
𝑦3 [𝑛] = 𝐿[ 𝑥3 [𝑛] ]
𝐿[𝑎1 𝑥1 [𝑛] + 𝑎2 𝑥2 [𝑛]] = 𝑎1 𝑦1 [𝑛] + 𝑎2 𝑦2 [𝑛]
2|Page
MATLAB can be used to check linearity of a system. For instance, let 𝑦[𝑛] = 3 ∗ 𝑥[𝑛], then the linearity
of this system can be verified by writing the following code:
After entering the scaling factors in the command window, the system is deemed a linear system.
This can also be verified by plotting these signals.
3|Page
Time Variant and Time Invariant Systems:
Time-invariant systems are systems where the output for a particular input does not change
depending on when that input was applied. A time-invariant system that takes in signal x(t) and
produces output y(t), when excited by signal x(t-t0), produces the time-shifted output y(t-t0). Hence,
the system is time invariant because the output does not depend on the particular time the input is
applied.
When x(t) and x(t−t0) are passed through a time-invariant system, the inputs x(t) and x(t−t0) produce
the same output. The only difference is that the output due to x(t−t0) is shifted by a time t0.
Equivalently, a discrete-time system is time or (more appropriately) shift invariant if,
𝑦[𝑛 − 𝑛0 ] = 𝑇𝐼{𝑥[𝑛 − 𝑛0 ]}
MATLAB can be used to check time-invariance or time variance of a system.
For instance, let 𝑦[𝑛] = (cos (𝑛). 𝑥[𝑛]), then time-variance of this system can be verified by writing
the given code:
4|Page
The results prove that the system is time variant.
If a system is both linear and time invariant, then that system is called Linear and Time Invariant
(LTI) system.
Linear Time Invariant System:
Impulse response is used to characterize an LTI system and is called the system’s impulse response.
The impulse response h[n] of an LTI system is the response to an impulse. The significance of h[n] is
that we can compute the response to any input once we know the response of LTI system to an
impulse signal.
5|Page
Properties of Linear Time Invariant System:
Convolution of LTI systems follows commutative, associative, and distributive law.
•
Commutative property:
𝑥(𝑡) ∗ ℎ(𝑡) = ℎ(𝑡) ∗ 𝑥(𝑡)
•
Associative property:
𝑥(𝑡) ∗ {ℎ1 (𝑡) ∗ ℎ2 (𝑡)} = {𝑥(𝑡) ∗ ℎ1 (𝑡)} ∗ ℎ2 (𝑡)
•
Distributive property:
𝑥(𝑡) ∗ {ℎ1 (𝑡) + ℎ2 (𝑡)} = 𝑥(𝑡) ∗ ℎ1 (𝑡) + 𝑥(𝑡) ∗ ℎ2 (𝑡)
Some important properties of an LTI system are given below:
1. Causality:
A causal system does not produce an output before an input is applied. Therefore, the output
of a causal system depends only on the present and past values of input but not on the future
inputs. Hence, for a causal LTI system:
ℎ(𝑡) = 0, 𝑓𝑜𝑟 𝑡 < 0
The output of a causal LTI system for a causal input is given by:
𝑡
∫ 𝑥(𝜏) ℎ(𝑡 − 𝜏)𝑑𝜏
0
2. Stability:
If for a given system every bounded input produces a bounded output, then the system is
stable. The stability of an LTI system can be determined from its impulse response. For a
continuous-time LTI system to be stable, its impulse response h(t) must be absolutely
integrable, i.e.
∞
∫ |ℎ(𝜏)|𝑑𝜏 < ∞
−∞
3. Invertibility:
A system is known as invertible only if an inverse system exists which, when cascade with
the original system, produces and output equal to the input at first system. If an LTI system
is invertible, then it will have a LTI inverse system.
4. Memory:
An LTI system is called static or memoryless system if its output at any time depends only
upon the value of the input at that time.
5. Unit step response:
When the unit step input u(t) is applied to an LTI system, then the corresponding output is
called the unit step response s(t) of the LTI system.
6|Page
Lab Tasks:
1. Suppose that an LTI system is described by impulse response ℎ[𝑛] = 𝑒 𝑛 . 𝑢[𝑛]. Compute
response of the system to the input signal 𝑥1 [𝑛] = 𝑢[𝑛 − 5] and 𝑥2 [𝑛] = 𝑢[𝑛 + 3]; where
𝑢[𝑛] exists between − 10: 10.
Hint: (𝑢[𝑛] is the unit step function. Use the ‘conv’ function for computing the convolution of
the given signals and use subplot() command to plot 𝑥[𝑛], ℎ[𝑛] and 𝑦[𝑛].
7|Page
2. Consider the given signals:
𝑥[𝑛] = sin(𝑛) . 𝑢[𝑛 − 5]
ℎ1 [𝑛] = 𝑒 −2𝑛 . 𝑢[𝑛 + 1]
ℎ2 [𝑛] = 2𝑛 . 𝑢[−𝑛]
where, 𝑛 = −15: 15. Verify distributive property of convolution of LTI systems for the given
signals. Use subplot command to plot 𝑥[𝑛], ℎ1 [𝑛], ℎ2 [𝑛], LHS and RHS results of the property.
8|Page
3. Consider the following discrete time system described by I/O relation 𝑦(𝑛) = sin (𝑛) ∗ 𝑥(𝑛).
State your assumptions in choosing signal 𝑥1 (𝑛) and 𝑥2 (𝑛) and respective time ranges. Use
subplot command to plot all the relevant plots and comment on the linearity and time
variance of the system.
Hint: The superposition theorem to prove linearity of a discrete time signal is given by:
𝐿[ 𝑎1 𝑥1 (𝑛) + 𝑎2 𝑥2 (𝑛) ] = 𝑎1 𝐿[ 𝑥1 (𝑛) ] + 𝑎2 𝐿[ 𝑥2 (𝑛) ]
9|Page
Conclusion:
10 | P a g e
Download