You are on page 1of 26

PAMANTASAN NG LUNGSOD NG PASIG

COLLEGE OF ENGINEERING

INTRODUCTION TO LTI REPRESENTATION AND TRANSFER


FUNCTION MODEL

EXPERIMENT NO. 1

ECE 158 Signals Spectra and Signal Processing


Tuesday & Thursday / 1:30pm to 4:30pm

SUBMITTED BY: SUBMITTED TO:


HUCAMIS, Neil Christopher T. Engr. Sherlyn B. Avendaño
18-00692 Date: March 10, 2021
OCTAVO, John Mark C.
18-00128
PAGATPAT, Noel Lorenzo B.
18-00755
EXPERIMENT NO.1
ANALYSIS OF DISCRETE-TIME ODD AND EVEN SIGNALS
AND
DISCRETE-TIME PERIODIC AND NON-PERIODIC SIGNALS

OBJECTIVES:
 To determine the concept of LTI Representation using Scilab programming
 To determine the concept of Transfer Function Modeling using Scilab programming

INTRODUCTION

Linear time-invariant systems (LTI systems) are a class of systems used in signals and systems that are
both linear and time-invariant. Linear systems are systems whose outputs for a linear combination of inputs
are the same as a linear combination of individual responses to those inputs. Time-invariant systems are
systems where the output does not depend on when an input was applied. LTI systems are those that are both
linear and time-invariant. Linear systems have the property that the output is linearly related to the input.
Changing the input in a linear way will change the output in the same linear way. So, if the input x1
(t) produces the output y1(t) and the input x2(t) produces the output y2(t), then linear combinations of those
inputs will produce linear combinations of those outputs. The input x1(t)+x2(t)) will produce the output y1
(t)+y2(t)).

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)x(t) and produces
output y(t)y(t) will also, when excited by signal x(t+σ), produce the time-shifted output y(t+σ).

Thus, the entirety of an LTI system can be described by a single function called its impulse response. This
function exists in the time domain of the system. For an arbitrary input, the output of an LTI system is
the convolution of the input signal with the system's impulse response.

Conversely, the LTI system can also be described by its transfer function. The transfer function is
the Laplace transform of the impulse response. This transformation changes the function from the time

1
domain to the frequency domain. This transformation is important because it turns differential equations into
algebraic equations, and turns convolution into multiplication.

Transfer function gives us a relationship between the input and the output and hence describes the system.

1) the transfer function of the system is the laplace transform of its impulse response for zero initial
condition.
2) the transfer function can be determined from system input-output pair by taking ratio laplace of output
to laplace of input.
3) the transfer function is dependent of the inputs to the system .
4) the system poles/zeros can be found out from transfer function.
5) the transfer function is defined only for linear-time invariant systems. It does not define non linear
systems.

2
PROCEDURE

PROCEDURE A: Unit Impulse Signal and Signal Scaling

1. Encode the following Scilab program. Check appropriately the punctuation marks used in the
syntax to avoid errors.

--> clf;
--> clear all;
--> // unit impulse
--> L=5;
--> n=-L:L;
--> x=[zeros(1,L),ones(1,1),zeros(1,L)];
--> da=gca();
--> da.y_location = "middle";
--> plot2d3(n,x);
--> title("unit impulse");

FIGURE A.1.

Figure A.1 presents the list of codes encoded in the scilab workspace. Through thorough inspection of the
code we can say that the code is intended to plot a unit impulse signal. A unit impulse signal only has a value
at the origin, so we expect such graphical representation to be depicted once we execute the program.

3
2. Illustrate (or copy) the generated signal. Record your observations.

FIGURE A.2.

The generated signal (unit impulse) can be moved based on the desired direction, for example if it is clicked
on the right phase of the graph then unit impulse will move to the right (by means of scrolling the mouse it is
shown in the right image) but if it is clicked to the left then the unit impulse will moved to left direction.
4
3. Encode the following Scilab program

--> clear all;


--> close;
--> // I n p u t CT S i g n a l
--> t=-2:1:2;
--> x=[1,1,0,1,0];
--> subplot(2,3,1) ;
--> plot(t,x) ;
--> xgrid(4,1,7);
--> xlabel("Time") ;
--> ylabel("Amplitude") ;
--> title("Input CT Signal x(t)");

FIGURE A.3.

