Skip to content

mohamed-munsif/speech-signal-modulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ก Speech Signal Modulation and Demodulation Project

Python Jupyter License Signal Processing Audio

๐ŸŽต Advanced Telecommunication System Implementation ๐ŸŽต

A complete Python-based communication system demonstrating amplitude modulation, quadrature components, and signal recovery techniques

Project Partner: Inshaf


๐ŸŒŸ Project Highlights

๐Ÿš€ Real-world Application: Simulates actual telecommunication systems
๐ŸŽ›๏ธ Multiple Modulation: Implements AM with quadrature components
๐Ÿ“Š Signal Analysis: Complete visualization and frequency domain analysis
๐Ÿ”„ Robust Recovery: Tests demodulation under various carrier conditions
๐Ÿ“ฑ Easy to Use: Interactive Jupyter notebook with step-by-step execution


๏ฟฝ Table of Contents


๐ŸŽฌ Quick Demo

Input โ†’ Processing โ†’ Output

๐ŸŽค Speech Files (ziad.wav, esoo.wav, mohey.wav)
    โ†“ [Resample to 250kHz]
๐Ÿ“ก Modulation [s(t) = xโ‚(t)cos(ฯ‰โ‚t) + xโ‚‚(t)cos(ฯ‰โ‚‚t) + xโ‚ƒ(t)sin(ฯ‰โ‚‚t)]
    โ†“ [Transmission Simulation]
๐Ÿ” Demodulation [Standard + Phase/Frequency Shifted]
    โ†“ [Low-Pass Filtering]
๐ŸŽต Recovered Audio Files (18 output variations)

Results You'll Get:

  • ๐Ÿ“ˆ Signal Plots: Time and frequency domain visualizations
  • ๐ŸŽต Audio Files: 18 processed audio outputs showing different recovery methods
  • ๐Ÿ“Š Analysis: Complete comparison of demodulation techniques
  • โšก Performance: Real-time processing and quality assessment

๏ฟฝ๐Ÿ“ก Overview

This project demonstrates speech signal modulation and demodulation techniques using Python. It implements a complete communication system that processes three audio files, modulates them using different carrier frequencies, transmits the combined signal, and then demodulates to recover the original signals.

๐ŸŽฏ Key Features

  • ๐ŸŽต Audio Processing: Resampling and preprocessing of speech signals
  • ๐Ÿ“ถ Signal Modulation: Amplitude modulation with quadrature components
  • ๐Ÿ”„ Multiple Demodulation: Standard, phase-shifted, and frequency-shifted recovery
  • ๐Ÿ“Š Visualization: Complete signal analysis and plotting
  • ๐Ÿ’พ Audio Generation: Output of processed audio files

๐Ÿš€ What This Project Does

  1. Input: Reads three speech audio files (.wav format)
  2. Processing: Resamples all signals to 250,000 Hz and equalizes lengths
  3. Modulation: Combines signals using the mathematical model below
  4. Transmission: Simulates transmission of the modulated signal
  5. Demodulation: Recovers original signals with various carrier configurations
  6. Output: Generates processed audio files for analysis

๐Ÿ”ง System Architecture

Block Diagram

System Components:

  • ๐ŸŽค Input Stage: Three speech signals ready for modulation
  • ๐Ÿ“ก Modulation Stage: Signals multiplied with carrier waves
  • โž• Combiner: All modulated signals summed to create s(t)
  • ๐Ÿ“ถ Transmission: Combined signal represents transmitted data
  • ๐Ÿ” Demodulation Stage: Signal recovery using coherent detection
  • ๐Ÿ”ฝ Low-Pass Filters (L.P.F): Remove high-frequency components
  • ๐ŸŽต Output Stage: Recovered speech signals

๐ŸŽ›๏ธ Demodulation Variations

  • Standard: Perfect carrier synchronization
  • Phase-shifted: Carriers with 10ยฐ, 30ยฐ, 90ยฐ phase offsets
  • Frequency-shifted: Carriers with 2 Hz, 10 Hz frequency offsets

๐Ÿ“ Mathematical Model

The core of this project is based on the following modulation equation:

s(t) = xโ‚(t)cos(ฯ‰โ‚t) + xโ‚‚(t)cos(ฯ‰โ‚‚t) + xโ‚ƒ(t)sin(ฯ‰โ‚‚t)

