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

signal lab report 03

The document outlines a lab focused on studying signal characteristics using MATLAB, including pre-lab tasks involving unit step, impulse, ramp, and signum sequences. In-lab tasks require creating functions to generate these sequences and analyze energy and power of signals. The lab emphasizes understanding deterministic and stochastic signals, as well as even and odd signals, while applying MATLAB for signal generation and analysis.

Uploaded by

hammadkhan22343
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)
10 views

signal lab report 03

The document outlines a lab focused on studying signal characteristics using MATLAB, including pre-lab tasks involving unit step, impulse, ramp, and signum sequences. In-lab tasks require creating functions to generate these sequences and analyze energy and power of signals. The lab emphasizes understanding deterministic and stochastic signals, as well as even and odd signals, while applying MATLAB for signal generation and analysis.

Uploaded by

hammadkhan22343
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/ 10

Lab 03- Study of Signal characteristics using

MATLAB

❖ Pre-lab Tasks:
• Unit Step Function:
The unit step function, denoted as u(n) in discrete-time or u(t) in
continuous-time, is a function that is zero for negative inputs and
one for zero and positive inputs. Mathematically, it is defined as

It is commonly used in signal processing and control systems to


represent signals that turn "on" at a certain time.

• Unit Impulse Sequence:


The unit impulse sequence, also called the discrete-time delta
function or Kronecker delta, is denoted as δ(n)\delta(n). It is
defined as:

This function is significant in digital signal processing because it


acts as an identity element in convolution and represents an
instantaneous event at n = 0.

• Ramp Sequence:
A discrete-time function defined as
𝑟(𝑛) = 𝑛 for 𝑛 ≥ 0 and 𝑟(𝑛) = 0 for 𝑛 < 0 representing a linearly
increasing signal.

• Signum Sequence:
A function defined as

It indicates the sign of a given input.

Page 1 of 10
• Square wave:
A periodic signal alternating between two levels, typically +1 and
-1, with a 50% duty cycle.

• Periodic Sequences in MATLAB:


Sequences that repeat after a fixed interval; generated using
functions like sin(), cos(), or mod() in MATLAB.

• Energy and Power of Continuous Time Signal in


MATLAB:
Energy is computed as

and power is the average energy per unit time. Implemented in


MATLAB using numerical integration.

• Energy and Power of Discrete Time Sequences in


MATLAB:
Energy is

and power is the time-averaged energy. Implemented using


summation in MATLAB.

• Deterministic and Stochastic Signals:


Deterministic signals: Predictable and described by mathematical
functions.
Stochastic signals: Random and modeled probabilistically.

• Even and Odd Signals:


Even signals: Symmetric around the y-axis, 𝑥(𝑛) = 𝑥(−𝑛)
Odd signals: Anti-symmetric, x(n)=−x(−n).

Page 2 of 10
❖ In-lab Tasks I:
Create a function “impseq”, which performs following operations:
Function [x,n]=impseq(n0,n1,n2)
Takes three parameters (n0, n1, n2) as input, where ‘n1’ and ‘n2’ are
lower and upper limits of n axis, and ‘n0’ is the delay.
Generates a unit-impulse sequence using above mentioned three
parameters.
There should be two output arguments [x, n] of function ‘impseq’,
where ‘x’ is impulse sequence and ‘n’ is its corresponding n-axis.
Finally, plot unit impulse ‘x’ against vector ‘n’.
On the main window, type “[x,n]=impseq(0,-5,5)”
• Readings:

Page 3 of 10
❖ In-lab Tasks II:
Make a function to form “stepseq” function which will output unit-step
sequence. Function [x,n]=stepseq(n0,n1,n2)
Unit Step Sequence, We can have another elegant way to produce a
step function, Alternatively, we can use the “ones” function
Type “stepseq[x,n]=(0,-5,5)” we get:
• Readings:

Page 4 of 10
❖ In-lab Tasks III:
Create a function “rampseq”, which performs following operations
Function [x,n]=rampseq(n0,n1,n2)
Takes three parameters (n0, n1, n2) as input, where ‘n1’ and ‘n2’ are
lower and upper limits of n axis, and ‘n0’ is the delay.
Generates a ramp sequence using above mentioned three parameters.
There should be two output arguments [x, n] of function ‘rampseq’,
where ‘x’ is impulse sequence and ‘n’ is its corresponding n-axis.
Finally, plot ramp impulse ‘x’ against vector ‘n’
• Readings:

Page 5 of 10
❖ In-lab Tasks IV:
Create a function “sigseq”, which performs following operations:
Function [x,n]=sigpseq(n0,n1,n2)
Takes three parameters (n0, n1, n2) as input, where ‘n1’ and ‘n2’ are
lower and upper limits of n axis, and ‘n0’ is the delay.
Generates a signum sequence using above mentioned three parameters.
There should be two output arguments [x, n] of function ‘sigseq’, where
‘x’ is impulse sequence and ‘n’ is its corresponding n-axis.
Finally, plot signum sequence ‘x’ against vector ‘n’.
• Readings:

Page 6 of 10
❖ In-lab Tasks V:
Find E∞ for the following signal tri(t )= {1−|t||t|<1
• Readings:

Page 7 of 10
❖ In-lab Tasks VI:
Find P∞ for the following signal x[n]=cos( π/4 *n)
• Readings:

❖ In-lab Tasks VII:


Write a function which plot or stem a unit impulse and unit step signals.
The function takes values for starting and ending value of independent
variable, i.e. t and n, and a character for identification of discrete and
continuous signal. Finally t plot or stem the function or signal. e.g;
function f_name ( arg1 (start) , arg2 (end) , arg3 (D/C) )
• Readings For continuous:

Page 8 of 10
• Readings For Discrete:

Page 9 of 10
❖ Critical Analysis:
In this lab we learned about the basic signal generation in MATLAB.
We also learned about the various MATLAB-supported wave and
sequence types. We created periodic signals and also energy and power
of discrete time sequences and of continuous time signal in MATLAB.
We also carried out tasks to demonstrate that we also introduced
deterministic and stochastic signals, as well as odd signals. In addition
we performed the basic tasks using operators that we have leaned
before this lab.

Page 10 of 10

You might also like