This package provides a perceived loudness calculator implementing Stevens' perceived loudness methodology (see References) for predicting the PLdB (perceived loudness in decibels) of a pressure signature. PyLdB was created in an effort to make this functionality more readily available to scientists and engineers, as the other option available requires following ITAR training and procedures to use.
PyLdB requires both time and pressure arrays in milliseconds and pounds per square foot respectively as an input. It also is able to import these arrays from a file, as long as the file is compatible with the numpy genfromtxt function.
The following code demonstrates how PyLdB can be used in a Python script. Specifically, it will demonstrate how to import time and pressure arrays from a file, and then use those arrays to calculate the PLdB of the pressure signature.
import pyldb
time, pressure = pyldb.import_sig("pyldb_sig1.sig", header_lines=3)
PLdB = pyldb.perceivedloudness(time, pressure, pad_front=10, pad_rear=10)
print(PLdB)
PyLdB was supported by the NASA University Leadership Initiative (ULI) program under federal award number NNX17AJ96A, titled Adaptive Aerostructures for Revolutionary Civil Supersonic Transportation.
See doc strings in code.
You can either download the source as a ZIP file and extract the contents or clone the pyldb repository using Git.
- Open a web browser and navigate to https://github.com/usuaero/pyldb
- Make sure the branch is set to 'Master'
- Click the
Clone or download
button - Select
Download ZIP
- Extract the downloaded ZIP file to a local directory on your machine
- From the command prompt, navigate to the directory where pyldb will be installed
git clone https://github.com/usuaero/pyldb
Unit tests are implemented using the pytest module and are run using the following command in the base directory.
pytest test.py
Contact doug.hunsaker@usu.edu or christian.bolander@usu.edu with any questions.
This project is licensed under the MIT license. See LICENSE file for more information.