Skip to main content

Libhum is a Python GPU-accelerated library to extract and compare Electricity Frequency Signals (ENF)

Project description

Libhum

Libhum computing an ENF signal

Libhum is a Python library and set of utilities to extract and compare electricity frequency signals (ENF).

The library uses GPU accelaration (CUDA or OpenCL) to accurately match ENF signals in seconds.

On an Apple Macbook Air M1, the library is able to match an 1 hour signal over a 10 years history in about 20 seconds.

Setup

pip install libhum

Compute ENF

Use the compute_enf command to extract the main ENF from an audio or video file to an .enf file:

libhum compute_enf samples/target.ogg target.enf --plot

By default, the library is looking for an ENF signal in the 50 Hz band. Use the -f/--frequency option to use a different frequency.

Match ENFs

Libhum matching two ENF signals

Use the match_enf command to find the best matches between two signals:

libhum match_enf samples/reference.enf samples/target.enf --plot

The default backend is using Numpy and is considerably slower than the OpenCL or CUDA backends which rely on GPU accelaration. Append the --backend=cuda or --backend=opencl option to use a GPU-accelerated backend.

Special thanks

Some of the signal processing algorithms used by the library originate from Robert Heaton's ENF matching library.

License

See LICENSE file for details.

BibTeX Citation

If you use Libhum in any scientific publication, please use the following BibTex citation:

@software{Javaux_Libhum,
    author = {Javaux, Raphael},
    license = {LGPL-3.0},
    title = {{Libhum}},
    url = {https://github.com/RaphaelJ/libhum},
    year={2024},
}

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

libhum-1.1.5.tar.gz (61.4 kB view details)

Uploaded Source

Built Distribution

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

libhum-1.1.5-py3-none-any.whl (63.8 kB view details)

Uploaded Python 3

File details

Details for the file libhum-1.1.5.tar.gz.

File metadata

  • Download URL: libhum-1.1.5.tar.gz
  • Upload date:
  • Size: 61.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for libhum-1.1.5.tar.gz
Algorithm Hash digest
SHA256 39a53c6507c8db88ff3d72ebbe19e7c5c8f15a262ac5d8409f7f43ebd8a21d45
MD5 96443f9846318341b6410e5d8e29ff4c
BLAKE2b-256 b7cee059a8364740f528268d07b193593dee7f999782aa8c627264b5b59f8245

See more details on using hashes here.

File details

Details for the file libhum-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: libhum-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 63.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for libhum-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a5579ec8558a7501ce6e84d12ee7682416f925a79881fc004b3d0307b3c7b6d2
MD5 51e2fd1c4e997a83452bbceb5902ffee
BLAKE2b-256 e905f93e9be66507889d7d58a8a268b80664cda0b9e11b6c05a0388516c3c36d

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