Giter VIP home page Giter VIP logo

polar-codes's Introduction

Polar codes

This repository is devoted to the Python implementation of Polar codes.

Motivation

When I faced the need to use Polar codes in my Master's thesis, I hadn't found any open-source Python implementation (but now I there are some of them). That was quite a surprise since I just wanted to download a library and start my research.
Hence, it took me to implement Polar codes myself. Now, I want to help anybody who will further have a need in Python implementation and I start this project. This is my first open-source project, I don't have too much experience, but hope it will go well. Comments, remarks and pull requests are welcome!

What is inside

Currently this repository is work-in-progress. In particular, the following funcionalty is implemented, but comments are still are to be written and some features shall be tested.

  • Polar code — a principal class which is responsible for encoding and decoding. It has the following public methods.
    • construct — Polar codes are channel-dependent and thus they can be constructed in many ways. This class will have the following construction methods.
      • PW — a construction method which arranges virtual channels according to their polar weights (PW stands for Polar Weights).
      • IBEC — a construction method which arranges polar transformed Binary Erasure Channels (BEC) according to their Bhattacharya Z-parameter. The erasure probability of BECs is set to 0.5 (IBEC stands for Independent Binary Erasure Channel construction).
      • DBEC — a construction method which arranges polar transformed Binary Erasure Channels (BEC) according to their Bhattacharya Z-parameter. The erasure probability of BECs is chosen such that initial channel has the same capacity as the virtual BEC (DBEC stands for Dependent Binary Erasure Channel construction).
    • encode — implements encoding algorithm which complements informational bits with frozen ones and applies a polar transform to the resulting codeword.
    • decode — up to now there are several decoders proposed for Polar codes which have different computational efficiency and error-correction ability. This method simply call a specified decoder
      • Slow Successive Cancellation (SSC) — a simple successive-cancellation decoder initially proposed by Arikan. It employs no optimization and thus has O(N^2) complexity.
      • Fast Successive Cancellation (FSC) — an advanced version of successive cancellation decoder, also proposed by Arikan, has O(NlogN) complexity.
      • Tal-Vardy (TVD) — an implementation of SC decoder from Tal-Vardy paper. Was added to get used to Tal-Vardy notion.
      • List decoder + CRC (SCL) — a list version of SC decoder proposed by Tal-Vardy. Its efficiency increases with list size. Moreover, if a CRC was added to an initial codeword it may be used just like in Tal-Vardy's paper. Thorough testing is required!
  • Channel — Polar codes are channel-specific codes and I decided to pass to each instance of Polar code an instance of underlying channel. A "Channel" is an abstract class forcing all its derivatives to implement several methods.
  • BscChannel — an implementation of Channel methods for case of Binary Symmetric Channel (BSC).
  • BpskAwgnChannel — an implemetation of Chanel methods for case of AWGN channel combined with BPSK.

All algorithms are based on papers, references to them will be added further.

How to use

The package itself is located in "polar_codes" directory. Thus, you may copy it and then import a PolarCode class as follows.

from polar_codes.polar_code import PolarCode

Probaly, it is not as pretty as one may want and I will fix it further.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.