Libhum is a Python GPU-accelerated library to extract and compare Electricity Frequency Signals (ENF)
Project description
Libhum
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
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 Distributions
Built Distribution
File details
Details for the file libhum-1.1.4-py3-none-any.whl
.
File metadata
- Download URL: libhum-1.1.4-py3-none-any.whl
- Upload date:
- Size: 63.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb67cbd97d6c5401ec3a26020780c885542d1b035dfea49835035afb23e2d158 |
|
MD5 | f2546b9c49ebc21094555781be387a30 |
|
BLAKE2b-256 | 0008bbdaa22633d6c46590fd78eeac5a4c86a5cc0a22c3022ceb4551e16b6b59 |