Skip to main content

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

Metadata

Release files for lora-phy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lora-phy 0.3.0
File Size Uploaded Provenance Actions
lora_phy-0.3.0.tar.gz 20.4 kB Without provenance Details for lora_phy-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lora-phy 0.3.0
File Interpreter ABI Platform Actions
lora_phy-0.3.0-py3-none-any.whl Python 3 none any Details for lora_phy-0.3.0-py3-none-any.whl

Total release size: 43.2 kB

Release files / lora_phy-0.3.0.tar.gz

Download URL lora_phy-0.3.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
afb650067f4fb00f821fd5bb0d4746112b0b1706d17c1a70c2cef56858d6f49e
BLAKE2b-256 checksum
How to use checksums
a68ef5cddb23a968d8a6dc7869d318d8235708800adbe8aaedf53eff7d6f0587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / lora_phy-0.3.0-py3-none-any.whl

Download URL lora_phy-0.3.0-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3779b451f40d4bf665da0d9ed23994a88c1acd61b0c6f7f2fe923727bdeb124e
BLAKE2b-256 checksum
How to use checksums
f019657af013d63381e7abb3d22d46ba1b8f7160abdf9b7bb6b57e2064dea205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for lora-phy 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page