0% found this document useful (0 votes)
11 views7 pages

LAB01

The lab report details an experiment conducted at Rajshahi University of Engineering & Technology focused on generating and analyzing various continuous and discrete time signals using MATLAB. The objectives included understanding signal processing concepts and creating different types of signals such as unit step, ramp, and sine waves. The experiment provided hands-on experience with MATLAB for signal visualization and manipulation, enhancing comprehension of essential signal processing principles.

Uploaded by

2008032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views7 pages

LAB01

The lab report details an experiment conducted at Rajshahi University of Engineering & Technology focused on generating and analyzing various continuous and discrete time signals using MATLAB. The objectives included understanding signal processing concepts and creating different types of signals such as unit step, ramp, and sine waves. The experiment provided hands-on experience with MATLAB for signal visualization and manipulation, enhancing comprehension of essential signal processing principles.

Uploaded by

2008032
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Heaven’s light is our guide

RAJSHAHI UNIVERSITY OF ENGINEERING & TECHNOLOGY


Department of Mechatronics Engineering

Lab Report

Experiment No.: 01

Experiment Name: Generation of different continuous and discrete time signals using
MATLAB

Submitted By: Submitted To:


Md. Ahsan Habib Md Manirul Islam
ID: 2008032 Assistant Professor
4th Year, Odd Semester Department of Mechatronics Engineering
Department of Mechatronics Engineering Rajshahi University of Engineering &
Rajshahi University of Engineering & Technology, Rajshahi-6204.
Technology, Rajshahi-6204.

Md. Hafiz Ahamed


Assistant Professor
Department of Mechatronics Engineering
Rajshahi University of Engineering &
Technology, Rajshahi-6204.

Date of Experiment: June 24, 2025


Date of Submission: July 07, 2025

MTE 4104
Digital Signal Processing & Machine Vision Sessional
Experiment No.: 01
Experiment Name: Generation of different continuous and discrete time signals using
MATLAB.

Objectives:
1. Gaining an understanding of signals and signal processing.
2. Developing knowledge of Continuous Time Signals.
3. Becoming familiar with different types of continuous time signals, such as step, ramp,
rectangular, triangular, exponential, sawtooth, and sine.
4. Learning to generate various kinds of Continuous Time Signals.
5. Understanding discrete time signals.
6. Learning MATLAB code for plotting discrete signals.
7. Solving discrete signal-related problems and plotting them in MATLAB.

Theory:
Signal: A signal refers to any physical quantity that changes over time, space, or another
independent variable. A common example of a signal is:
𝑋 = 𝐴sin(𝑤𝑡)
where 𝐴 is the amplitude, 𝑤 is the angular frequency, and 𝑡 is time.
Signal Processing: Signal processing involves the analysis, modification, and synthesis of
signals. It includes techniques used to manipulate and analyze signals for various applications.

Figure 1.1: Continuous and Discreate time signal

Continuous Time Signal: Continuous Time Signals, also known as analog signals, are defined
for every instant of time. Mathematically, continuous time signals can be expressed as:
𝑋 = 𝐴sin(𝑤𝑡)
where −∞ < 𝑡 < ∞.

