Skip to main content

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

Decoding

Modulation

  • BPSK

TODO

Polar code construction

Decoding

Modulation

  • Q-PSK
  • 4-QAM

License

MIT License

Metadata

Release files for python-polar-coding 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-polar-coding 0.0.1
File Size Uploaded
python-polar-coding-0.0.1.tar.gz 33.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-polar-coding 0.0.1
File Interpreter ABI Platform
python_polar_coding-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 92.8 kB

Release files / python-polar-coding-0.0.1.tar.gz

Download URL python-polar-coding-0.0.1.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8d94c00d1b5af468176bbe5c71231e283cae5bbc60f1df3306406766a674cccd
BLAKE2b-256 checksum
How to use checksums
68d3ec04d6e06eb95d431111b9add20c6b707e01f40240033f8788139ba9a6ef
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / python_polar_coding-0.0.1-py3-none-any.whl

Download URL python_polar_coding-0.0.1-py3-none-any.whl
Size 59.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2202156c995d4abf0ff8f2143543e4793ed5039ba2243fea11437afe367e8ad6
BLAKE2b-256 checksum
How to use checksums
fc62b666c7c702d71db3f373f015c31990e308aa3a5998e4346c22fe83c256fc
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page