Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked fromxukmin/viterbi

A Convolutional Encoder and Viterbi Decoder in Python/C++.

License

NotificationsYou must be signed in to change notification settings

clysto/viterbi

 
 

Repository files navigation

LicenseVersionPyPI - Python VersionPyPI - Downloads

This project is a fork ofhttps://github.com/xukmin/viterbi that introduces Python support, enabling effortless utilization of the Viterbi module within the Python environment.

Install

pip install viterbi

Usage

The following is a convolutional encoder with a constraint length of 7. The diagram indicates the binary values and polynomial form, indicating the left-most bit is the most-significant-bit (MSB). The generating polynomials are 1011011 and 1111001 can be alternatively expressed in octal as 133 and 171, respectively.

convolutional encoder

Expressed in code as:

fromviterbiimportViterbidot11a_codec=Viterbi(7, [0o133,0o171])

You can use the viterbi decoder like this:

fromviterbiimportViterbidot11a_codec=Viterbi(7, [0o133,0o171])bits= [0,1,0,1,0,0,0,0,1,1,1,0]output=dot11a_codec.encode(bits)# [0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1]dot11a_codec.decode(output)# [0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0]

Puncturing

This library also allows you to puncture the original encoded data by specifying a puncture pattern or decode data that has already been punctured.

fromviterbiimportViterbi# Puncture Pattern: [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]dot11a_codec=Viterbi(7, [0o133,0o171], [1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1])

Using in C++

You can find the way to use the Viterbi decoder in C++ in theREADME of the original project.

About

A Convolutional Encoder and Viterbi Decoder in Python/C++.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++83.0%
  • Python13.2%
  • Makefile3.8%

[8]ページ先頭

©2009-2025 Movatter.jp