Where:

  • s(t) โ†’ Composite modulated signal (transmitted)
  • xโ‚(t), xโ‚‚(t), xโ‚ƒ(t) โ†’ Input speech signals (ziad.wav, esoo.wav, mohey.wav)
  • ฯ‰โ‚, ฯ‰โ‚‚ โ†’ Carrier frequencies
  • cos(ฯ‰โ‚t), cos(ฯ‰โ‚‚t) โ†’ Cosine carriers for signals 1 and 2
  • sin(ฯ‰โ‚‚t) โ†’ Sine carrier for signal 3 (quadrature component)

โš™๏ธ Technical Specifications

  • ๐Ÿ“ก Modulation: Amplitude Modulation (AM) with Quadrature Components
  • ๐Ÿ”Š Sampling Rate: 250,000 Hz
  • ๐ŸŽ›๏ธ Filter Type: Butterworth Low-Pass Filter
  • ๐Ÿ“ Carrier Types: Cosine and Sine waves
  • ๐Ÿ”„ Processing: Real-time signal visualization and analysis

Project Structure

โ”œโ”€โ”€ project.ipynb          # Main Jupyter notebook
โ”œโ”€โ”€ signals/               # Input audio files
โ”‚   โ”œโ”€โ”€ esoo.wav
โ”‚   โ”œโ”€โ”€ mohey.wav
โ”‚   โ””โ”€โ”€ ziad.wav
โ”œโ”€โ”€ output_signals/        # Generated output files
โ”‚   โ”œโ”€โ”€ Out_1.wav
โ”‚   โ”œโ”€โ”€ Out_1_phase_10.wav
โ”‚   โ”œโ”€โ”€ Out_1_phase_30.wav
โ”‚   โ”œโ”€โ”€ Out_1_phase_90.wav
โ”‚   โ”œโ”€โ”€ Out_1_shift_2.wav
โ”‚   โ”œโ”€โ”€ Out_1_shift_10.wav
โ”‚   โ””โ”€โ”€ ... (similar files for signals 2 and 3)
โ”œโ”€โ”€ images/                # Documentation images
โ”‚   โ””โ”€โ”€ Block diagram.png
โ””โ”€โ”€ requirements.txt       # Python dependencies

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.7+
  • Jupyter Notebook or JupyterLab

๐Ÿ“ฅ Installation

  1. Clone the repository:

    git clone https://github.com/mohamed-munsif/speech-signal-modulation.git
    cd speech-signal-modulation
  2. Install dependencies:

    pip install -r requirements.txt

๐ŸŽฎ Usage

  1. Prepare Input: Place your .wav audio files in the signals/ folder
  2. Run Analysis: Open project.ipynb and execute all cells
  3. View Results: Check output_signals/ for generated files
  4. Analyze: Review plots and audio outputs

๐Ÿ“Š Input & Output Files

๐Ÿ“ฅ Input Files (signals/ folder)

  • ziad.wav โ†’ Speech signal 1 (modulated with cos(ฯ‰โ‚t))
  • esoo.wav โ†’ Speech signal 2 (modulated with cos(ฯ‰โ‚‚t))
  • mohey.wav โ†’ Speech signal 3 (modulated with sin(ฯ‰โ‚‚t))

๐Ÿ“ค Output Files (output_signals/ folder)

  • Out_X.wav โ†’ Standard demodulated signals
  • Out_X_phase_Y.wav โ†’ Phase-shifted demodulated signals (Y = 10ยฐ, 30ยฐ, 90ยฐ)
  • Out_X_shift_Y.wav โ†’ Frequency-shifted demodulated signals (Y = 2Hz, 10Hz)

Where X = 1, 2, 3 corresponding to the three input signals

๐Ÿ› ๏ธ Dependencies & Tools

Core Libraries

  • numpy โ†’ Numerical computations and array operations
  • scipy โ†’ Signal processing and filtering
  • librosa โ†’ Audio processing and resampling
  • soundfile โ†’ Audio file I/O operations
  • matplotlib โ†’ Signal plotting and visualization
  • ipython โ†’ Interactive Python environment

Installation

All dependencies are listed in requirements.txt for easy installation.

๐Ÿค Contributing

Feel free to submit issues and enhancement requests!

๐Ÿ“ž Contact

For questions about this telecommunication project, feel free to reach out!

About

Speech Signal Modulation and Demodulation Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors