Skip to content

About

Design and implement an AM (Amplitude Modulation) communication system DSB-LC / DSB-SC

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

AM Radio System Project

A Python implementation of an AM (Amplitude Modulation) communication system, exploring DSB-LC and DSB-SC modulation, modulation index effects, and demodulation techniques.

Cairo University — Faculty of Engineering, Computer Engineering Department Course: Communications Engineering (EECG227)


Project Structure

.
├── src/
│   └── voice-sample.wav        # Input audio file (mono WAV, 5–10 seconds)
├── outs/                       # Generated plots (auto-created on run)
├── part1_modulation.py
├── part2_modulation_index.py
├── part3_envelope_detector.py
├── part4_coherent.py
└── README.md

Parts Overview

Part 1 — DSB-LC vs. DSB-SC Implementation (part1_modulation.py)

Implements both DSB-SC and DSB-LC modulation on a real voice signal resampled to 1 MHz, bandlimited to 4 kHz, with a 100 kHz carrier.

  • Tests three modulation indices for DSB-LC: μ = 0.5, 0.8, 1.0
  • Plots time-domain waveforms with envelope overlay
  • Plots frequency-domain magnitude spectra (dB scale)
  • Measures 99% power bandwidth for all configurations

Output files: outs/part1_time_domain.png, outs/part1_frequency_domain.png

Key result: All configurations share ~8 kHz bandwidth (= 2 × message bandwidth). DSB-LC shows a discrete carrier spike at f_c; DSB-SC does not.


Part 2 — Modulation Index Effects (part2_modulation_index.py)

Studies the effect of μ using a two-tone message signal m(t) = cos(2π·500t) + cos(2π·1200t).

  • Tests μ = 0.3, 0.5, 0.8, 1.0, 1.2
  • Computes power efficiency: η = Pm / (Ac² + Pm) × 100%
  • Highlights overmodulation (μ > 1) with shaded regions

Output files:

  • outs/part2_fig1_time_domain_all_mu.png — all five waveforms
  • outs/part2_fig2_waveforms_subset.png — μ = 0.5, 1.0, 1.2 side-by-side
  • outs/part2_fig3_efficiency_vs_mu.png — efficiency vs. modulation index curve
μ Ac η (%) Status
0.3 3.33 2.2% Normal
0.5 2.00 5.9% Normal
0.8 1.25 13.8% Normal (recommended)
1.0 1.00 20.0% Critical
1.2 0.83 26.5% Overmodulated

Part 3 — Envelope Detector Design (part3_envelope_detector.py)

Implements an envelope detector for DSB-LC (μ = 0.8):

  1. Rectify: |s(t)|
  2. Low-pass filter to remove carrier ripple
  3. DC removal (subtract mean)
  • Compares three LPF cutoff frequencies: 1 kHz (too low), 15 kHz (optimal), 150 kHz (too high)
  • Demonstrates why envelope detection fails on DSB-SC

Output files:

  • outs/part3_fig1_optimal.png — demodulated vs. original (15 kHz LPF)
  • outs/part3_fig2_cutoff_comparison.png — effect of cutoff frequency
  • outs/part3_fig3_dsbsc_fails.png — DSB-LC success vs. DSB-SC failure

Part 4 — Coherent (Synchronous) Demodulation (part4_coherent.py)

Implements coherent detection for both DSB-SC and DSB-LC:

  1. Multiply by 2·cos(2πf_c t)
  2. Low-pass filter
  3. DC removal (for DSB-LC only)

Compares coherent and envelope detector performance using MSE.

Output files:

  • outs/part4_fig1_coherent_sc_lc.png — coherent demodulation for both schemes
  • outs/part4_fig2_coherent_vs_envelope.png — coherent vs. envelope detector
Detector MSE
Coherent (DSB-SC) ~0.000003
Coherent (DSB-LC) ~0.000007
Envelope (DSB-LC, 8 kHz) ~0.001044

Requirements

numpy
scipy
matplotlib

Install with:

pip install numpy scipy matplotlib

Running the Code

Place your audio file at src/voice-sample.wav (mono WAV, 5–10 seconds), then run each part independently:

python part1_modulation.py
python part2_modulation_index.py
python part3_envelope_detector.py
python part4_coherent.py

Plots are saved automatically to the outs/ directory.


System Parameters

Parameter Value
Carrier frequency 100 kHz
Message bandwidth 4 kHz
Sample rate (P1) 1 MHz
Sample rate (P2–4) 500 kHz
Modulation index μ = 0.8 (default)

About

Design and implement an AM (Amplitude Modulation) communication system DSB-LC / DSB-SC

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages