Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harm_analysis-1.1.2.tar.gz (90.0 kB view hashes)

Uploaded Source

Built Distribution

harm_analysis-1.1.2-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page