Figure A.3. shows the output of the encoded syntax where a signal formed in the subplot 2,3,1 resembles a
triangular wave with a positive peak of 1 and a negative peak of 0 which means that the average value lies on
the 0.5 value of amplitude. However, it is noticeable that from time -2 to -1, at first glance there is no value.
But as we inspect through the syntax returned to x, we can see that the value [1,1,0,1,0] which tells us that
the value from t = -2 to 1 is equal to an amplitude of 1. The reason behind this is still unknown for us. We
then deduced for the meantime that the signal depicted in this figure is an input signal CT.

5
4. Observe the property of the generated signal. Then encode the following syntax and compare
thegenerated signal with respect to ProcedureA.3.

--> a=2; // Scaling factor


--> t=-2:1:2;
--> x=[1,1,0,1,0];
--> subplot(2,3,2) ;
--> plot(t,a*x);
--> xgrid(4,1,7) ;
--> xlabel("Time") ;
--> ylabel("Amplitude");

FIGURE A.4.

6
Figure A.4 shows the changes in amplitude if a scaling factor were multiplied to the syntax. From maximum
amplitude of 1, after adding the scaling factor, it climbs up to 2 without affecting the time. Therefore we can
say that this is a process of signal scaling with a scaling factor of 2.
5. Change the scale factor by and display the figure by encoding the next set of syntax.

--> a=0.5; // S c a l i n g f a c t o r
--> subplot(2,3,3) ;
--> plot(t,a*x);
--> xgrid(4,1,7);
--> xlabel("Time") ;
--> ylabel("Amplitude") ;
--> title("z(t)=0.5x(t)");

FIGURE A.5.

6. Compare the generated figure to the signal generated in ProcedureA.4. Record your
observations.

7
FIGURE A.6.
The graphical representation depicted in Figure A.6 is the same with the previous representation. The only
difference is that a third graphical representation was added. It is clearly noticeable the difference between
the second and third graphical representation. It is clearly amplitude scaling with different factor. In the
second graph we can see that the input signal is scaled by a factor of 2. In the third graphical representation
the scaling factor is 0.5 since the peak amplitude of the input signal is 1, if we multiply it by 0.5 we get a peak
amplitude of 0.5 as presented in the third graph in Figure A.6

7. Next, encode the following syntax.

--> subplot(2,3,4);
--> plot(t+2,x);
--> xgrid(4,1,7);
--> xlabel("Time");
--> ylabel("Amplitude");
--> title("z(t)=x(t+2)");

8
FIGURE A.7.

The program encoded in the Scilab workspace is a continuation of the past procedures. In this set of codes as
presented in figure A.7 the one thing that we noticed is that the amplitude is not the concern of the program
anymore. We then deduced from this is that we are done with the amplitude scaling part. As dictated by the
given code the parameter that we are now modifying is the time domain.

9
8. Compare the generated figure to the signal generated in ProcedureA.4 and ProcedureA.5.
Whatpart of the signal is modified this time? Record your observations.

FIGURE A.8.

Since we are now familiarize with the concept of scaling, we noticed at first glance the difference of
the newly added graphical representation to the other. This time we can already state that the fourth
graph is a time scaling of the input signal. The amplitude is not changed this time and it is returned
to the original amplitude which is 1 as presented by the input signal. It is just that the time for the
amplitude has been prolonged by a time unit of 2.

10
9. Encode the next set of syntax.
--> subplot(2,3,5);
--> plot(t-2,x);
--> xgrid(4,1,7);
--> xlabel("Time");
--> ylabel("Amplitude");

FIGURE A.9.
Syntax encoding of program as directed by the procedure A9.

10. Again, compare the generated figure to the previously generated signals. Record your
observations.

FIGURE A.10.
Figure A.10 shows that the most part of the generated figure is at negative side (left side of 0), compared to
the previous generated signals that are mostly generated at the positive side (right of zero).Figure 6 shows
that the figure generates at its origin.

11
11. Encode the following syntax and compare the result to the signal generated by ProcedureA.1.
--> subplot(2,3,6);
--> plot(-t,x);
--> xgrid(4,1,7);
--> xlabel("Time");
--> ylabel("Amplitude");
--> title("z(t)=x(−t)");

FIGURE A.11.
Syntax encoding of program as directed by the procedure A11
.
12. Record your observations.

