Aim
To implement and analyze frequency modulation (FM) using Python's NumPy and Matplotlib libraries.
Apparatus Required
- Software: Python with NumPy and Matplotlib libraries
- Hardware: Personal Computer
Theory
Amplitude Modulation (AM) is a method of transmitting information over a carrier wave by varying its amplitude in accordance with the instantaneous amplitude of the input signal (message signal). The frequency and phase of the carrier wave remain constant while its amplitude changes proportionally to the message signal.
Algorithm
- Initialize Parameters: Set the values for carrier frequency, message frequency, sampling frequency, and frequency deviation.
- Generate Time Axis: Create a time vector for the signal duration.
- Generate Message Signal: Define the message signal as a cosine wave.
- Compute the Integral of the Message Signal: Calculate the integral of the message signal over time.
- Generate AM Signal: Apply the AM modulation formula to obtain the modulated signal.
- Plot the Signals: Use Matplotlib to plot the message signal, carrier signal, and modulated signal.
Program
import numpy as np
import matplotlib.pyplot as plt
am = 4.2
fm = 368
ac = 8.4
fc = 3680
fs = 36800
beta = 3.3
t = np.arange(0, 2/fm, 1/fs)
m = am * np.cos(2 * np.pi * fm * t)
plt.subplot(3,1,1)
plt.plot(t, m)
plt.title("Message Signal (m(t))")
c = ac * np.cos(2 * np.pi * fc * t)
plt.subplot(3,1,2) # Changed to 3,1,2
plt.plot(t, c)
plt.title("Carrier Signal (c(t))")
am_signal = ac * (1 + m/ac) * np.cos(2 * np.pi * fc * t)
plt.subplot(3,1,3) # Changed to 3,1,3
plt.plot(t, am_signal)
plt.title("AM Signal")
plt.tight_layout()
plt.show()
Output Waveform

Tabular Column
Calculation
Result
The message signal, carrier signal, and frequency modulated (FM) signal will be displayed in separate plots. The modulated signal will show frequency variations corresponding to the amplitude of the message signal.