You are on page 1of 8

Experiment-01

Aim- Generation of Continuous and Discrete Elementary signals


(Periodic and Non-periodic) using mathematical expression.
Software Requirement-Matlab 7.0
Theory-

Continuous-Time and Discrete-Time Signals: A signal x(t) is a continuous-time


signal if t is a continuous variable. If t is a discrete variable, that is, x(t) is defined
at discrete times, then x(t) is a discrete-time signal.

Periodic and Non periodic Signals: A continuous-time signal x(t) is to be


periodic with period T if there is a positive nonzero value of T for which

X(t+T)=x(t) all t

Any continuous-time signal which is not periodic is called a non-periodic signal.

Periodic discrete-time signal are defined analogously. A sequence x[n] is periodic


with period N if there is a positive integer N for which
X[n+N]=x[n] all n

(1) Continuous periodic time signal


Coding:
t=[0:0.1:20]

y=cos(2*t+pi/4)

plot(t,y) %plot command to plot the graph%

xlabel('TIME----------->>')

ylabel('y(t)=cos(2*t+pi/4)')

title('continuous periodic signal') %title of the signal%


(2) Discrete periodic time signal
Coding :
n=[0:0.5:20 ]
y=sin(pi*2*n/8)
stem(n,y) %stem command to plot discrete values of signal%
xlabel('TIME----------->>') %labeling on x axis%
ylabel('y(t)=sin(pi*n*2/8)')
title('discrete periodic signal')
(3) Non periodic continuous signal
Coding:
t=0:2:50
y=cos(t/2).*cos(t*pi/4)
plot(y)
xlabel('time')
ylabel('y(t)')
1

0.8

0.6

0.4

0.2
y (t )

-0.2

-0.4

-0.6

-0.8

-1
0 5 10 15 20 25 30
time

(4) Non periodic Discrete signal


Coding:
n=0:2:50
y=cos(t/2).*cos(t*pi/4)
stem(y)
xlabel('time')
ylabel('y(n)')
1

0.8

0.6

0.4

0.2
y (n )

-0.2

-0.4

-0.6

-0.8

-1
0 5 10 15 20 25 30
time

Result:- Various periodic and non-periodic signals has been studied.


Experiment-02
Aim: Generation of various continuous and discrete unit step
signals.
Software Requirement- Matlab 7.0
Theory- Continuous time unit step signals is also a basic continuous time signal
and is denoted by u(t) this function is defined as.

U(t)= 1 t>0
0 t<0

(1) Discrete time unit step signal:-

U(n)= 1 n>=0
0 n<0

Coding:-

Continuous unit step signal:-

t1=0:5:50
t2=-50:5:0
y1=ones(size(t1))
y2=zeros(size(t2))
t=[t2 t1]
y=[y2 y1]
plot(t,y)
xlabel('t')
title('cont. unit step')
cont. unit step
1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
-50 -40 -30 -20 -10 0 10 20 30 40 50
t

(2) Discrete Unit Step Signal :-

Coding:-

n1=0:5:30
n2=-50:5:0
y1=ones(size(n1))
y2=zeros(size(n2))
n=[n2 n1]
y=[y2 y1]
stem(n,y)
xlabel('n')
title('discrete unit step')
discrete unit step
1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
-50 -40 -30 -20 -10 0 10 20 30
n

EXPERIMENT NO:4

Aim: To generate continuous and discrete convolution time


signal

Software used: Matlab 7.0

Theory:
Convolution theorem for continuous system:
If the impulse response of an
analog or continuous time system be h(t), it means that for an input δ(t) its
output is h(t). Hence for all linear system its output for a shifted impulse
δ(t-T) is h(t-T). The following are the mathematical representation of these
operations:
δ(t) h(t)
δ(t-T)  h(t-T)
x(t) δ(t-T)  x(T) h(t-T)
∫ x(T) δ(t-T) dT  ∫ x(T) h(t-T) dT
From the last two statements, we can say that an input x(T) δ(t-T) the output
is x(T) h(t-T) and for an input of continuous summation or integration of
x(T) δ(t-T), the output is also continuous summation of x(T) h(t-T).
Therefore, we can write by the linearity of the system
y(t)= ∫ x(T) h(t-T) dT

The right hand side of the above equation is defined as convolution of x(t)
with h(t) and now we can write it as follow:
y(t)= convolution of x(t) and h(t)
= x(t) * h(t)
= ∫ x(T) h(t-T) dT
The symbol ‘*’ stands for convolution.

Convolution for discrete time function:


If x(n) is applied as an input to a discret time system, the response y(n) of
the system is given by
y(n)= T[x(n)]=t[∑ x(k) δ(n-k)]
to study LTI systems linear convolution plays an important role.

Coding:
Continuous convolution time system:
t1=[-10:1:0];
t2=[0:1:2];
t3=[2:1:10];
x=zeros(size(t1));
y=ones(size(t2));
z=zeros(size(t3));
t=[t1,t2,t3];
a=[x,y,z];
subplot(2,2 ,1);
plot(t,a,'m');
xlabel('time-->');
ylabel('u(t)-u(t-2)');
u1=[-11:1:0];
u2=[0:1:3];
u3=[3:1:11];
v1=zeros(size(u1));
v2=ones(size(u2));
v3=zeros(size(u3));
u=[u1,u2,u3];
b=[v1,v2,v3];
subplot(2,2,2);
plot(u,b,'m')
xlabel('time-->');
ylabel('u(t)-u(t-3)');
c=conv(y,v2);
subplot(2,2,3);
plot(c);
xlabel('time-->');
ylabel('(u(t)-u(t-2))*(u(t)-u(t-3))');

1 1

0.8 0.8

0.6 0.6
u(t)-u(t-3)
u(t)-u(t-2)

0.4 0.4

0.2 0.2

0 0
-10 -5 0 5 10 -15 -10 -5 0 5 10 15
time--> time-->

2.5
(u(t)-u(t-2))*(u(t)-u(t-3))

1.5

1
1 2 3 4 5 6
time-->

You might also like