0% found this document useful (0 votes)
41 views5 pages

DSP Lab

The document contains code to generate and plot 5 different signal types: 1) a unit impulse sequence, 2) a unit step sequence, 3) a ramp sequence, 4) a sinusoidal signal, and 5) exponential signals with exponents less than 1, greater than 1, between -1 and 0, and less than -1. For each signal, the code generates the x-values using a mathematical formula based on the index n, plots the signal as a stem plot, and labels the x-axis, y-axis, and plot title.

Uploaded by

Somdyuti Paul
Copyright
© Attribution Non-Commercial (BY-NC)
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)
41 views5 pages

DSP Lab

The document contains code to generate and plot 5 different signal types: 1) a unit impulse sequence, 2) a unit step sequence, 3) a ramp sequence, 4) a sinusoidal signal, and 5) exponential signals with exponents less than 1, greater than 1, between -1 and 0, and less than -1. For each signal, the code generates the x-values using a mathematical formula based on the index n, plots the signal as a stem plot, and labels the x-axis, y-axis, and plot title.

Uploaded by

Somdyuti Paul
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 5

1) Unit Impulse Sequence:

clc;
clear all;
close all;
n=-5:5;
len1=length(n(1):-1);
len2=length(1:n(length(n)))
x=[zeros(1,len1) 1 zeros(1,len2)];
stem(n,x);

2) Unit Step Sequence


3)Ramp Sequence
n=0:10
x=n
stem(n,x);
title('Ramp Signal');
xlabel('n');
ylabel('x');

4) Sinusoidal Signal
clc;
clear all;
close all;
n=-10:0.2:10;
x=sin(n);
stem(n,x);
title('Sinusoidal Signal')
xlabel('n');

ylabel('x)

5) Exponential Signal
a=0.5;
n=0:.1:10;
x=a.^n;
stem(n,x);
title('Exponential Signal (a<1)');
xlabel('n');
ylabel('x');

a=2;
n=0:.1:10;
x=a.^n;
stem(n,x);
title('Exponential Signal (a>1)');
xlabel('n');
ylabel('x');
a=-0.8;
n=0:10;
x=a.^n;
stem(n,x);
title('Exponential Signal (-1<a<0)');
xlabel('n');
ylabel('x');
a=-2;
n=0:10;
x=a.^n;
stem(n,x);

title('Exponential Signal (a<-1)');


xlabel('n');
ylabel('x');

You might also like