2
Unit Step Signal: A discrete unit step signal is denoted as 𝑈(𝑡) in the continuous-time domain
and is defined as:
1, 𝑡≥0
𝑈(𝑡) = {
0, 𝑡<0
Ramp Signal: A ramp signal is denoted as 𝑟(𝑡) in the continuous-time domain and is defined
as:
𝑡, 𝑡 ≥ 0
𝑟(𝑡) = {
0, 𝑡 < 0
Exponential Signal: Exponential signals can be defined as:
𝑥(𝑡) = 𝑒 𝛼𝑡
For different values of 𝛼, the signal behaves differently:
• If 𝛼 = 0, 𝑥(𝑡) = 𝑒 0 = 1 (a constant signal).
• If 𝛼 < 0, 𝑥(𝑡) = 𝑒 −𝛼𝑡 (decaying exponential).
• If 𝛼 > 0, 𝑥(𝑡) = 𝑒 𝛼𝑡 (growing exponential).
Sinusoidal Signal: A sinusoidal signal can be defined as:
𝑥(𝑡) = sin(𝑡), −∞ < 𝑡 < ∞
This represents a wave that oscillates continuously between positive and negative values.
Rectangle Signal: A rectangle signal is shaped like a rectangle, with sharp edges and a flat
top. It is often used to represent digital pulses in signal processing.
Triangular Wave: A triangular wave has a triangular shape, with linear rise and fall in its
amplitude, commonly used in waveforms for signal analysis.
Sawtooth: A sawtooth waveform is a non-sinusoidal waveform that rises steadily and then
drops sharply. It's used in applications like clock generation in digital electronics.
Discrete Time Signal: Discrete time signals are defined at specific intervals rather than
continuously. Unlike continuous-time signals, which are defined for all moments in time,
discrete-time signals are represented as a sequence of numbers taken at distinct time intervals.
In digital signal processing (DSP), analog signals are transformed into discrete-time signals to
be analyzed and processed by digital systems like computers.

Figure 1.2: Discrete Time Signal.

3
Discrete Unit Impulse: The discrete unit impulse signal is denoted as 𝛿(𝑛) in the discrete-
time domain and is defined as:
1, 𝑛 = 0
𝛿(𝑛) = {
0, otherwise
Discrete Unit Step Signal: A discrete unit step signal is denoted as 𝑈(𝑛) in the discrete-time
domain and is defined as:
1, 𝑛≥0
𝑈(𝑛) = {
0, 𝑛<0
Discrete Unit Ramp Signal: The discrete unit ramp signal is denoted as 𝑟(𝑛) in the discrete-
time domain and is defined as:
𝑛, 𝑛≥0
𝑟(𝑛) = {
0, 𝑛<0
Discrete Unit Exponential Signal: The discrete unit exponential signal can be defined as:
𝑥(𝑛) = 𝑎𝑛 for all 𝑛
where 𝑎 is a constant and determines the behavior of the signal.
Discrete Unit Sinusoidal Signal: The discrete unit sinusoidal signal is defined as:
𝑥(𝑛) = sin(𝑛), −∞ < 𝑛 < ∞

Required Apparatus:
1. MATLAB

Problem:

Task 1: Writing a MATLAB script to plot different types of discrete signals and show them in
single figure.

MATLAB Code:
clc; stem(n, impulse, 'filled');
clear all; title('Unit Impulse Signal
figure; (\delta[n])');
xlabel('n');
n = -10:1:10; ylabel('Amplitude');
grid on;
u = (n >= 0);
ramp = n .* (n >= 0);
subplot(5, 2, 1);
stem(n, u, 'filled'); subplot(5, 2, 3);
title('Unit Step Signal stem(n, ramp, 'filled');
(u[n])'); title('Ramp Signal (r[n])');
xlabel('n'); xlabel('n');
ylabel('Amplitude'); ylabel('Amplitude');
grid on; grid on;

impulse = (n == 0); sine_wave = sin(pi * n / 5);

subplot(5, 2, 2); subplot(5, 2, 4);

4
stem(n, sine_wave, 'filled');
title('Sine Wave Signal sawtooth_wave = sawtooth(pi *
(sin(\pi n / 5))'); n / 5);
xlabel('n');
ylabel('Amplitude'); subplot(5, 2, 8);
grid on; stem(n, sawtooth_wave,
'filled');
cos_wave = cos(pi * n / 5); title('Sawtooth Wave
Signal');
subplot(5, 2, 5); xlabel('n');
stem(n, cos_wave, 'filled'); ylabel('Amplitude');
title('Cosine Wave Signal grid on;
(cos(\pi n / 5))');
xlabel('n'); pulse_train = mod(n, 4) == 0;
ylabel('Amplitude');
grid on; subplot(5, 2, 9);
stem(n, pulse_train,
exp_signal = 0.5.^n .* (n >= 'filled');
0); title('Periodic Pulse Train
(every 4th sample)');
subplot(5, 2, 6); xlabel('n');
stem(n, exp_signal, ylabel('Amplitude');
'filled'); grid on;
title('Exponential Decay
Signal (0.5^n)'); gaussian_signal = exp(-n.^2 /
xlabel('n'); 10);
ylabel('Amplitude');
grid on; subplot(5, 2, 10);
stem(n, gaussian_signal,
square_wave = square(pi * n / 'filled');
2); title('Gaussian Signal');
xlabel('n');
subplot(5, 2, 7); ylabel('Amplitude');
stem(n, square_wave, grid on;
'filled');
title('Square Wave Signal'); sgtitle('Different Types of
xlabel('n'); Discrete Signals');
ylabel('Amplitude');
grid on;

5
Output:

Figure 1.3: Discrete-Time Signals: Unit Step, Impulse, Sine, Cosine, and Their Variations

Task 2: Writing a MATLAB script to plot a sine wave, pulse train, and their multiplied signal
in a single figure.
MATLAB Code:
clc; xlabel('n');
clear all; ylabel('Amplitude');
figure; title('Pulse Train');
grid on;
t = 0:0.1:50;
sine_wave = 10 * sin(t); sine_resampled = 10 *
sin(linspace(0, 50,
subplot(3, 1, 1); length(y_pulse)));
plot(t, sine_wave);
xlabel('Time (s)'); multiplied_signal = sine_resampled
ylabel('Amplitude'); .* y_pulse;
title('Sine Wave (Amplitude =
10)'); subplot(3, 1, 3);
grid on; stem(n1, multiplied_signal,
'filled');
n1 = 0:50; xlabel('n');
y_pulse = ones(size(n1)); ylabel('Amplitude');
title('Multiplied Signal (Sine *
subplot(3, 1, 2); Pulse Train)');
stem(n1, y_pulse, 'filled'); grid on

6
Output:

Figure 1.4: Plotting the Sine Wave, Pulse Train, and Their Multiplication in a Discrete-Time System

Discussions:
We used MATLAB to create and plot multiple continuous and discrete-time data for this
investigation. The main goal was to learn about several kinds of signals, such as unit step, unit
impulse, ramp, sine, cosine, exponential, square, sawtooth, pulse train, and Gaussian signals.
We used MATLAB's strong plotting tools to show these signals, which made it easier to see
their distinctive features. We also multiplied a sine wave by a pulse train to see how they
worked together in the experiment. By utilizing MATLAB, students acquired hands-on
experience in signal generation, visualization, and manipulation, boosting their comprehension
of signal processing concepts that are essential in domains like digital signal processing and
communications.

Conclusions:
In conclusion, this experiment gave excellent hands-on experience in creating and evaluating
distinct continuous and discrete-time signals using MATLAB. By investigating signals such as
unit step, impulse, ramp, sine, cosine, exponential, square, sawtooth, and Gaussian, the lab
expanded understanding of their distinctive qualities and uses in signal processing.
Additionally, the problem of multiplying a sine wave with a pulse train revealed the practical
use of signal interactions in a discrete-time system. Overall, the lab boosted awareness of core
signal processing concepts and MATLAB’s capabilities for viewing and manipulating signals
in both continuous and discrete domains.

You might also like