You are on page 1of 14

Republic of the Philippines

Laguna State Polytechnic University


San Pablo City Campus

College of Engineering
A.Y. 2021-2022

CPE 18
Digital Signal Processing

Laboratory Activity No. 1

“Waveform Generation”

By:
Francia, Annree
Garcia, Donna
Mendoza, Raxon
Muyano, Karl Angelo,
Narvaez, Dan Angelo Jason
De Omampo, Queeny Deah

BSCPE 4B
INTRODUCTION
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Matlab is a software package for high-performance mathematical computation,


visualization, and programming environment. It provides an interactive environment with
hundreds of built-in functions for technical computing, graphics, and animations.

A continuous signal is a continuous function of time defined on the real line R denoted
by. s(t), t is time. The signal can be complex valued. Discrete signal or discrete-time signal is a
time series consisting of a sequence of quantities. A signal is considered to be a continuous time
signal if it is defined over a continuum of the independent variable. A signal is considered to be
discrete time if the independent variable only has discrete values.

The researchers are responsible to perform and assessing scripts depending on simulation
findings this Laboratory activity. The goal of this laboratory exercise is to learn how to utilize
MATLAB to solve problems. Carry out a simulation and learn the difference between a
continuous and discrete temporal signal.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

PROCEDURE

Procedure of Continuous Time Signal:

1. Set the value of range and interval of the equation.


2. Set a different variable for every equation.
3. Set the proper range and location of the graph.
4. Plot the data sequence using the plot (x, y) function and set the color or design of the waveform.
5. Set a label ‘t’ with a given font name and font size on the X axis.
6. Set a label ‘x1(t)’ with a given font name and font size on the Y axis.
7. Set a graph title with a given font name and font size.
8. Set ‘grid on’ to display the major grid lines for current axes and returned by the gca command.

Procedure of Discrete Time Signal:

1. Set the value of the range in the equation.


2. Set a different variable for every equation.
3. Plot the data sequence using the stem (x, y) function and set the color or design of the waveform.
4. Set a label ‘t’ with a given font name and font size on the X axis.
5. Set a label ‘x1(t)’ with a given font name and font size on the Y axis.
6. Set a graph title with a given font name and font size.
7. Set ‘grid on’ to display the major grid lines for current axes and returned by the gca command.

RESULT
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

1.

Figure 1. MATLAB Script equation (𝑐𝑜𝑠 ( 3𝜋𝑡 / 4 + 𝜋 /8 )). The graph shows that it lies between
the range of -1 to 2 with the interval of 0.02.
2.

Figure 2. MATLAB Script equation (cos ( 3 𝜋 n / 4 + 𝜋 /8 )). The graph shows that it lies between
the range of -5 to 5.

3.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 3. Matlab Script equation (5t + 3e −t ). Shows the Graph of the equation (5t + 3e −t ). The
graph shows that it lies between the range of -2 to 2 with the interval of 0.45.

4.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 4. MATLAB Script equation (𝑠𝑖𝑛 (3𝜋𝑡 4 + 𝜋 8)) 2 . The graph shows that it lies between the
range of -1 to 2 with the interval of 0.03.

5.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 5. shows the MATLAB Script of the equation (cos ( 3𝜋𝑡 4 ) + sin ( 𝜋𝑡 4 )). The graph shows
that it lies between the range of -2 to 3 with the interval of 0.07.

6.

Figure 6. shows the MATLAB Script of the equation (𝑡 𝑒 −2𝑡 ). The graph shows that it lies
between the range of -2 to 3 with the interval of 0.04.

7.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 7. MATLAB Script of the equation (cos ( 3𝜋𝑛/ 4 + 𝜋 /8 )). The graph shows that it lies
between the range of -5 to 5.

8.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 8. MATLAB Script of the equation (𝑠𝑖𝑛 (− 3𝜋𝑛 8 + 𝜋 2 )). The graph shows that it lies
between the range of -5 to 5.

9.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 9. MATLAB of the equation (5𝑛 + 3𝑒 −𝑛 ). The graph shows that it lies between the range of
-5 to 5.

10.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 10. shows the MATLAB Script of the equation |sin ( 3𝜋𝑛 4 + 𝜋 8 )|. The graph shows that it
lies between the range of -6 to 10.

11.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 11. shows the MATLAB Script of the equation (cos ( 3𝜋𝑛/ 4 ) + sin ( 𝜋𝑛 /2 )). The graph
shows that it lies between the range of -10 to 10.

12.
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

Figure 12. shows the MATLAB Script of the equation (𝑘 4 −|𝑘|). The graph shows that it lies
between the range of -10 to 10.

OBSERVATION
Republic of the Philippines
Laguna State Polytechnic University
San Pablo City Campus

College of Engineering
A.Y. 2021-2022

This laboratory shows the signal waveform of continuous time and discrete signal
using matlab software. At first it is hard for student to differentiate the continuous time
and discrete signal, after seeing the input(equation) and output(waveform) it is very easy
to determine what type of signal is it. input (equation and script) is very technical in the
simulation because it needs the exact needs of the program to give the right output
(waveform signal).

CONCLUSION

The researcher therefore concluded that using Matlab we can see signal
waveforms of continuous time and discrete signals. These laboratories enlightened the
students to differentiate continuous time and discrete signal through input (scripts and
equation) and outputs (waveforms signal).

REFERENCES

https://www.javatpoint.com/matlab-introduction

You might also like