Open In App

Frequency Modulation (FM) using MATLAB

Last Updated : 03 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Frequency modulation is the process of the changing of frequency of the carrier signal in accordance with the instantaneous value/frequency of the message signal.  The amplitude and phase of the signal are kept constant, but one can observe the fluctuations of frequency with respect to modulating signal. 

Any study is more effective when it is explained in a theoretical method in addition to its practical, Here you will learn theoretical as well as practical implementation on the MATLAB interface Which will make you more familiar with the concept of Frequency modulation

Starting with the theoretical method where we will discuss the derivation of the frequency modulation;

Advantages of frequency modulation

  1. The amplitude of the Frequency modulated wave doesn’t get affected.
  2. FM decreases the noise, Hence increasing in S/N ratio.
  3. Noise can also be decreased by an increase in frequency deviation.
  4. Reduces the interference by the adjacent channels through guard bands.
  5. It operates in a very high frequency.

Applications of FM

  1. used in video cassette recorders.
  2. used in Radio Broadcast and satellite TV
  3. used for audio frequency synthesis.

Derivation To show the frequency deviation

Fig 1 Handwritten derivation of Frequency Modulation

Now starting with the MATLAB INTERFACE first we will check the original signal and modulated signal. Using MATLAB helps you to take accurate readings. Here starts with the Code:

Code:

MATLAB




%Set the sampling frequency to 1kHz and carrier frequency to 200 Hz.
fs = 1000;
fc = 200; 
t = (0:1/fs:0.2)';
%Create two tone sinusoidal signal with frequencies 30 and 60 Hz.
x = sin(2*pi*30*t)+2*sin(2*pi*60*t);
%Set the frequency deviation to 50 Hz.
fDev = 50;
%Frequency modulate x.
y = fmmod(x,fc,fs,fDev);
%plot the graphs to show the original signal and modulated signal
subplot(2,1,1)
plot(t,x)
xlabel('Time(s)')
ylabel('Amplitude')
legend('original signal')
grid on;
subplot(2,1,2)
plot(t,y)
xlabel('Time(s)')
ylabel('Amplitude')
legend('modulated signal')
grid on;


Output:

Fig 2 Shows the original signal and modulated signal

Code:

Matlab




fs = 1000;
fc = 200; 
t = (0:1/fs:0.2)';
x = sin(2*pi*30*t)+2*sin(2*pi*60*t);
fDev = 50;
y = fmmod(x,fc,fs,fDev);
subplot(2,1,1);
plot(t,x);
xlabel('Time (s)')
ylabel('Amplitude')
legend('original signal')
grid on;
subplot(2,1,2);
plot(t,x,'r',t,y,'b-')
xlabel('Time (s)')
ylabel('Amplitude')
legend('Original Signal','Modulated Signal')


Output:

Fig 3 original signal and graph with both original and modulated signal

Brief explanation of terms used in the code 

  1. fs Sampling rate, fc Carrier frequency are the frequencies.
  2. fDev is the frequency deviation.
  3. t is the time division.
  4. y = Frequency modulate x.
  5. y = fmmod (x, Fc, Fs, freqdev) returns a frequency modulated (FM) signal y, given the input message signal x, where the carrier signal has frequency Fc and sampling rate Fs. freqdev is the frequency deviation of the modulated signal.
  6. Plot is used for plotting the graph between the two entities.
  7. Subplot is used to plot more than one graph on the same output screen for better comparison
  8. xlabel and ylabel commands are used for defining the axis.
  9. legend is used to define the contents of graph with different colors or lines.
  10. grid on displays the major grid lines for the current axes.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads