Documente Academic
Documente Profesional
Documente Cultură
16BEE0153
C2+TC2
EXPERIMENT-7
FREQUENCY AND PHASE
MODULATION- DEMODULATION
Apparatus: MATLAB
MATLAB Code:
Frequency Modulation – Demodulation
clc;
clear all;
close all;
N=100;
tmax=2;
dt=tmax/(N-1);
t=0:dt:tmax;
fs=1/dt;
ac=2;
am=1;
fc=3;
wc=2*pi*fc;
xc=cos(wc*t);
fm=1;
wm=2*pi*fm;
xm=am*cos(wm*t);
kf=10;
xmi=cumsum(xm)*dt;
xfm=ac*cos(wc*t+kf*xmi);
dxfm=diff(xfm)/dt;
subplot(4,1,1);plot(xm); xlabel(‘Time’); ylabel(‘Amplitude’);
title(‘Message Signal’);
subplot(4,1,2);plot(xc); xlabel(‘Time’); ylabel(‘Amplitude’);
title(‘Carrier Signal’);
subplot(4,1,3);plot(xfm); xlabel(‘Time’); ylabel(‘Amplitude’);
title(‘ Frequency Modulated Signal’);
subplot(4,1,4);plot(dxfm); xlabel(‘Time’); ylabel(‘Amplitude’);
title(‘Frequency Demodulated Signal’);
Phase Modulation – Demodulation
MATLAB code:
clc;
clear all;
N=2000;
tmax=20;
dt=tmax/(N-1);
t=0;dt;tmax;
fs=1/dt;
Ac=2;
Am=1;
fc=3;
wc=2*pi*fm;
xc=cos(wc*t);
fm=0.2;
wm=2*pi*fm;
xm=Am*sin(wm*t);
kp=10;
xpm=Ac*sin(wc*t+kp*xm);
theta=pi/3;
xc=cos(wc*t+theta);
xs=sin(wc*t+theta);
I=xpm.*xc;
Q=xpm.*xs;
d=-1*atan2(Q,I);
xd=unwrap(d);
subplot(4,1,1);
plot(xm);
xlabel(‘time’);ylabel(‘amplitude’);title(‘message signal’);
subplot(4,1,2);
plot(xc);
xlabel(‘time’);ylabel(‘amplitude’);title(‘carrier signal’);
subplot(4,1,3);
plot(xpm);
xlabel(‘time’);ylabel(‘amplitude’);title(‘phase modulated signal’);
subplot(4,1,4);
plot(xd);
xlabel(‘time’);ylabel(‘amplitude’);title(‘phase demodulated signal’);
Inference: In FM, a radio wave known as the "carrier wave" is modulated in frequency by the
signal that is to be transmitted. The amplitude and phase remain the same.
In PM, a radio wave known as the "carrier wave" is modulated in phase by the signal that is to be
transmitted. The frequency and amplitude remain the same.
Gaurav Sharma
16BEE0153
C2+TC2
Experiment 8
AMPLITUDE, FREQUENCY AND PHASE
MODULATION – DEMODULATION WITH NOISE
Apparatus: MATLAB
MATLAB Code:
AM with noise-
clc;
clear all;
close all;
t=linspace(0,0.02,10000); fc=5000; fm=200; fs=40000;
Am=5; Ac=10;
m= Am/Ac;
wc =2*pi*fc; wm=2*pi*fm;
em = Am*sin(wm*t); ec = Ac*sin(wc*t);
y = Ac*(1+m*sin(wm*t).*sin(wc*t));
z=awgn(y,20);
d = amdemod(y,fc,fs,30);
l=10000;
subplot (5,1,1); plot(t,em); xlabel('Time'); ylabel('Amplitude');
title('Message signal');
subplot(5,1,2); plot(t,ec); xlabel('Time'); ylabel('Amplitude'); title('Carrier signal');
subplot(5,1,3); plot(t,y); xlabel('Time'); ylabel('Amplitude');
title('Amplitude modulated signal');
subplot(5,1,4); plot(t,d); xlabel('Time'); ylabel('Amplitude');
title('Amplitude demodulated signal');
subplot(5,1,5); plot(t,z); xlabel('Time'); ylabel('Amplitude');
title('Amplitude modulated signal with noise');
FM with Noise-
clc;
clear all;
close all;
N=100;
tmax=2;
dt=tmax/(N-1);
t=0:dt:tmax;
fs=1/dt;
ac=2;
am=1;
fc=3;
wc=2*pi*fc;
xc=cos(wc*t);
fm=1;
wm=2*pi*fm;
xm=am*cos(wm*t);
kf=10;
xmi=cumsum(xm)*dt;
xfm=ac*cos(wc*t+kf*xmi);
y=awgn(xfm,20);
dxfm=diff(xfm)/dt;
subplot(5,1,1);plot(xm); xlabel('Time'); ylabel('Amplitude');
title('Message Signal');
subplot(5,1,2);plot(xc); xlabel('Time'); ylabel('Amplitude');
title('Carrier Signal');
subplot(5,1,3);plot(xfm); xlabel('Time'); ylabel('Amplitude');
title('Frequency Modulated Signal');
subplot(5,1,4);plot(dxfm); xlabel('Time'); ylabel('Amplitude');
title('Frequency Demodulated Signal');
subplot(5,1,5);plot(y); xlabel('Time'); ylabel('Amplitude'); title('Frequency modulated Signalwith
noise');
PM with Noise-
clc;
clear all;
N=2000;
tmax=20;
dt=tmax/(N-1);
t=0:dt:tmax;
fs=1/dt;
Ac=2;
Am=1;
fc=3;fm=1;
wc=2*pi*fm;
xc=cos(wc*t);
fm=0.2;
wm=2*pi*fm;
xm=Am*sin(wm*t);
kp=10;
xpm=Ac*sin(wc*t+kp*xm);
y=awgn(xpm,20);
theta=pi/3;
xc=cos(wc*t+theta);
xs=sin(wc*t+theta);
I=xpm.*xc;
Q=xpm.*xs;
d=-1*atan2(Q,I);
xd=unwrap(d);
subplot(5,1,1);
plot(xm)
xlabel('time');ylabel('amplitude');title('message signal');
subplot(5,1,2);
plot(xc)
xlabel('time');ylabel('amplitude');title('carrier signal');
subplot(5,1,3);
plot(xpm)
xlabel('time');ylabel('amplitude');title('phase modulated signal');
subplot(5,1,4);
plot(xd)
xlabel('time');ylabel('amplitude');title('phase demodulated signal');
subplot(5,1,5);
plot(y)
xlabel('time');ylabel('amplitude');
title('phase modulated signal with noise');
AM with Noise:
FM with Noise:
PM with Noise:
Inference: Signal-to-noise ratio (abbreviated SNR or S/N) is a measure used in science and
engineering that compares the level of a desired signal to the level of background noise. SNR is
defined as the ratio of signal power to the noise power, often expressed in decibels. A ratio
higher than 1:1 (greater than 0 dB) indicates more signal than noise. Higher the SNR, better is
the signal quality.
Gaurav Sharma
16BEE0153
C2+TC2
Experiment 9
Single side band (SSB) modulation – demodulation
Software used:
MATLAB
MATLAB Code
Result
Single side band (SSB) modulation – demodulation has been performed successfully.
Inference
In radio communications, single-sideband modulation (SSB) or single-sideband suppressed-carrier
modulation (SSB-SC) is a type of modulation, used to transmit information, such as an audio signal,
by radio waves.