GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fr0mhell/python-polar-coding: A model of Polar encoder/decoder

BranchesTags
Open more actions menu

Latest commit

 

History

148 Commits
148 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
examples
examples
 
 
python_polar_coding
python_polar_coding
 
 
results
results
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.isort.cfg
.isort.cfg
 
 
.travis.yml
.travis.yml
 
 
Changelog.md
Changelog.md
 
 
LICENSE.txt
LICENSE.txt
 
 
MANIFEST.in
MANIFEST.in
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
pyproject.toml
pyproject.toml
 
 
python-publish.yml
python-publish.yml
 
 
requirements.in
requirements.in
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

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 = 0.0
messages = 1000
# 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()

print('Python polar coding simulation')
print(f'Simulating ({codec.N}, {codec.K}) systematic polar code with Design SNR {codec.design_snr} dB')
print()
print('\tSNR (dB)|\tBER\t|\tFER')

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 / (messages * codec.K)
    result_fer[snr] = fer / messages

    print(f'\t{snr}\t|\t{result_ber[snr]:.4f}\t|\t{result_fer[snr]:.4f}')

Current progress

Polar code construction

  • Arikan's Bhattacharyya bounds Section V.A

Decoding

  • SC Decoding
  • SC LIST Decoding
  • Fast SSC Decoding
  • RC SCAN Decoding
  • Generalized Fast SSC 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

MIT License

About

A model of Polar encoder/decoder

Topics

bpskdecodingpolarpolar-codessc-decodingsimulation

Resources

Readme
MIT license
Activity

Stars

11 stars

Watchers

1 watching

Forks

8 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.