Polar coding implementation in Python
Project description
Python-polar-coding
A package for Polar codes simulation.
Installation
pip install python-polar-coding
Example
Here is a simple example of simulation using python_polar_coding
.
Binary messages encoded with Polar code, modulated using BPSK, transmitted over channel with AWGN and decoded using Fast SSC algorithm.
from python_polar_coding.channels import SimpleBPSKModulationAWGN
from python_polar_coding.polar_codes import FastSSCPolarCodec
from python_polar_coding.simulation.functions import (
compute_fails,
generate_binary_message,
)
N = 128
K = 64
design_snr = 2.0
messages = 10000
# SNR in [.0, .5, ..., 4.5, 5]
snr_range = [i / 2 for i in range(11)]
codec = FastSSCPolarCodec(N=N, K=K, design_snr=design_snr)
bpsk = SimpleBPSKModulationAWGN(fec_rate=K/N)
result_ber = dict()
result_fer = dict()
for snr in snr_range:
ber = 0
fer = 0
for _ in range(messages):
msg = generate_binary_message(size=K)
encoded = codec.encode(msg)
transmitted = bpsk.transmit(message=encoded, snr_db=snr)
decoded = codec.decode(transmitted)
bit_errors, frame_error = compute_fails(msg, decoded)
ber += bit_errors
fer += frame_error
result_ber[snr] = ber
result_fer[snr] = fer
Current progress
Polar code construction
- Arikan's Bhattacharyya bounds Section V.A
Decoding
Modulation
- BPSK
TODO
Polar code construction
- Arikan’s Monte-Carlo estimation Section V.B
- Trifonov’s Gaussian approximation Section V.D
Decoding
- SC STACK Decoding
- Fast SSC List Decoding
- Generalized Fast SSC LIST Decoding
- CRC-aided decoders
Modulation
- Q-PSK
- 4-QAM
License
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
python-polar-coding-0.0.1.tar.gz
(33.2 kB
view details)
Built Distribution
File details
Details for the file python-polar-coding-0.0.1.tar.gz
.
File metadata
- Download URL: python-polar-coding-0.0.1.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d94c00d1b5af468176bbe5c71231e283cae5bbc60f1df3306406766a674cccd |
|
MD5 | 56e50301cf23e3f85337f3367d84d13e |
|
BLAKE2b-256 | 68d3ec04d6e06eb95d431111b9add20c6b707e01f40240033f8788139ba9a6ef |
File details
Details for the file python_polar_coding-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: python_polar_coding-0.0.1-py3-none-any.whl
- Upload date:
- Size: 59.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2202156c995d4abf0ff8f2143543e4793ed5039ba2243fea11437afe367e8ad6 |
|
MD5 | 5661b1e91caa54fa39c3e37dceeecd3f |
|
BLAKE2b-256 | fc62b666c7c702d71db3f373f015c31990e308aa3a5998e4346c22fe83c256fc |