ASH1811022MSAS
ASH1811022MSAS
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
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:
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:
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:
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.
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.
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
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: