Skip to content

SURYAP2006/DSB-using-NumPy-and-Matplotlib-

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

DSB-SC Modulation and Demodulation using NumPy and Matplotlib

Aim:

To implement and analyze Double Sideband Suppressed Carrier (DSB-SC) modulation using Python's NumPy and Matplotlib libraries.

Apparatus Required:

Software: Python with NumPy and Matplotlib libraries Hardware: Personal Computer

Theory:

Double Sideband Suppressed Carrier (DSB-SC) modulation is a type of amplitude modulation where the carrier is completely suppressed, and only the upper and lower sidebands are transmitted. The modulated signal is generated by multiplying the message signal with the carrier signal. Since the carrier is absent, DSB-SC is more power-efficient than conventional AM.

Algorithm:

Initialize Parameters: Set message frequency, carrier frequency, amplitudes, and sampling frequency.

Generate Time Axis: Create a time vector for the duration of the signal.

Generate Message Signal: Create a cosine wave representing the message signal.

Generate Carrier Signal: Create a cosine wave representing the carrier signal.

Modulate Signal (DSB-SC): Multiply the message signal with the carrier signal.

Plot the Signals: Display message signal, carrier signal, and DSB-SC modulated signal using Matplotlib.

Program :

import numpy as np
import matplotlib.pyplot as plt

# Given parameters
Am = 15.1       # Message amplitude
fm = 540        # Message frequency (Hz)
Ac = 30.2       # Carrier amplitude
fc = 5400       # Carrier frequency (Hz)
fs = 100000     # High sampling rate for clean plots
t = np.arange(0, 0.01, 1/fs)  # 10 ms duration

# Message signal
msg = Am * np.cos(2 * np.pi * fm * t)

# Carrier signal
carrier = Ac * np.cos(2 * np.pi * fc * t)

# DSB-SC modulated signal
dsb_sc = msg * carrier

# Plotting
plt.figure(figsize=(12, 9))

# Message
plt.subplot(3, 1, 1)
plt.plot(t, msg, linewidth=1)
plt.title("Message Signal (540 Hz)")
plt.xlabel("Time (s)")
plt.ylabel("Amplitude")
plt.grid(True)
plt.xlim(0, 0.005)   # zoom for clarity

# Carrier
plt.subplot(3, 1, 2)
plt.plot(t, carrier, linewidth=1)
plt.title("Carrier Signal (5400 Hz)")
plt.xlabel("Time (s)")
plt.ylabel("Amplitude")
plt.grid(True)
plt.xlim(0, 0.002)   # zoom for clarity

# DSB-SC
plt.subplot(3, 1, 3)
plt.plot(t, dsb_sc, linewidth=1)
plt.title("DSB-SC Modulated Signal")
plt.xlabel("Time (s)")
plt.ylabel("Amplitude")
plt.grid(True)
plt.xlim(0, 0.005)

plt.tight_layout()
plt.show()

Output graph:

exp8 graph

Result:

The Double Sideband Suppressed Carrier (DSB-SC) modulation was successfully implemented using Python (NumPy and Matplotlib).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published