You are on page 1of 13

Saransh singhal & Sambhav jain

EXPERIMENT -2
Aim: Introduction to continuous time signals.
Theory:
The Signals, which are functions of one or more independent variables, contain information about the
behaviour or nature of some phenomenon. Independent variables may be time, space etc. depending on type
of signals. Some examples are: a speech signal would be mathematically represented by acoustic pressure
as a function of time, Voltage, current or power as functions of time, a monochromatic picture can be
described as a signal which is mathematically represented by brightness as a function of two spatial
variables,
The purpose of this lab is the introduction of the graphical representation of elementary as well as Complex
Signals. For this Lab, our focus will be on a single (1-D) independent variable which we call time.
Depending on time, signals can be classified into continuous and discrete-time signals used in linear
systems. It is important to emphasize that. A continuous-time signal takes on a value at every point in time,
whereas a discrete-time signal is only defined at integer values of the time variable. However, while
discrete-time signals can be easily stored and processed on a computer, it is impossible to store the values of
a continuous-time signal for all points along a segment of the real line.
How then do we process continuous-time signals? In this lab, we will see that continuous- time signals may
be processed by first approximating them by discrete-time signals using a process known as sampling. We
will see that proper selection of the spacing between samples is crucial for an efficient and accurate
approximation of a continuous-time signal. Excessively close spacing will lead to too much data with not
much improvement in signal representation, whereas excessively distant spacing will lead to a poor
approximation of the continuous-time signal.
A digital computer cannot store all points of a continuous-time signal since this would require an infinite
amount of memory. It is, however, possible to plot a signal which looks like a continuous-time signal, by
computing the value of the signal at closely spaced points in time, and then connecting the plotted points
with lines. The Matlab plot function may be used to generate such plots.
Steps for plotting continuous time signals are as follows:
1). Assign the value dt very small, as per Sampling Theorem.
2). Vary the timet between two points with an increment of dt.
Use the following sequence of commands in a script file to generate two continuous-time plots of the signal
sin (t/6).
1 % Generate Continuous-time sinusoidal signal
2 t1 = 0:0.1:20,
3 z = sin(t1/6);
4 subplot(3,1,2)
5 plot(t1,z)
6 t2 = 0:1:20;
7 w = sin(t2/6);
8 subplot(3,1,3)
9 plot(t2,w)

Saransh singhal & Sambhav jain

INLAB EXERCISE
Q1. Plot the following continuous-time functions over the specified intervals. Write single script files for all
CT signals with name CTsignals_GroupNo. X.m. Use the plot and figure command, and be sure to label
the time axes.
(a) Unit Impulse function, x1 (t) = (t)
(b) Unit Step function, x2(t) = u (t) for t = [-2, 2]
(c) Unit Ramp function, x3(t) = r (t) for t = [-2, 5]
(d) sinusoidal function, x4(t) = 3*sin(2*pi*f*t), where f = 20 Hz for t = - 1 to 1 secs
(e) Exponential function, x5(t) = e -at for t = [-4, 4] for a= 0.5, 1.5. Comment on the effect of time scaling.
(f) rect(t) for t = [ -2 , 2]
(g) sinc(t) for t = [-1, 10]
Hint: These functions may be computed in Matlab by using a Boolean expression. For example, if t = -10:
0.1: 10, then y = u (t) may be computed using the Matlab command x = t > 0.

SOL:
(a)% CT Del Function
T=0.001;
t=-2:T:2;
del=(t==0);
subplot(4,2,1);
plot(t,del,'r','linewidth',1);
xlabel('t');
ylabel('del(t)');
title('Del Function');
figure(1);

Saransh singhal & Sambhav jain


(b)% CT Unit Step Function
U=(t>=0);
subplot(4,2,2);
plot(t,U,'r','linewidth',1);
xlabel('t');
ylabel('U(t)');
title('Unit Step Function');
figure(2);

(c)%CT Unit Ramp Function


T=0.001
t=-2:T:5;
U=(t>=0);
ramp=(t.*U);
subplot(4,2,3);
plot(t,ramp,'r','linewidth',1);
xlabel('t');
ylabel('ramp(t)');
title('Unit Ramp Function');

Saransh singhal & Sambhav jain

(d)%CT Sinusoidal Signal


T=0.01;
t=-1:T:1;
f=20;
S=(3*sin(2*pi*f*t));
subplot(4,2,4);
plot(t,S,'r','linewidth',0.1);
xlabel('t');
ylabel('S(t)');
title('Sinusoidal Signal');
figure(4);

Saransh singhal & Sambhav jain


(e)%CT Exponential Signal
T=0.001;
t=-4:T:4;
a=0.5;
E=exp(-a*t);
subplot(4,2,5);
plot(t,E,'r','linewidth',1);
xlabel('t');
ylabel('E(t)');
title('xponential Signal');
figure(5);

