Poc Lab Manual Correct
Poc Lab Manual Correct
LAB MANUAL
(2022 SCHEME)
LIST OF EXPERIMENTS
clc ;
clf ;
clear all;
L =5;
n=-L:L;
x=[ zeros(1,L),ones(1,L +1)];
a= gca();
a.y_location ="middle";
plot2d3 (n,x)
title ( "unitstep" );
xlabel ( "n" );
ylabel ( "x" );
b) Rectangular
clc;
clear ;
x=-4:0.0001:4;
y=((sign(x)+1)/2-((sign(x-2)+1)/2));
plot(x,y)
title("rectangular signal");
xlabel("t");
ylabel("p(t)");
axis([ -4 4 -3 3]);
c) standard triangle
clc ;
clf ;
clear all;
// Capt ion : g e n e r a t i o n o f t r i a n g u l a r wave
a =8;
t =0:( %pi /4) :(4* %pi);
y=a*sin(2*t);
a= gca();
a.x_location ="middle";
plot (t,y)
title ( " t r i a n g u l a r wave " );
xlabel ( " t " );
ylabel ( " y " );
d)sinusoidal
clc ;
clf ;
clear all;
// Caption : g e n e r a t i o n o f s i n e wave
f =0.2;
t =0:0.1:10;
x= sin(2*%pi*t*f);
plot (t,x);
title ( "sinewave" );
xlabel ( "t" );
ylabel ( "x" );
e) Exponential signal
clc ;
clf ;
clear all;
// Capt ion : g e n e r a t i o n o f e x p o n e n t i a l wave
t = -2:0.1:2;
x= exp (t);
plot (t,x)
title ( " e x p o n e n t i a l wave " );
xlabel ( " t " );
ylabel ( " x " );
EX:NO:2
clc ;
close ;
// DTS S i g n a l
N1 = 2;
n = - N1 : N1 ;
x = ones (1 , length (n ) ) ;
// D i s c r e t e −tim e F o u r i e r T ran sfo rm
Wmax = 2* %pi ;
K = 4;
k = 0:( K /1000) : K ;
W = k * Wmax / K ;
XW = x*exp(- sqrt(-1)*n'* W ) ;
XW_Mag = real ( XW ) ;
W = [ - mtlb_fliplr (W ) , W (2:1001) ]; // Omega f rom −
Wmax to Wmax
XW_Mag = [ mtlb_fliplr ( XW_Mag ) , XW_Mag (2:1001) ];
// p l o t f o r ab s ( a )<1
figure
subplot (2 ,1 ,1) ;
a = gca () ;
a.y_location ='origin';
a.x_location ='origin';
plot2d3 ( 'gnn',n,x);
xtitle("Discrete Time Sequencex[n]");
subplot (2 ,1 ,2) ;
a = gca () ;
a.y_location =" o r i g i n ";
a.x_location =" o r i g i n ";
plot2d (W , XW_Mag )
title ( "D i s c r e t e Time F o u r i e r T ran sfo rm X( exp (jW ) )" )
EX:NO:3
Amplitude Modulation and demodulation: Generation and display the
relevant signals and its spectrums.
clc;
clear;
close;
fm=3;
fc=20;
fs=100
t=0:1/fs :3;
p=length(t)
am=input('Enter the message signal amplitude =');
ac=input('Enter the carrier signal amplitude (ac>am)=');
//Message signal generation
msg=am*cos(2*%pi*fm*t);
figure(1);
subplot(3,1,1);
plot(t,msg);
xlabel('TIME');
ylabel('AMPLITUDE')
title('Message Signal');
//Carrier signal generation
carrier=ac*cos(2*%pi*fc*t);
subplot(3,1,2);
plot(t,carrier);
xlabel('TIME');
ylabel('AMPLITUDE')
title('Carrier Signal');
ka=1/ac;
u=ka*am;
disp(u,'Modulation Index =')
//Modulation generation
am_mod=(1+ka.*msg).*carrier;
subplot(3,1,3);
plot(t,am_mod);
xlabel('TIME');
ylabel('AMPLITUDE')
title('Amplitude Modulated Signal');
// Frequency spectrum
d=(-p/2:1:p/2-1)*1/3;
figure(2);
subplot(3,1,1);
plot(d,abs(fftshift(fft(am_mod))));
xlabel('FREQUENCY');
ylabel('AMPLITUDE')
title('AM Signal Spectrum');
//Demodulation
demod=fm_mod.*carrier;
k=abs(fft(demod));
filt=[ones(1,4*fm),zeros(1,p-4*fm)];
out=k.*filt;
subplot(3,1,3);
plot(t,ifft(out));
xlabel('TIME');
ylabel('AMPLITUDE')
title('Demodulated message');