Professional Documents
Culture Documents
Digital Signal Processing Lab
Digital Signal Processing Lab
(EC2156)
PROGRAM 1
Object: To plot the exponential signal for different values of a for the given equation
x(n)=an
(i)
0<a<1
(ii)
-1<a<0
(iii)
a>1
(iv)
a<-1
, n<0
For the different values of a taken, exponentially decaying or growing functions will be
obtained. When 0<a<1, an exponentially decaying sequence will be obtained. When -1<a<0, an
exponentially decaying sequence with alternate positive and negative amplitude samples will be
obtained. When a>1, an exponentially growing sequence will be obtained. When a<-1, an
exponentially growing sequence with alternate positive and negative amplitude samples will be
obtained.
Source Code:
clc;
clear all;
close all;
n=0:20;
a1=input('Enter the value of a in 0<a<1 : ');
x=a1.^n;
a2=input('Enter the value of a in -1<a<0 : ');
y=a2.^n;
a3=input('Enter the value of a>1 : ');
z=a3.^n;
a4=input('Enter the value of a<-1 : ');
u=a4.^n;
subplot(2,2,1);
stem(n,x);
xlabel('Time index n');
ylabel('Amplitude');
title('Exponential signal for 0<a<1');
subplot(2,2,2);
stem(n,y);
xlabel('Time index n');
ylabel('Amplitude');
title('Exponential signal for -1<a<0');
subplot(2,2,3);
stem(n,z);
xlabel('Time index n');
ylabel('Amplitude');
title('Exponential signal for a>1');
subplot(2,2,4);
stem(n,u);
xlabel('Time index n');
ylabel('Amplitude');
title('Exponential signal for a<-1');
Result:
Enter the value of a in 0<a<1 : 0.5
Enter the value of a in -1<a<0 : -0.5
Enter the value of a>1 : 5
Enter the value of a<-1 : -5
Conclusion: Implemented the generation of the exponential signal for different values of a using
MATLAB and plotted the same. It is observed that for 0<a<1, an exponentially decaying sequence is
obtained, for -1<a<0, an exponentially decaying sequence with alternate positive and negative
amplitude samples is obtained, for a>1,an exponentially growing sequence is obtained, for a<-1, an
exponentially growing sequence with alternate positive and negative amplitude samples is obtained.