You are on page 1of 6

EXPERIMENT-1

Aim: To plot different types of signals in Continuous and Discrete form


Apparatus: Octave-Online
Theory:
In signal processing, a signal is a function that conveys information about a phenomenon. In
electronics and telecommunications, it refers to any time varying voltage, current,
or electromagnetic wave that carries information. A signal may also be defined as an
observable change in a quality such as quantity.

A continuous signal or a continuous-time signal is a varying quantity (a signal) whose


domain, which is often time, is a continuum (e.g., a connected interval of the reals). That is,
the function's domain is an uncountable set. The function itself need not to be continuous.

Discrete time views values of variables as occurring at distinct, separate "points in time", or


equivalently as being unchanged throughout each non-zero region of time 

Code:
clc; clear all;

% time axis

n = -25:25;

% unit impulse

delta = n==0;

figure;

subplot(1,2,1);

plot(n,delta,'linewidth',1.5);

title ("continuous delta");

xlabel ("time");

ylabel ("Amplitude");
subplot(1,2,2);

stem(n,delta,'markersize',2);

title ("discrete delta");

xlabel ("n");

ylabel ("Amplitude");

%unit step

step = n>=0;

figure;

subplot(1,2,1);

plot(n,step);

title ("continuous step");

xlabel ("time");

ylabel ("Amplitude");

subplot(1,2,2);

stem(n,step);

title ("discrete step");

xlabel ("n");

ylabel ("Amplitude");

%ramp

ramp = n.*step;

figure;

subplot(1,2,1);

plot(n,ramp);

title ("continuous ramp");

xlabel ("time");

ylabel ("Amplitude");
subplot(1,2,2);

stem(n,ramp);

title ("discrete ramp");

xlabel ("n");

ylabel ("Amplitude");

% sinusoidal

a = 0.4;

t = 0:0.1:6;

sig=4*sin(2*pi*a*t);

figure;

plot(sig);

title("Sinusoidal Signal");

xlabel('Time');

ylabel('Amplitude');

figure;

stem(sig);

title("Sinusoidal Signal");

xlabel('Time');

ylabel('Amplitude');

% Exponential

X = -10:10;

res = exp(X);

figure;
plot(X,res);

title("Continuos Exponential");

xlabel('Time');

ylabel('Amplitude');

figure;

stem(X,res);

title("Discrete Exponential");

xlabel('Time');

ylabel('Amplitude');

Observation:
Conclusion:
Hence, we were able to understand continuous and discrete signal and implement the
same.

You might also like