Communication System File-2
Communication System File-2
subplot(3,1,1);
plot(t, mt, 'r');
xlabel('Time (s)');
ylabel('m(t)');
title('Message Signal m(t) = sin(2 * pi * fm * t)');
subplot(3,1,2);
plot(t, ct, 'g');
xlabel('Time (s)');
ylabel('c(t)');
title('Carrier Signal c(t) = sin(2 * pi * fc * t)');
subplot(3,1,3);
plot(t, am, 'b');
xlabel('Time (s)');
ylabel('AM Signal');
title('Amplitude Modulated (AM) Signal');
Q2. Plot the frequency modulation .
plot(t,Vfm,'m');
xlabel('time');
ylabel('amplitude');
title('frequency modulating');
clf;
clear all;
clc;
Am= 50;
fm= 10;
t=linspace(0,1,100);
m=Am*cos(2*%pi*fm*t);
subplot(2,1,1);
plot2d3(t,m);
xlabel('Time (s)');
ylabel('PAM Signal');
title('Pulse (AM) Signal');
Q4. Plot the PWM and PPM signal?
clc;
clf;
clear all;
fm =5
fc = 15
t = linspace(0,1,1000);
m = sin(2*%pi*fm*t);
c = sin(2*%pi*fc*t);
n = length(c)
pwm = zeros(1,n);
ppm = zeros(1,n);
for i = 1:n
if m(i)>c(i) then;
pwm(i) = 1;
elseif m(i) < c(i) then;
pwm(i) = 0;
end
end
for i = 1:n-1
if pwm(i) == 1 & pwm(i+1) == 0 then;
ppm(i) = 1;
end
end
subplot(411);
title("Messege");
plot(t,m);
subplot(412);
title("Carrier");
plot(t,c);
subplot(413);
title("PWM");
plot(t,pwm);
subplot(414);
title("ppm");
plot(t,ppm);
Q5. Plot the pulse code modulation signal.
subplot(3,1,2);
plot2d3(t, pcm_encode);
xlabel('Time (s)');
ylabel('PCM Code');
title('quantized');