Professional Documents
Culture Documents
Experiment-1: Aim: To Plot Different Types of Signals in Continuous and Discrete Form Apparatus: Octave-Online Theory
Experiment-1: Aim: To Plot Different Types of Signals in Continuous and Discrete Form Apparatus: Octave-Online Theory
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);
xlabel ("time");
ylabel ("Amplitude");
subplot(1,2,2);
stem(n,delta,'markersize',2);
xlabel ("n");
ylabel ("Amplitude");
%unit step
step = n>=0;
figure;
subplot(1,2,1);
plot(n,step);
xlabel ("time");
ylabel ("Amplitude");
subplot(1,2,2);
stem(n,step);
xlabel ("n");
ylabel ("Amplitude");
%ramp
ramp = n.*step;
figure;
subplot(1,2,1);
plot(n,ramp);
xlabel ("time");
ylabel ("Amplitude");
subplot(1,2,2);
stem(n,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.