Experiment - 1: Aim: Program For The Generation of Unit Step Sequence
Experiment - 1: Aim: Program For The Generation of Unit Step Sequence
clc;
close all;
clear all;
t=0:1:9
y=ones(1,10);
subplot(1,2,1);
plot(t,y);
ylabel('amplitude--->');
xlabel('time--->');
title('continuous');
subplot(1,2,2);
stem(t,y);
ylabel('amplitude--->');
xlabel('time--->');
title('Discrete');
EXPERIMENT - 2
Aim : Program for the generation of unit ramp signal
clc;
close all;
clear all;
t=0:1:9
y=t;
subplot(1,2,1);
plot(t,t);
ylabel('y --->');
xlabel('t --->');
subplot(1,2,2);
stem(t,t);
ylabel('y --->');
xlabel('t --->');
OUTPUT
OUTPUT
EXPERIMENT - 3
Aim: Program for the generation of unit impulse sequence
clc;
close all;
clear all;
t=0:1:9
y=[1;zeros(9,1)]
subplot(1,2,1);
plot(t,y);
ylabel('y --->');
xlabel('t --->');
title('Continuous');
subplot(1,2,2);
stem(t,y);
ylabel('y --->');
xlabel('t --->');
title('Discrete');
OUTPUT
EXPERIMENT - 4
Aim: Program for the generation of sinusoidal sequence.
clc;
close all;
clear all;
x=-pi:0.01:pi;
subplot(2,1,1);
plot(x,sin(x));
grid on;
subplot(2,1,2);
stem(x,sin(x));
grid on;
ylabel('amplitude --->');
xlabel('x --->');
OUTPUT
EXPERIMENT -5
Aim : Program for the generation of cosine sequence
clc;
close all;
clear all;
x=-pi:0.01:pi;
subplot(2,1,1);
plot(x,cos(x));
grid on;
subplot(2,1,2);
stem(x,cos(x));
grid on;
ylabel('amplitude --->');
xlabel('x --->');
OUTPUT
EXPERIMENT - 6
Aim : To plot linear convolution of two sequences using inbuilt
function.
clc;
close all;
clear all;
x=[1,2,1,2];
y=[1,2,3,2];
w=conv(x,y);
subplot(2,1,1);
plot(w);
ylabel('y--->');
xlabel('x--->');
title('Continuous');
subplot(2,1,2);
stem(w);
ylabel('y--->');
xlabel('x--->');
title('Disrete');
OUTPUT
EXPERIMENT - 7
Aim : To plot the magnitude, phase and inverse of a 4-point DFT .
clc;
clear all;
close all;
x=[1,0,0,1]
t=[0,1,2,3];
y=fft(x,4);
m = abs(y);
p = unwrap(angle(y));
subplot(2,2,1)
plot(t,m);
subplot(2,2,2)
plot(t,y);
subplot(2,2,3)
plot(t,p);
OUTPUT
EXPERIMENT - 8
Aim : To plot the magnitude, phase and inverse of a 8-point DFT .
clc;
clear all;
close all;
x=[1,0,0,1,1,2,1,0];
t=[0,1,2,3,4,5,6,7];
y=fft(x,8);
m = abs(y);
p = unwrap(angle(y));
subplot(2,2,1)
plot(t,m);
subplot(2,2,2)
plot(t,y);
subplot(2,2,3)
plot(t,p);
OUTPUT
EXPERIMENT - 9
Aim : To plot the magnitude, phase and inverse of a 16-point DFT .
clc;
clear all;
close all;
x=[1,0,0,1,1,2,1,0,1,1,1,1,2,2,2,2];
t=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
y=fft(x,16);
m = abs(y);
p = unwrap(angle(y));
subplot(2,2,1)
plot(t,m);
subplot(2,2,2)
plot(t,y);
subplot(2,2,3)
plot(t,p);
OUTPUT