Skip to main content

FT8 Decoding and Encoding in Python with test/loopback code

Project description

FT8 Decoding and Encoding in Python with test/loopback code

I've changed the scope of this repo from the previous 'codec with integrated GUI' as it started to grow too wide in scope. The last version including the GUI is in release 6.4.0. This repo is now moving towards a packageable FT8 codec.

Below are some screenshots from test programs that can be used to look at how the protocols actually work, illustrated with a fairly ordinary waterfall and some zoomed-in depictions of captured signals with an overlay of the syncrhonisation tones that are used to search for the signals (Costas patterns).

waterfall candidate detail

Approach

You won't find many comments in the code; I try to make things as obvious as possible via variable names and logical structure, to minimise the need for comments. Also - this is mainly my plaything, and I find bloated, sprawling code incredibly difficult to read, so I like to keep things very compact so that I can see the bigger picture. If you find an if-then-else spanning several paragraphs, it's probably a mistake.

Do feel free to get in touch and ask how anything works. I might add some diagrams etc at some point too - especially if I find an approach that seems to offer something improved and/or very compact (I'm very pleased for e.g. that the entire candidate search, synch, and demodulate process all works by refering to a single time-frequency grid; read the audio, FFT 5 times for each symbol duration, store it, and that's used for everything that follows.)

Limitations

In pursuit of tight code, I've concentrated on core standard messages, leaving out some of the less-used features. The receive part of the code doesn't (yet) have the full capability of the advanced decoders used in WSJT-x, and so gets only about 50% of the decodes that WSJT-x gets.

Here's my current understanding of the differences:

Step PyFT8 WSJT-X
Find candidate signals Search every possible time/frequency offset for match with the Costas pattern, excluding times where candidates would not complete before the next cycle (i.e. first few seconds of the grid) TBD
Syncronise signals in time See above TBD
Use of FFTs for the above A single time-frequency grid with 5 time samples per symbol and 3 frequency samples per tone Several FFTs per operation, details in VK3JPK's great write-up here
Demodulation Extract 1 sample per symbol, 1 sample per tone grid. Correlate each symbol with Gray code to create Log Likelyhood Ratios for each bit. Noncoherent block detection over 3 symbols - creates LLRs by correlating the 512 possible tone sequences (3 symbols with 8 possible tones each) with the actual received symbols. This is done in the frequency domain by combining the whole-symbol correlations already calculated.
Decoding the FEC code Belief Propagation LDPC decoder Belief Propagation LDPC decoder
Further decoding if LDPC fails None Ordered Statistics Decoding
Further signal extraction None Subtraction of the idealised power of the decoded signals, then rescanning the residual spectrum. Further synchronisation adjustments TBC

Acknowledgements

This project implements a decoder for the FT8 digital mode. FT8 was developed by Joe Taylor, K1JT, Steve Franke, K9AN, and others as part of the WSJT-X project. Protocol details are based on information publicly described by the WSJT-X authors and in related open documentation.

Some constants and tables (e.g. Costas synchronization sequence, LDPC structure, message packing scheme) are derived from the publicly available WSJT-X source code and FT8 protocol descriptions. Original WSJT-X source is © the WSJT Development Group and distributed under the GNU General Public License v3 (GPL-3.0), hence the use of GPL-3.0 in this repository.

Also thanks to Robert Morris for:

  • basicft8(*1) - the first code I properly read when I was wondering whether to start this journey
  • weakmon - much good information

(*1 note: applies to FT8 pre V2)

Other useful resources:

<script data-goatcounter="https://g1ojs-github.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyft8-0.0.3.tar.gz (362.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyft8-0.0.3-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file pyft8-0.0.3.tar.gz.

File metadata

  • Download URL: pyft8-0.0.3.tar.gz
  • Upload date:
  • Size: 362.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pyft8-0.0.3.tar.gz
Algorithm Hash digest
SHA256 89c9258172241224e25097ac62d6556b15650161117b778a4a7a265e6dab70fc
MD5 7fdefcb9e1ad444b8ab614b670173e0e
BLAKE2b-256 f70c93a9a1f6be0c7e40d545182ef050fe30d1a56ed32e40f7862efeb81c5a71

See more details on using hashes here.

File details

Details for the file pyft8-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyft8-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pyft8-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6a2822a466be41a9c29dc07630030c566e92c75b222ae61c45453ce7655aaa
MD5 ef1d6ae9b5a257b99ddc51a9e9b7c6d7
BLAKE2b-256 f2aea3107cb8fbdcd32cd1fb0195c09558c039e78a9f8caae08c7c535b5f4149

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page