A Python library to estimate parameters from a signal containing a tone.
Project description
Introduction
The harmonic analysis function uses an FFT to estimate the following parameters from a signal containing a tone:
THD and THD+N
Fundamental power and frequency location
Noise power
SNR, SINAD
DC level
Total integrated noise (everything except DC and the fundamental)
The full documentation is hosted on ReadTheDocs:Harmonic Analysis.
Installation
The harm_analysis package is available via PIP install:
python3 -m venv pyenv
source pyenv/bin/activate
pip install harm_analysis
After installing the package, the harm_analysis function should be available via import:
from harm_analysis import harm_analysis
Documentation on how to use the function can be found here.
Command line interface
Installing the package also installs a command line interface, that allows the user to run the function for text files with time domain data:
The command is harm_analysis:
harm_analysis --help
Output:
Usage: harm_analysis [OPTIONS] FILENAME
Runs the harm_analysis function for a file containing time domain data
Options:
--fs FLOAT Sampling frequency.
--plot Plot the power spectrum of the data
--sep TEXT Separator between items.
--sfactor TEXT Scaling factor. The data will be multiplied by this number,
before the function is called. Examples: 1/8, 5, etc
--help Show this message and exit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file harm_analysis-1.2.0.tar.gz
.
File metadata
- Download URL: harm_analysis-1.2.0.tar.gz
- Upload date:
- Size: 113.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b473f33b1f806e78de39af5d6a50b71c39ec7a9d32b6751843a275890ded7b3 |
|
MD5 | 9f23806c7cf2f1e3cdddd7e915bda99e |
|
BLAKE2b-256 | 239d9cabebe585103cc4d92a949f8be404ece728a4af14016f0b58071607478d |
File details
Details for the file harm_analysis-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: harm_analysis-1.2.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2d6427c1e6878e953b3e02756d1a6df03efaf4dbe578738cd8ba8791e0cc031 |
|
MD5 | 32b5014206e0ccb354d7e7cb0797c6c4 |
|
BLAKE2b-256 | 990774875e6046cf9798de9e3ffbbe97de671b5ab9db7e29f4a6741cb694f461 |