FIGURE A.12.
Figure 7 shows that the generated signal is moving toward the positive side of the graph with an x-increment
of 0.5 that originate from the value of -2 and figure 7 has a y-increment of 0.2.

12
PROCEDURE B: Transfer Function ModelingTransfer Function Formulation
Consider Figure 3, a simple diagram of robot joint driven by DC motor through a gear transmission with
ratio r:1.

Figure 3: Robot joint connected to DC motor via a gear transmission

Let Jm = Ja + Jg be the sum of motor and gear inertia. By calculation, it will give us a formula of the
rotational motion in terms of θm described by:

where kt represents torque constant, Jm is the rotational inertia and Bm is the viscous friction. We want to
describe a model in transfer function form so that a block diagram can be drawn. To develop the electrical
side of DC motor, consider the model shown in Figure 4.

Figure 4: Model of permanent magnet DC motor

Using Laplace domain, the joint dynamics in Figure 3 can be described by:

Referring to its equivalent Steady-State model:

13
This equation can be drawn in terms of block diagram as shown in Figure 5.

Figure 5: block diagram of the robot joint dynamics in Figure 3

By deriving and simplifying the equation of Steady-State model, this is reduced to:

which gives a reduced block-diagram shown in Figure 6.

Figure 6: Reduced block diagram of the robot joint dynamics


Thus, the transfer function for a robot joint driven by DC motor is in the form:

Now if we assume that J=10 and B=0.1, then the resulting transfer function becomes:

14
Using Scilab:
1. Encode the following Scilab program. Check appropriately the punctuation marks used
in thesyntax to avoid errors.

-->clf
--> clear
--> num=1;
--> den=poly([0 0.1 10],'s','c');
--> P=syslin('c',num,den)
--> t=[0:0.001:50];
--> plot2d(t,csim('step',t,P))
--> xgrid(5,1,7)
--> xtitle('Time Domain Analysis','Time(sec)','C(t)')

FIGURE B.1.

The notable syntax in this code are the “poly()”, “syslin()”, and csim() command. Based on our observation,
the den quantity is the denominator for the transfer function which is consist of a polynomial terms defined by
the syntax poly(). Given the right parameters, the function 0.1s + 10s2 is yielded. The syslin() command is
used to define the quantity P as a Linear System. In order to simulate the registers, we believe according to
our observation that the syntax csim() was used to simulate the time response of the linear system dictated by
the transfer function.

15
2. Observe the transfer function generated from the program. Record your observations.

FIGURE B.2.

Figure B.2 is the output graphical representation of the given program in procedure B1, we observe that the
graph is in the form of an exponential function as it process through time. In line with this graphical
representation, we do some mathematical treatment to the transfer function by applying the Inverse Laplace
transform to the function P. By doing so, we get the functional response or we can say the impulse response
which is an exponential function. We then noticed that the function we solved is in relevance to what is being
shown in the figure.

16
3. Next, encode the following Scilab program:
--> //Time Domain Analysis
-->clf
--> clear
--> num=poly([12.811 18 6.3223],"s","coeff"); //Defines the numerator of the transfer function
--> den=poly([12.811 18 11.3223 6 1],"s","coeff"); //Defines the denominator of the transfer
function
--> sl=syslin('c',num,den) //Defines the transfer function
--> t=[0:0.001:25]; //The time of simulation is set from 0 to 25 seconds
--> plot2d(t,csim('step',t,sl)) // It plots the step response of the transfer functions
--> xgrid(5,1,7)
--> xtitle('Time Domain Analysis','Time(sec)','C(t)')

FIGURE B.3.

Presented in this figure is the encoding of the program presented in procedure B3. As we observe the given
code, we can see that there is another transfer function different from the earlier one. We then expected that
the impulse response to be depicted by this code will be a different one from the earlier graph presented in
Figure B.2.

17
4. Analyze the given syntax and its generated output.

FIGURE B.4.

Presented in Figure B.4 is the graphical representation of the code that was inputted as shown in Figure B.3.
At first glance, we figured that the waveform shown in the graphical representation is somehow resembles the
frequency response of a filter. Another one came into mind is that it also resembles a transient form where
there is a variation in amplitude at first and then will eventually enter the steady-state form. In addition, we
also deduced that Figure B.4 is a step response of the system with the given transfer function above.

18
5. Encode the next set of Scilab program:

