0% found this document useful (0 votes)
69 views

New Era University: College of Engineering and Architecture Department of Electronics Engineering

The document is a laboratory report that: 1) Describes using MATLAB to simulate discrete-time systems and investigate their time domain properties. It defines linear and non-linear systems. 2) Presents an example linear system of equations and shows solving it using MATLAB. 3) Defines properties of linear, time-invariant, and causal discrete-time systems. 4) Gives an exercise to generate input sequences, compute outputs, and determine if a given system is linear by checking if the superposition property holds.

Uploaded by

Le Andro
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

New Era University: College of Engineering and Architecture Department of Electronics Engineering

The document is a laboratory report that: 1) Describes using MATLAB to simulate discrete-time systems and investigate their time domain properties. It defines linear and non-linear systems. 2) Presents an example linear system of equations and shows solving it using MATLAB. 3) Defines properties of linear, time-invariant, and causal discrete-time systems. 4) Gives an exercise to generate input sequences, compute outputs, and determine if a given system is linear by checking if the superposition property holds.

Uploaded by

Le Andro
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

NEW ERA UNIVERSITY

College of Engineering and Architecture

Department of Electronics Engineering

LABORATORY REPORT NO. 4

Understanding Discrete-Time Systems using MATLAB

NAME: LAPEÑA, LEANDRO I. SCHEDULE: W 10:00-1:00PM

SECTION: 4ECE A INSTRUCTOR: ENGR. ESMERALDA MANIQUIS

RATING
Understanding Discrete-Time Systems using MATLAB
Theory:

A discrete-time system processes an input signal in the time-domain to generate an output signal with more
desirable properties by applying an algorithm composed of simple operations on the input signal and its delayed
versions.

Objective:

 To illustrate the simulation of some simple discrete-time systems on the computer using MATLAB and
investigate their time domain properties.

 To identify which systems are linear and non-linear

For a linear discrete-time system , if y1[n] and y2[n] are the responses to the input sequences x1[n] and x2[n],
respectively, then for an input:

x[n] = αx1[n] + β x2[n],

the response is given by

y[n] = αy1[n] + β y2[n]

The superposition property of the second equation must hold for any arbitrary constants α and β and for all
possible inputs x1[n] and x2[n]. If it does not hold for at least one set of nonzero values of α and β, or one set of
nonzero input sequences x1[n] and x2[n], then the system is nonlinear.

To solve a linear system, we use the “forward slash” command “\”. For example to solve

we do
Note: We can format the output by using the MATLAB command “format”. Use the command “format short and
format long, respectively. Observe what will happen. Include this in your command to display the result.

Exercise:

1. The linear system of equations:


x1 + x 2 + x3 = 3
x1 + (-1)x2 + 4x3 = 4
2x1 + 3x2 + (-5)x3 = 0

is of order n = 3 with unknowns x1, x2 and x3. The matrix-vector form of this linear system is Ax = b where

As will be verified later, this linear system has precisely one solution, given by x 1 = 1, x2 = 1 and x3 = 1, so the
solution vector is:

2. Consider the linear system given above. If the coefficient matrix A remains unchanged, then what choice

of right hand side vector b would lead to the solution vector x = ?


 For a time-invariant discrete-time system , if y1[n] is the response to an input x1[n], then the response to
an input

x[n] = x1[n − no]


is simply
y[n] = y1[n − no]
where no is any positive or negative integer. The above relation between the input and output must hold for
any arbitrary input sequence and its corresponding output. If it does not hold for at least one input sequence
and its corresponding output sequence, the system is time-varying.

 A linear time-invariant (LTI) discrete-time system satisfies both the linearity and the time-invariance
properties.

 If y1[n] and y2[n] are the responses of a causal discrete-time system to the inputs u1[n] and u2[n],
respectively, then
u1[n] = u2[n] for n < N
implies also that

y1[n] = y2[n] for n < N

 The response of a discrete-time system to a unit sample sequence {δ[n]} is called the unit sample
response or, simply, the impulse response , and denoted as {h[n]}. Correspondingly, the response of a
discrete-time system to a unit step sequence {μ[n]}, denoted as {s[n]}, is its unit step response or, simply
the step response.
 An LTI discrete-time system is causal if and only if its impulse response sequence {h[n]} satisfies the
condition
h[k] = 0 for k < 0.

Exercise:

Given the system:

y[n]−0.4 y[n−1]+0.75 y[n−2] = 2.2403 x[n]+2.4908 x[n−1]+2.2403 x[n−2]

generate three different input sequences x1[n], x2[n], and x[n] = a · x1[n]+b · x2[n], and to compute and plot the
corresponding output sequences y1[n], y2[n], and y[n] using the MATLAB codes given below.

DSP_4_1

% Program DSP_4_1
% Generate the input sequences
clf;
n = 0:40;
a = 2;b = -3;
x1 = cos(2*pi*0.1*n);
x2 = cos(2*pi*0.4*n);
x = a*x1 + b*x2;
num = [2.2403 2.4908 2.2403];
den = [1 -0.4 0.75];
ic = [0 0]; % Set zero initial conditions
y1 = filter(num,den,x1,ic); % Compute the output y1[n]
y2 = filter(num,den,x2,ic); % Compute the output y2[n]
y = filter(num,den,x,ic); % Compute the output y[n]
yt = a*y1 + b*y2;
d = y - yt; % Compute the difference output d[n]
% Plot the outputs and the difference signal
subplot(3,1,1)
stem(n,y);
ylabel(‘Amplitude’);
title(‘Output Due to Weighted Input: a \cdot+ x_{1}+[n] + b \cdot+ x_{2}+[n]’);
subplot(3,1,2)
stem(n,yt);
ylabel(‘Amplitude’);
title(‘Weighted Output: a \cdot+ y_{1}+[n] + b \cdot+ y_{2}+[n]’);
subplot(3,1,3)
stem(n,d);
xlabel(‘Time index n’); ylabel(‘Amplitude’);
title(‘Difference Signal’);

1. Run Program DSP_4_1 and compare y[n] obtained with weighted input with yt[n] obtained by combining
the two outputs y1[n] and y2[n] with the same weights. Are these two sequences equal? Is this system
linear?
The two sequences are not equal.
Yes, they are linear because the graph shows the responses of the inputs, which gave an output that is
not equal to the input.
2. Repeat Question 1 for three different sets of values of the weighting constants, a and b, and three
different sets of input frequencies.
3. Consider another system described by:
y[n] = x[n]+ x[n − 1]

Modify Program DSP_4_1 to compute the output sequences y 1[n], y2[n], and y[n] of the above system.
Compare y[n] with yt[n]. Are these two sequences equal? Is this system linear?
No, they are not equal. Yes, the system is linear.

You might also like