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)
- Clone or download this repository
- Navigate to the package directory
- 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 dBL(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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46be1ab3b12493d57d9d0a1a02fd240a6ac961f0381b13acbd1089e8f58c6098
|
|
| MD5 |
d29a0c5e5b44ce40232d276cb1204e2b
|
|
| BLAKE2b-256 |
e2d3279ecadbda560087135be01bd1f7374f65d44abb8c5c6b6111fcd4bead2d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ddf9be2fa76b49576020efda34d9afef0609c00ed92a6abd1de9c8c3ae6874d
|
|
| MD5 |
4356e054e7e3f62cc69db9a1f1f2fb5f
|
|
| BLAKE2b-256 |
c7d1f5a84b1c45275d3693e15aa45bacf335f6c2d7228ca09fa2294af4cb14a3
|