--> num=poly([1.59],'s','coeff');
--> clf
--> den=poly([1 7],'s','coeff');
--> g1=syslin('c',num/den) //define tf
--> t=0:0.05:50;
--> gs1=csim('step',t,g1);
--> plot2d(t,gs1); // plotting step response

FIGURE B.5.

In Figure B.5, we have the same form of code given for procedure B. The only one that varies is the constants
for J and B as described in the introduction before procedure B. We then coined the idea that this code and
program is another step response for a system given system with the supporting knowledge about the syntax
gs1=csim('step',t,g1) which indicates the word ‘step’ short for a step response. In order to prove our
expectation, we then proceed to what is shown in Figure B.6.

19
6. Record your observations.

FIGURE B.6.

In this figure we can see a smooth curve which reminds us of the frequency response of a filter. We conclude
that this is also a step response of a certain control system with a given transfer function. If we are going to
compare this graphical representation from the earlier representation shown in Figures B.2 and B.4, we can
say that the graphical representation here in figure B.6 presents the most smooth step response. In figure B.2
the step response is slow, in figure B.4 the step response is faster but there is a spiking in amplitude at
transient period, and in this figure there is smoothness in the curve which is in our point of view is a good
characteristic for a control system.

20
ANSWERS TO THE REPORT:
1. Based on the generated figures of Procedure A, explain signal scaling specifically?

Signal scaling is simply the process of generating a signal that is concerned to a constant that is being
multiplied to the time or amplitude. Signal scaling were divided into two namely the Time Scaling and
Amplitude Scaling. From the names itself, the time scaling produced when a constant is multiplied to the
time axis and Amplitude Scaling produced when a constant is multiplied to the amplitude axis.

To elaborate more in this we constructed a representation on about signal scaling

x[n] a y[n] = ax[n]

FIGURE 1

As shown in Figure 1, scaling is simply multiplication of a constant (a) to an input signal x[n].

2. How is signal scaling applied in LTI representation?

We all know that LTI Systems are subset of linear system, wherein in Linear System when an input to a
given system is scaled by a value, the output of the system is scaled by the same amount. A linear system
also obeys the principle of superposition. This means that if two inputs are added together and passed
through a linear system, the output will be the sum of the individual inputs and outputs therefore scaling
property mentioned above still holds in conjunction with the superposition principle. Therefore, if the
inputs x and y is scaled by factors α and β, respectively, then the sum of these scaled inputs will give the
sum of the individual scaled outputs.

3. What is the use of (a) num, (b) den, (c) syslin and csim syntax in Procedure B?

In order to answer these questions in an organized manner, we will approach this in bullet form.

(a) Num
Like a common variable assigning in scilab workspace the Num is just a name for a variable where we
assign a certain value to it. In this case it is named as “Num” which short for numerator because we
will use it as the numerator for the transfer function. Num returns the numerator of a rational function
matrix. It defines that the designated matrices or parameters are the numerator. Lastly, in accordance
to the introduction of Procedure B, the num represents the output of the control system.

21
(b) Den
The same with the function of num, the Den syntax is which is in short for the word Denominator. It
is labeled as a denominator because this will serve as the denominator of the transfer function of the
control system. Varying this means that we are varying the input signal entering the control system.

(c) Syslin
This syntax is a short for generating a linear system. In this experiment, particularly in Procedure B
section, the syslin syntax is used to generate the transfer function for a control system. We can say this
because when we input this syntax with the parameters Num and Den, an equation pops out that
resembles the form of a transfer function. We are then sure that the Syslin syntax is used to generate
the transfer function.

(d) Csim
The Csim is short for the word Constant Simulation, this means that it will simulate a certain function
with a given time parameter. It will continuously simulate a given function. In this experiment, it is
intended to simulate the transfer function which is denoted as a variable P. P is equivalent to the
Syslin of Num and Den which is a transfer function. We attest to this statement because when we
encounter Csim syntax, we noticed that the transfer function is inscribed as one of its parameters
together with the time parameter.

4. Based on Procedure B, what is the importance of “transfer function formulation”. Furthermore,


what is the purpose of using Scilab(or MATLAB) program for transfer function analysis?

One of the main features of scilab is in line with the linear system and hence with the functions of an LTI
system. When we are planning to design a control system, it has a certain function or treatment that will
be applied to the input. By the use of transfer function we can plot the response of the control system
when given a certain input or in reverse we are expecting a certain output.

