MATLAB cod for Frequency Modulation
Aim: Write MATLAB code to get the Frequency modulation
Requirements: PC with MATLAB software
Program:
clc;
clear all;
close all;
fc=1000;
fs=10000;
f=200;
t=0:1/fs:((2/f)-(1/fs));
x=cos(2*pi*f*t);
kf=2*pi*(fc/fs)*(1/max(max(x)));
kf=kf*(f/fc);
opt=10*kf
y=modulate(x,fc,fs,'fm',opt);
subplot(3,1,1);
plot(x);
title('modulating signal');
subplot(3,1,2);
plot(y);
title('modulated fm signal');
x_recov=demod(y,fc,fs,'fm',opt);
subplot(3,1,3);
plot(x_recov);
title('original signal')
Output:
-
UpdatedFeb 05, 2020
-
Views1,512
You May Like
MATLAB code for Pulse position modulation
DSB-SC Amplitude Modulation program scilab-code
Single Side Band Suppressed Carrier (SSB - SC) - Modulation Scilab code using hilbert transform
MATLAB code for Pulse width modulation
DSB-SC Demodulation program scilab
MATLAB code for Double side band suppressed carrier