(f)%CT Exponential Signal


T=0.001;
t=-4:T:4;
a1=1.5;
E2=exp(-a1*t);
subplot(4,2,6);
plot(t,E2,'r','linewidth',1);
xlabel('t');
ylabel('E2(t)');
title('Exponential Signal');
figure(6);

Saransh singhal & Sambhav jain

(g)%CT Rect Signal


T=0.001;
t=-2:T:2;
rect=(t>=-1/2&t<=1/2);
subplot(4,2,7);
plot(t,rect,'r','linewidth',1);
xlabel('t');
ylabel('rect(t)');
title('Rect Signal');
figure(7);

Saransh singhal & Sambhav jain


(h)%CT Sinc Signal
T=0.001;
t=-1:T:10;
Y=sinc(t);
subplot(4,2,8);
plot(t,Y,'r','linewidth',1);
xlabel('t');
ylabel('Y(t)');
title('Sinc Signal');
figure(8);

Q.2 Generate signal x(t) = u(t)-u(t-10).


SOL:

%CT Unit Step Function


T=0.001;
t=-20:T:20;
u1=(t>=0);
u2=(t>=-10);
x=(u1-u2);
plot(t,x,'r','linewidth',2);
xlabel('t');
ylabel('x(t)');
title('x(t)=u(t)-u(t+10)');

Saransh singhal & Sambhav jain

POSTLAB
Q1.Generate the waveform of following signals:
For CT signals, t = is -5 to 5sec. Take appropriate value of sampling interval.
(a) xa(t) = (t + 1)
(b) xb(t) = (t + 1/2) (t - 1/2)
(c) xc(t) = t u(t)
(d) xd(t) = u (t + 2) u(t - 3)
(e) xe(t) = r (t +1) r (t) + r (t - 2)
(f) xf(t) = exp(-t) sin(2t) + exp(-t/2) cos(5 t)
(a)%CT Del Function
T=0.001;
t=-5:T:5;
a=(t==-1);
subplot(3,2,1);
plot(t,a,'r','linewidth',2);
xlabel('t');
ylabel('xa(t)');

Saransh singhal & Sambhav jain


(b)%CT Del Function

p=(t==-1/2);
q=(t==1/2);
b=(p-q);
subplot(3,2,2);
plot(t,b,'r','linewidth',2);
xlabel('t');
ylabel('xb(t)');

(C) %CT Unit Ramp Function


U=(t>=0);
ramp=(t.*U);
subplot(3,2,3);
plot(t,ramp,'r','linewidth',1);
xlabel('t');
ylabel('xc(t)');

Saransh singhal & Sambhav jain


(d)%CT Unit Step Function

u1=(t>=-2);
u2=(t>=3);
x=(u1-u2);
subplot(3,2,4);
plot(t,x,'r','linewidth',2);
xlabel('t');
ylabel('xd(t)');

(e)%CT Unit Ramp Function

U1=(t>=-1);
W=((t+1).*U1);
U2=(t>=0);
Y=(t.*U2);
U3=(t>=2);
Z=((t-2).*U3);
X=(W-Y+Z);
subplot(3,2,5);
plot(t,X,'r','linewidth',2);
xlabel('t');
ylabel('xe(t)');

Saransh singhal & Sambhav jain


(f)%CT Signal

A=exp(-t);
B=sin(2*pi*t);
C=exp(-t/2);
D=cos(5*pi*t);
P=1/T*(A.*B+C.*D);
subplot(3,2,6);
plot(t,P,'r','linewidth',1);
xlabel('t');
ylabel('xf(t)');

Q2. Sketch the waveform:

Saransh singhal & Sambhav jain


(a)% CT Signal

T=0.1;
t=0:T:7;
V=(20.*exp(-2.*t).*(t<=2)+(10*t-30).*(t>=2&t<=3)+(-10*t+50).*(t>=3&t<=5)+(10*t70 ).*(t>=5&t<=7));
subplot(2,1,1);
plot(t,V,'r','linewidth',1);
xlabel('t');
ylabel('V(t)');

(b)%CT Signal
V=(-40.*exp(-2.*t).*(t<=2)+10.*(t>=2&t<=3)+-10.*(t>=3&t<=5)+10.*(t>=5&t<=7));
subplot(2,1,2);
plot(t,V,'r','linewidth',1);
xlabel('t');
ylabel('Derivative');
figure(V);

Saransh singhal & Sambhav jain

LEARNING OUTCOMES:
In this experiment we learnt about continous signal ,their graphical representation as well as complex signals.
Continous time signal take value at point of time.

You might also like