Вы находитесь на странице: 1из 6

Digital Signal Processing AUF-CEA

Friday 2 pm -5pm 1st Sem. / S.Y. 2016-2017

EXPERIMENT NO. 1
TYPES OF SEQUENCES
DSP LABORATORY

1. Unit Sample Sequence


( ) { and ( ) {

Shifted by n0

[ ] ( )
( ) ( )

[ ] ( )
[ ] [( ) ]

MATLAB EXAMPLE 1

>> close all;


>> clear all;
>> clc;
>> n=[-3:1:5];
>> impseq(3,-3,5);
>> stem(n,ans);

MATLAB EXAMPLE 2

>> clear all;


>> close all;
>> clc;
>> n=[-6:1:2];
>> impseq(-1,-6,2);
>> stem(n,ans);

1 hot
Digital Signal Processing AUF-CEA
Friday 2 pm -5pm 1st Sem. / S.Y. 2016-2017

2. Unit Step Sequence

( ) { and ( ) {

Shifted by n0

[ ] ( )
( ) ( )
[ ] ( )
[ ] [( ) ]

MATLAB EXAMPLE 1

>> clear all;


>> close all;
>> clc;
>> n=[-4:1:4];
>> stepseq(2,-4,4);
>> stem(n,ans);

MATLAB EXAMPLE 2

>> clear all;


>> close all;
>> clc;
>> n=[-2:1:3];
>> stepseq(-1,-2,3);
>> stem(n,ans);

2 hot
Digital Signal Processing AUF-CEA
Friday 2 pm -5pm 1st Sem. / S.Y. 2016-2017

3. Real- Valued Exponential Sequence

( )

Example
( ) ( )

MATLAB

>> n=[0:10];
>> x=(0.9).^n;
>> stem(n,x)

4. Complex-Valued Exponential Sequence

( ) ( )

Example
( ) [( ) ]

MATLAB

>> n=[0:10];
>> x=exp((2+3*j).*n);
>> stem(n,x)

3 hot
Digital Signal Processing AUF-CEA
Friday 2 pm -5pm 1st Sem. / S.Y. 2016-2017

5. Sinusoidal Sequence

( ) ( )

Example
( ) ( ⁄ ) ( )

MATLAB

>> n=[0:10];
>> x=3*cos(0.1*pi*n+pi/3) + 2*sin(0.5*pi*n);
>> stem(n,x)

6. Random Sequence

rand(1,N) generates a length N random sequence whose elements are uniformly


distributed between [0,1].
randn(1,N) generates a length N Gaussian random sequence with mean 0 and
variance 1.

MATLAB

>> x=rand(1,20);
>> stem(x)

4 hot
Digital Signal Processing AUF-CEA
Friday 2 pm -5pm 1st Sem. / S.Y. 2016-2017

MATLAB

>> x=randn(1,20);
>> stem(x)

7. Periodic Sequence

( ) ( ) ( )
[ ]

5 hot
Digital Signal Processing AUF-CEA
Friday 2 pm -5pm 1st Sem. / S.Y. 2016-2017

MATLAB

>> x=[6 9 0]
>> xtilde=x’ *ones(1,4)
>> xtilde=xtilde(:)
>> xtilde=xtilde’

ACTIVITY

A. Create the function


B. Generate [ ] using MATLAB

6 hot

Вам также может понравиться