0% found this document useful (0 votes)
39 views13 pages

ASH1811022MSAS

The document contains 8 experiments on generating different types of signals using MATLAB. Each experiment defines the signal, describes its properties, outlines the processing steps, and provides the MATLAB code and output. The experiments cover generating unit sample, unit step, unit delay, ramp, exponential, complex exponential, and sinusoidal signals.

Uploaded by

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

ASH1811022MSAS

The document contains 8 experiments on generating different types of signals using MATLAB. Each experiment defines the signal, describes its properties, outlines the processing steps, and provides the MATLAB code and output. The experiments cover generating unit sample, unit step, unit delay, ramp, exponential, complex exponential, and sinusoidal signals.

Uploaded by

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

Noakhali Science and Technology University

DEPARTMENT OF INFORMATION & COMMUNICATION ENGINEERING

Course Title:
Signal and System
Course code:
ICE-3108
Lab Report

Submitted to:
Apurba Adhikary
Assistant Professor
Dept. of ICE, NSTU
Submitted by:
Shoeb Akibul Islam
Roll: ASH1811022M
Session: 2017-18
Submission date: 05-06-2021
GROUP: 2
EXPERIMENT NO. 1: Write a program to generate unit sample signal and show the output using
MATLAB.

Definition: Unit sample or unit impulse signal is denoted by δ (n) and it is defined as,
δ (n) = {1 if n=0 and 0 otherwise.
Description:
Impulse function is denoted by δ(t). and it is defined as

δ(t)= {1,0 ,t=0


t≠0

Processing:
1. Start the program.
2. Give the output signal conditions according to the definition to generate the required signal.
3. Display the figure.

MATLAB code:
n=-15:15;
x=[n==0];
stem(n,x);
xlabel('n');
ylabel('del(n)');

Output:
EXPERIMENT NO. 2: Write a program to generate unit step signal and show the output using
MATLAB.

Definition: Unit step function is denoted by u (n). It is defined as u (n) = {1if n⩾0 and 0 if n<0.
Description:

 It is used as best test signal.


 Area under unit step function is unity.
Processing:
1. Start the program.
2. Give the output signal conditions according to the definition to generate the required signal.
3. Display the figure.

MATLAB code:
n=-10:10;
x=[n>=0];
stem(n,x);
xlabel('n');
ylabel('U(n)');

Output:

EXPERIMENT NO. 3: Write a program to generate unit delay step signal and show the output using
MATLAB.

Definition: Unit delay step function is denoted by u(n-k). It is defined as u(n-k) = {1if n-k⩾0 and 0 if n-
k<0. Where k>0.

Description:

u(n-k)= {1,0 ,ifif n−k ≥0


n−k <0
where k >0.
Processing:
1. Start the program.
2. Give the output signal conditions according to the definition to generate the required signal.
3. Display the figure.

MATLAB code:
n=-10:10;
x=[(n-3)>=0];
stem(n,x);
xlabel('n');
ylabel('U(n-3)');
title('Unit delay step signal step signal');

Output:

EXPERIMENT NO. 4: Write a program to generate unit ramp signal and show the output using
MATLAB.

Definition: Unit ramp signal is denoted by Ur(n), and it is defined as Ur (n) = {n if n⩾0 and 0 if n<0.
Description:
Mathematically such a function is expressed as,

Processing:
1. Start the program.
2. Give the output signal conditions according to the definition to generate the required signal.
3. Display the figure.

MATLAB code:
n=-10:10;
x=(n-3).*[(n-3)>=0];
stem(n,x);
xlabel('n');
ylabel('Ur(n)');

Output:
EXPERIMENT NO. 5: Write a program to generate unit delay ramp signal and show the output using
MATLAB.

Definition: Unit ramp signal is denoted by Ur(n-k), and it is defined as Ur (n-k) = {n-k if n-k⩾0 and 0 if
n-k<0. Where, k>0.

Description:

δ(n-k)= {n−k0 , if,ifn−kn−k< ≥0 0


where k>0.
Processing:
1. Start the program.
2. Give the output signal conditions according to the definition to generate the required signal.
3. Display the figure.

MATLAB code:
n=-10:10;
x=(n-3).*[(n-3)>=0];
stem(n,x);
xlabel('n');
ylabel('Ur(n-3)');
title('Unit delay ramp signal');

Output:
EXPERIMENT NO. 6: Write a program to generate real valued exponential signal and show the
output using MATLAB.

Definition: Exponential signals are the signals which increases or decreases exponentially or unbounded
but real valued.
We can express x (n) = an as an exponential signal where, a is real valued.

Description:
X(t)=Ceat
where C and a are in general complex numbers.

Real exponential signals: C and a are reals.


The case C > 0 represents exponential growth. Some signals in unstable systems exhibit exponential
growth. ∙ The case a < 0 represents exponential decay. Some signals in stable systems exhibit
exponential decay

Processing:
1. Start the program.
2. Get any real input for producing the required signal.
3. Display the figure.

MATLAB code:
n=-15:15;
a=2;
x=(a.^n);
stem(n,x);

Output:

EXPERIMENT NO. 7: Write a program to generate complex valued exponential signal and show the
output using MATLAB.

Definition: The complex exponential signal is given by


Description:
Where "s" is a complex variable and it is defined as

Therefore

........................(1)
Using Eulers identity

...............................(2)
Substituting eqn.(2) in eqn.(1) we have

Processing:
1. Start the program.
2. Take an exponential signal for generating the required signal.
3. Use exp() function for computing exponential.
4. Display the figure.

MATLAB code:
n=-30:30;
alfa=-0.1+0.3j;
x_n=exp(alfa*n);
subplot(411);
stem(n,real(x_n));
xlabel('time');
ylabel('real');
subplot(412);
stem(n,imag(x_n));
xlabel('time');
ylabel('imaginary');
subplot(413);
stem(n,abs(x_n));
xlabel('time');
ylabel('magnitude');
subplot(414);
stem(n,angle(x_n));
xlabel('time');
ylabel('phase');

Output:
EXPERIMENT NO. 8: Write a program to generate sinusoidal signal and show the output using
MATLAB.

Definition: Sinusoidal Signals are periodic functions which are based on the sine or cosine function
from trigonometry.
The general form of a Sinusoidal Signal is x (t)=A cos(ωot +ϕ) Or, x (t)=A cos(2πfot +ϕ). We can also use
sine instead of cosine here.

Description:
Sinusoidal signal:

where

 is the amplitude

 is the angular frequency in radian per second, and is the period

 is the initial phase, i.e., the argument of the cosine function at .

A sinusoidal signal can also be expressed as a sine function, which can always be converted to a cosine
function by
Processing:
1. Start the program.
2. Take a sinusoidal signal.
3. Display the waveforms (Discrete and Continuous time signal).

MATLAB code:
n=-10:0.5:10;
x_n=sin(n);
subplot(211);
stem(n,x_n);
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal in discrete time');
grid on
axis([-10 10 -3 3])

subplot(212);
plot(n,x_n);
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal in continuous time');
grid on
axis([-10 10 -3 3])

Output:

You might also like