Skip to main content

Full implementation of the physical layer of LoRa. (Python translation of jkadbear/LoRaPHY)

Project description

pyLoRaPHY

Full implementation of the physical layer of LoRa. (Python translation of jkadbear/LoRaPHY)

It also contains comments from my understanding of the code and unique implementation choices optimized for clarity, Pythonic style, and performance.

Some MATLAB values distingush column and row vectors. They are all treated as 1D arrays here. All indices are C-style.

The original code was (c) 2020-2022 jkadbear licensed under MIT.

As a project developed during Maiyun's participation in the UCSD SRIP program, The University of California may have claims to this work.

@author: Zhang Maiyun maz005@ucsd.edu Created on Thu May 23 17:28:37 2024

I try to not use self in functions that just calculate values and return them, to allow for easier testing. Also, while the original implementation passes data with class properties, this one uses parameters to pass ones that are packet-specific and only store stable configuration as instance variables.

Implementation checklist:

  • Constructor tested
  • init tested
  • dechirp tested
  • detect tested
  • demodulate tested
  • parse_header tested
  • dynamic_compensation tested
  • gray_coding tested
  • diag_deinterleave tested
  • hamming_decode tested
  • sync
  • decode tested
  • dewhiten tested
  • calc_crc tested

Functions for modulating side stuff:

  • modulate tested
  • encode tested
  • gray_decoding tested
  • calc_sym_num tested
  • whiten: (as dewhiten)
  • gen_header tested
  • hamming_encode tested
  • diag_interleave tested

These three look like they are not referenced anywhere:

  • symbols_to_bytes
  • calc_payload_len
  • time_on_air tested

Other functions:

  • print_bin (debugging, use logging instead)
  • print_hex (debugging, use logging instead)
  • log (debugging, use logging instead)
  • plot_peak
  • bit_reduce (as xorbits)
  • word_reduce merged into hamming_encode
  • topn merged into dechirp
  • chirp tested
  • spec: use matplotlib.pyplot.specgram instead
  • read: (as demodulate_file)
  • write: use ndarray.tofile instead

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

lora_phy-0.3.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

lora_phy-0.3.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file lora_phy-0.3.0.tar.gz.

File metadata

  • Download URL: lora_phy-0.3.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lora_phy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 afb650067f4fb00f821fd5bb0d4746112b0b1706d17c1a70c2cef56858d6f49e
MD5 04eca2373ddbba13ffe7c2693799ce39
BLAKE2b-256 a68ef5cddb23a968d8a6dc7869d318d8235708800adbe8aaedf53eff7d6f0587

See more details on using hashes here.

File details

Details for the file lora_phy-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: lora_phy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lora_phy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3779b451f40d4bf665da0d9ed23994a88c1acd61b0c6f7f2fe923727bdeb124e
MD5 84d4ec9d7cba93172019c132cc8fde95
BLAKE2b-256 f019657af013d63381e7abb3d22d46ba1b8f7160abdf9b7bb6b57e2064dea205

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