0% found this document useful (0 votes)
10 views2 pages

Experiment No: Experiment Name: Sequence Generation Using: Matlab

The document describes an experiment in MATLAB to generate a complex exponential sequence. It prompts the user to input values for the real exponent, imaginary exponent, gain constant, and sequence length. It then generates and plots the real and imaginary parts of the sequence. The real part is plotted first, followed by the imaginary part after the user presses return.

Uploaded by

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

Experiment No: Experiment Name: Sequence Generation Using: Matlab

The document describes an experiment in MATLAB to generate a complex exponential sequence. It prompts the user to input values for the real exponent, imaginary exponent, gain constant, and sequence length. It then generates and plots the real and imaginary parts of the sequence. The real part is plotted first, followed by the imaginary part after the user presses return.

Uploaded by

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

Experiment no: 03

Experiment name: Sequence generation using


MATLAB.
Coding:
>> %Lab 3 - Part a
%Generation of complex exporential Sequence
%
a = input('Type in real exponent = ');
b = input('Type in imaginary exponent = ');
c =a+b*i;
K =input('Type in the gain constant = ');
N =input('Type in the length of sequence = ');
n =1:N;
x =K*exp(c*n);
stem(n,real(x));
xlabel('Time index n'); ylabel('Amplitude');
title('Real part');
disp('PRESS RETURN for imaginary part');
pause
stem(n,imag(x));
xlabel('Time indes n'); ylabel('Amplitude');
title('imaginary part');
Type in real exponent = -1/12
Type in imaginary exponent = pi/6
Type in the gain constant = 0.9
Type in the length of sequence = 40
PRESS RETURN for imaginary part >>

Real part

0.8
0.6

Amplitude

0.4
0.2
0
-0.2
-0.4
-0.6

10

15

20
25
Time index n

30

35

40

30

35

40

imaginary part

0.8
0.6

Amplitude

0.4
0.2
0
-0.2
-0.4
-0.6

10

15

20
25
Time indes n

You might also like