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

Plotting A Simple Discrete Time Signal: Source Code: Case#1 A 1

The document describes experiments plotting simple discrete time signals with different values of the parameter a. It generates signals of the form x=c*a^n for values of a both above and below 1. The plots show that for a>1 the signal exponentially increases, for 0<a<1 it exponentially decreases, for -1<a<0 it oscillates between positive and negative values, and for a<-1 it exponentially decreases towards more negative values.

Uploaded by

razakhan
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)
63 views

Plotting A Simple Discrete Time Signal: Source Code: Case#1 A 1

The document describes experiments plotting simple discrete time signals with different values of the parameter a. It generates signals of the form x=c*a^n for values of a both above and below 1. The plots show that for a>1 the signal exponentially increases, for 0<a<1 it exponentially decreases, for -1<a<0 it oscillates between positive and negative values, and for a<-1 it exponentially decreases towards more negative values.

Uploaded by

razakhan
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/ 4

Lab # 3

Plotting a simple discrete time signal


Source code:
Case#1 a>1:
c=2;
a=7;
n=0:15;
x=c*a.^n;
subplot(2,1,1);
stem(n,x,'linewidth',1.5);
xlabel('time');
ylabel('amplitude');
title('simple discrete time signal for a>1');
grid on ;

Case#2 0<a<1:

c=2;
a=0.6;
n=0:15;
x=c*a.^n;
subplot(2,1,2);
stem(n,x,'linewidth',1.5);
xlabel('time');
ylabel('amplitude');
title('simple discrete time signal for 0<a<1');
grid on ;

matlab output:
12
x 10 simple discrete time signal for a>1
10
amplitude

0
0 5 10 15
time
simple discrete time signal for 0<a<1
2

1.5
amplitude

0.5

0
0 5 10 15
time

Case#3 -1<a<0:

c=2;
a=-0.5;
n=0:15;
x=c*a.^n;
subplot(2,1,1);
stem(n,x,'linewidth',1.5);
xlabel('time');
ylabel('amplitude');
title('simple discrete time signal for a>1');
grid on ;

Case#4 a<-1:
c=2;
a=-2;
n=0:15;
x=c*a.^n;
subplot(2,1,1);
stem(n,x,'linewidth',1.5);
xlabel('time');
ylabel('amplitude');
title('simple discrete time signal for a>1');
grid on ;

matlab output
simple discrete time signal for 0<a<1
2

1
amplitude

-1
0 5 10 15
time
10
x 10 simple discrete time signal for a>1
5

0
amplitude

-5

-10
0 5 10 15
time

Case # 5:
a=1;
matlab source code :
c=2;
a=1;
n=0:15;
x=c*a.^n;
subplot(2,1,1);
stem(n,x,'linewidth',1.5);
xlabel('time');
ylabel('amplitude');
title('simple discrete time signal for a=1');
grid on ;
case 6:

a=-1:

matlab source code:


c=2;
a=-1;
n=0:15;
x=c*a.^n;
subplot(2,1,2);
stem(n,x,'linewidth',1.5);
xlabel('time');
ylabel('amplitude');
title('simple discrete time signal for a=-1');
grid on ;

output:
simple discrete time signal for a=1
2

1.5
amplitude

0.5

0
0 5 10 15
time
simple discrete time signal for a=-1
2

1
amplitude

-1

-2
0 5 10 15
time

You might also like