Skip to main content

Communication Lab utilities for signal processing and noise addition

Project description

CommLab - Communication Laboratory Utilities

A Python package providing utility functions for communication systems experiments and simulations.

Features

  • AWGN Noise Addition: Add Additive White Gaussian Noise to signals with specified SNR
  • Supports both real and complex-valued signals
  • Works with multi-dimensional arrays
  • Easy to use and extend

Installation

From source (Development mode)

  1. Clone or download this repository
  2. Navigate to the package directory
  3. Install in editable mode:
pip install -e .

This allows you to modify the source code and see changes immediately without reinstalling.

Usage

Basic Example

import numpy as np
from commlab import awgn

# Create a simple BPSK signal
signal = np.array([1, -1, 1, -1, 1, -1])

# Add AWGN with SNR = 10 dB
noisy_signal = awgn(signal, SNRdb=10)

QPSK Example

import numpy as np
from commlab import awgn

# Create QPSK symbols
qpsk_symbols = np.array([1+1j, -1+1j, -1-1j, 1-1j]) / np.sqrt(2)

# Add noise with 15 dB SNR
noisy_qpsk = awgn(qpsk_symbols, SNRdb=15)

With Oversampling

import numpy as np
from commlab import awgn

# Oversampled signal (4 samples per symbol)
oversampled_signal = np.repeat([1, -1, 1, -1], 4)

# Add noise (L=4 for 4 samples per symbol)
noisy_signal = awgn(oversampled_signal, SNRdb=10, L=4)

Function Reference

awgn(s, SNRdb, L=1)

Add Additive White Gaussian Noise to a signal.

Parameters:

  • s (array_like): Input signal (real or complex)
  • SNRdb (float): Signal-to-Noise Ratio in dB
  • L (int, optional): Samples per symbol (default=1)

Returns:

  • r (ndarray): Noisy signal

Requirements

  • Python >= 3.7
  • NumPy >= 1.20.0

Future Extensions

This package is designed to be easily extensible. Future versions may include:

  • Modulation schemes (BPSK, QPSK, QAM)
  • Demodulation functions
  • BER calculation utilities
  • Eye diagram plotting
  • Channel models

License

MIT License

Contributing

Feel free to add more functions as needed for your communication lab experiments!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commlab-0.3.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commlab-0.3.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file commlab-0.3.0.tar.gz.

File metadata

  • Download URL: commlab-0.3.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for commlab-0.3.0.tar.gz
Algorithm Hash digest
SHA256 46be1ab3b12493d57d9d0a1a02fd240a6ac961f0381b13acbd1089e8f58c6098
MD5 d29a0c5e5b44ce40232d276cb1204e2b
BLAKE2b-256 e2d3279ecadbda560087135be01bd1f7374f65d44abb8c5c6b6111fcd4bead2d

See more details on using hashes here.

File details

Details for the file commlab-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: commlab-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for commlab-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ddf9be2fa76b49576020efda34d9afef0609c00ed92a6abd1de9c8c3ae6874d
MD5 4356e054e7e3f62cc69db9a1f1f2fb5f
BLAKE2b-256 c7d1f5a84b1c45275d3693e15aa45bacf335f6c2d7228ca09fa2294af4cb14a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page