Header Ads

Header ADS

Frequency Modulation (FM) Using MATLAB


1. To understand the basic theory of frequency modulation(FM)
2. To understand the waveform and frequency spectrum of frequency modulation (FM) using Matlab.



Code:

clc;
clear all;
close all;



%% User Define
t=input('Enter the value of Time Period:');
vc=input('Enter the value of Amplitude of carrier:');
vm=input('Enter the value of Amplitude of message:');
fc=input('Enter the value of Frequency of carrier:');
fm=input('Enter the value of Frequency of message:');
m=input('Modulation Index:');
f=input ('Any instant frequency:');

%% FM MODULATION

wc=2*pi*fc;
wm=2*pi*fm;
sc_t=vc*cos(wc*t);
sm_t=vm*cos(wm*t);
s_fm=vc*cos((wc*t)+m*sin(wm*t));
vf=abs(fft(s_fm,10^4))/5000;
figure;
plot(t,s_fm);
hold on;
plot(t,sm_t,'r');
axis([0 0.01 -1.5 1.5]);
xlabel('time(second)');
ylabel('amplitude');
title('FM time-domain');
grid on;

figure;
plot(f,vf);
axis([0 10^4 0 0.4]);
xlabel('frequency');
ylabel('amplitude');
title('FM frequency-domain');
grid on;
figure;
plot(t,sm_t);
axis([0 0.1 -1.5 1.5]);
title('FM modulation signal');
Enter the value of Time Period:0:0.00001:0.1
Enter the value of Amplitude of carrier:1
Enter the value of Amplitude of message:1
Enter the value of Frequency of carrier:5000
Enter the value of Frequency of message:250
Modulation Index:10
Any instant frequency:0:10:99990
>>









clc;
clear all;
close all;



%% User Define
t=input('Enter the value of Time Period:');
vc=input('Enter the value of Amplitude of carrier:');
vm=input('Enter the value of Amplitude of message:');
fc=input('Enter the value of Frequency of carrier:');
fm=input('Enter the value of Frequency of message:');
m=input('Modulation Index:');
f=input ('Any instant frequency:');

%% FM MODULATION

wc=2*pi*fc;
wm=2*pi*fm;
sc_t=vc*cos(wc*t);
sm_t=vm*cos(wm*t);
s_fm=vc*cos((wc*t)+m*sin(wm*t));
vf=abs(fft(s_fm,10^4))/5000;
figure;
plot(t,s_fm);
hold on;
plot(t,sm_t,'r');
axis([0 0.1 -1.5 1.5]);
xlabel('time(second)');
ylabel('amplitude');
title('FM time-domain');
grid on;

figure;
plot(f,vf);
axis([0 10^4 0 0.4]);
xlabel('frequency');
ylabel('amplitude');
title('FM frequency-domain');
grid on;
figure;
plot(t,sm_t);
axis([0 0.1 -1.5 1.5]);
title('FM modulation signal');

Enter the value of Time Period:0:0.00001:0.1
Enter the value of Amplitude of carrier:1
Enter the value of Amplitude of message:1
Enter the value of Frequency of carrier:30
Enter the value of Frequency of message:10
Modulation Index:10
Any instant frequency:0:10:99990
>>


We know about frequency modulation(FM) by using MATLAB. We know about frequency modulation then first define time period , Amplitude of carrier, Amplitude of message, frequency of carrier ,frequency of message. Here the frequency used in message signal should be less than the carrier frequency likewise amplitude signal should be less than carrier amplitude.

1 comment:

  1. Pragmatic Play william hill【VIP】tips,casino site free
    Pragmatic Play william クイーンカジノ hill【VIP】tips,casino site free demo games free play william hill demo machines casino,online slots machines Pragmatic Play 12bet free demo game demo machine

    ReplyDelete

Powered by Blogger.