One of the things that we observe in procedure B is that we noticed that all the codes are of the same
form. The only thing that changes per set of codes are the value given for the numerator and denominator
of the transfer function to be generated by the syntax syslin(). As the numerator and denominator change,
there is also a change in the graph in which we believe that is the step response of the control system once
given a certain input and output.

The essence of using the transfer function in scilab is that we can see easily formulate what is the right
input and output for a control system with a given response. By changing the input or output we can
formulate the right value to have a smooth response curve. Even though we can do this by mathematical
analysis, scilab provides an accurate approval because it will show how the system will respond.

22
TECHNICAL DISCUSSION:

Our approach to the experiment does not differ from the past approach that we have done to other
experiments. We maximize and used our resources based on our capability. In addition, we prioritized and set
our minds to aim knowledge so that we can fully grasp the essence of this experiment which is to learn and
explore.

Navigating the Scilab environment has been an easy task and we believe that we improve in terms of it. The
challenge that we encounter in this experiment is the absorption and digestion of the information relayed in
this experiment. As a student, we are sworn to search for knowledge. In line with this we took our time in
gathering background information about the topic of this experiment so that when we start the scilab
simulation of the program give, we can keep up with what is going to happen in the simulation and avoid the
concept of simulating blindly. What took most of our time is the studying of the nature of the experiment. In
this case the information searching was tasked to Hucamis and the deciphering of the information especially
the mathematical analysis falls to the hands of Pagatpat. Lastly, Octavo provides support in the analysis of
the information whether the information is in linearity with the introduction already given in the experiment.

The set of codes are of the right syntax because we did not encounter any errors in the Scilab interface. As
already been said, the codes are easily been understood because when we proceed with the simulation we
already have the knowledge about the background of the experiment and tends to understand easily what the
graphical representation is discussing to us. Hence, we can say that we learned a bunch from this experiment.

Lastly, teamwork has been the capital resource of the group. We are confident that the outcome of our report
turns out to be what is to be expected in this experiment. We can say that our initial plan to aim for
knowledge has been attained.

23
CONCLUSION:
LTI Representation in Scilab and Transfer Function is one of the main features of scilab. Therefore there
are syntaxes that is meant for generating this concept.

In procedure A, we focused in Scaling a signal. Scaling means that we are varying either the amplitude or
time parameter of a certain signal by a certain constant which is called a scaling factor. We deduced from this
experiment the idea of scaling falls in two different kinds which is the Amplitude Scaling and Time Scaling.
In amplitude scaling we tend to multiply the scaling factor to the amplitude of the input signal. In Time
scaling, we add or subtract the scaling factor to the input signal, which is in complementary of the concept of
time delaying and time advancing a signal. This concept is easily done in Scilab by defining a certain scaling
constant and then applying it to the parameters of the input signal defined. This scaling program pattern in
Scilab resembles the LTI representation because an LTI system applies a change in the input signal to
produce a certain output. Therefore in this case we can say that we determine the concept of LTI
Representation using the Scilab Programming.

Transfer function is an important concept when dealing with Control systems because this is where we
anchor our ideas when designing one. For example, we have a certain output that we want to achieve with a
given input. Designing the right control system that will produce a smooth response curve will need the
treatment and analysis of the transfer function. As we observe in Procedure B, we have three graphs of
different form. The form changes due to the adjustments in both the input (den syntax) and output (num
syntax) of the transfer function. From this concept we concluded that by the use of Scilab syntax syslin(),
we can get the right design for a control system that will give us the best response. Once we attained the
desired response curve with the given output and input equation. The response of the control system can be
easily formulated by using the inverse laplace concept to the fraction of the laplace of the output and laplace
of the input.

24
REFERENCE:

Online Platforms:
 https://www.youtube.com/watch?v=AvaZ_E-nFTk&t=106s
 https://www.cds.caltech.edu/~murray/courses/cds101/fa04/caltech/am04_ch6-3nov04.pdf
 https://www.sciencedirect.com/topics/engineering/transfer-functions

Books:
 “Digital Signal Processing: Principles, Algorithms, and Applications” by Proakis & Manolakis.
 “Electronic Communications Systems: Fundamental Through Advanced | 5e” by Wayne Tomasi
 “Elementary Differential Equations | 7e” by Rainville and Bedient

25

You might also like