Experiment No. 2 AIM:-Write A MATLAB Program To Generate Standard Discrete Time Signals and

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

EXPERIMENT NO.

AIM:- Write a MATLAB program to generate standard discrete time signals and
plot them.

To generate some standard test signals are as follows-

1. Delta or unit impulse function.

2. Unit step signal.

3. Unit ramp signal.

4. Exponential signal.

5. Sinusoidal signal.

THEORY:-

Discrete time signal:-


In this case the value of signal is specified only at specific time. So the signal
represented at “discrete interval of time” is called as discrete time signal.
The discrete time signal is generated from continuous time signal by using the
sampling operation.

Discrete valued signal:


If the variation in amplitude of signal is not continuous; but the signal has certain
discrete amplitude levels then such a signal is called as discrete valued signal.
Such signal may be again continuous or discrete in nature.

Standard test signals:-


In the analysis of communication systems std test signals play a vital role. Such
signals are used to check the performance of system. Applying such signals at the
system; the output is checked. Now depending on the input output characteristics
of that particular system; study of different properties of system can be done. Some
standard test signals are as follows.
1. Delta or unit impulse signal
2. Unit step signal

3. Unit ramp signal

4. Exponential signal

5. Sinusoidal signal

Delta or unit impulse function:-

A discrete time unit impulse function is denoted by δ (n).

Its amplitude is 1 at n=0 and for all other values of n its amplitude is 0.

δ (n)={ 1 for n=0;

0 for n≠ 0;

In the sequence form it can be represented as δ (n) = {…..0, 0, 0, 1, 0, 0, 0}

or δ(n)={1}

The graphical representation of delta function is as shown in fig 1.

Unit step signal:

A discrete time unit step signal is denoted by u (n). Its value is unity (1) for all
positive values of n. that means its value is 1 for n >= 0. While for other values of
n, its value is 0.
U(n)={ 1 for n>= 0;

0 for n<=0

In the form of sequence it can be written as

U (n) = {1, 1, 1, 1,}

Here arrow is absent, so it is represented as shown in fig2.

Unit ramp signal:-

A discrete time unit ramp signal is denoted by ur(n) = n; for n >=0;

ur(n)= 0; for n <0;

Graphically it is represented as shown in fig 3.


Exponential signal:-

A discrete time exponential signal is expressed as

X(n)= an

Here ‘a’ is some real constant. If ‘a’ is the complex number then X(n0) is written
as,

X(n)=r ejѳ

Now depending upon value of ѳ we have different cases.

Case1: when a>1: rising exponential signal.

Case2: when 0<a<1: decaying exponential signal.

Case3: when a<-1: double sided growing exponential signal.

Case4: -1<a<0: double sided decaying exponential signal.

Sinusoidal waveform:-
A discrete time sinusoidal waveform is denoted by,

X(n)=Asin ωn

Here, A=amplitude, ω=angular frequency=2 f

PROGRAM:-

x=[0 0 0 1 0 0 0 0]
n=-3:1:4
subplot(3,2,1)
stem(n,x)
xlabel('Sample')
ylabel('Amplitude')
title('Unit impulse function')
x1=[0 0 0 0 1 1 1 1]
n=-4:1:3
subplot(3,2,2)
stem(n,x1)
xlabel('Sample')
ylabel('Amplitude')
title('Unit step function')
x2=[0 0 0 0 1 2 3 4]
n=-4:1:3
subplot(3,2,3)
stem(n,x2)
xlabel('Sample')
ylabel('Amplitude')
title('Unit ramp function')
n=-10:1:10
x3=exp((-0.1+0.3j)*n)
subplot(3,2,4)
stem(n,abs(x3))
xlabel('Time')
ylabel('Voltage')
title('Exponential function')
n=0:.1:pi
x4=sin(2*pi*n)
subplot(3,2,5)
stem(n,x4)
xlabel('Time')
ylabel('Voltage')
title('Sinusoidal function')
n=0:.1:pi
x5=cos(2*pi*n)
subplot(3,2,6)
stem(n,x5)
xlabel('Time')
ylabel('Voltage')
title('Cosine function')
OUTPUT:-
RESULT: -

Thus,program to generate standard discrete time signals has been execute


successfully.

You might also like