A zero dependency Python ITU-R 468 noise weighting filter (1 and 2 kHz)
Project description
itu-r-468-weighting
A zero dependency Python ITU-R 468 noise weighting filter (1 and 2 kHz)
Introduction
This project consists of a sole function named r468
. The function takes a frequency value and returns a weighted dB value. For weightening, the ITU-R BS.468-4 standard and the SMPTE RP 2054:2010 recommended practice are followed.
The math for this project is taken from Wikipedia (as of 2019-08-08):
Installation
pip install itu-r-468-weighting
More infos on the project page on PyPI.
Example Usage
from itu_r_468_weighting.filter import r468
r468(1000, "1khz")
r468(1000, "2khz")
Notice: underscores ("_") instead of pip-style dashes ("-") are used for the project name on import.
Function Description
r468(frequency_hz, khz_option)
- Takes a frequency value and returns a weighted dB value.
Parameters
frequency_hz
: float
- The frequency value (in Hz) must be a value greater 0.
khz_option
: str
- Choose
1khz
or2khz
as an weighting option. The weighting curves have the same shape for both options. They are shifted in a way, that the gain is 0.0 dB at the given frequency (1 or 2 kHz).
Returns
float
- The dB weighted value of the frequency.
Raises
ValueError
- If parameter
frequency_hz
is not greater 0. - If parameter
khz_option
is not equal to1khz
or2khz
.
Developement
This project is hosted on GitHub.
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
Hashes for itu-r-468-weighting-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3398ada9502e772e8af6ed161f6cdadbfc1bf418441c46ac23afb36343de6d32 |
|
MD5 | e30a1aead1d6863f8cb4c919f9ee6181 |
|
BLAKE2b-256 | 5bbfc2a89fe404345ad69cd59294d91466f4e8668ec2422950ffeef621f620c8 |