Skip to main content

pyacoustics-stc

The Python library for Sound Transmission Class (STC) calculation

Installation

pip install pyacoustics-stc

Quickstart


Calculate STC

from pyacoustics_stc import SoundTransmissionClass

# sound transmission loss as dict object {Frequency : Value}
stl = {
    125: 11.66, 160: 13.303, 200: 14.825, 250: 20.861,
    315: 22.868,400: 24.943, 500: 26.881, 630: 28.889,
    800: 30.964, 1000: 32.902,1250: 34.84,1600: 36.984,
    2000: 38.923, 2500: 40.861, 3150: 27.557, 4000: 30.67,
}

stc = SoundTransmissionClass(stl=stl)

stc.index
# 29
stc.deficiency
# 25.579
stc.contour
# {125: 13, 160: 16, 200: 19, 250: 22, 315: 25, 400: 28, 500: 29, 630: 30, 800: 31, 1000: 32, 1250: 33, 1600: 33, 2000: 33, 2500: 33, 3150: 33, 4000: 33}
stc.delta
# {125: 1.34, 160: 2.697, 200: 4.175, 250: 1.139, 315: 2.132, 400: 3.057, 500: 2.119, 630: 1.111, 800: 0.036, 1000: 0, 1250: 0, 1600: 0, 2000: 0, 2500: 0, 3150: 5.443, 4000: 2.33}

Visualization

stc.plot() # display result as graph

Interactive Graph by Plotly

Interactive Graph on Browser

Static File Export

stc.export_graph_to_file("stc.png") # save graph result as PNG image file
stc.export_graph_to_file("stc.jpeg") # save graph result as JPEG image file
stc.export_graph_to_file("stc.pdf") # save graph result as PDF file

# <your_local_path>/stc.png

Sound Transimission Class Graph

Utils

from pyacoustics_stc.utils import build_frequency_stl_map

stl_without_key = [
    22.49669, 27.85324, 32.77704, 46.30192, 
    52.32415, 58.54912, 64.36372, 70.38595, 
    76.61092, 82.80217, 87.39175, 92.54538, 
    97.27899, 70.36132, 77.44058, 84.8613
]
stl = build_frequency_stl_map(stl_without_key)

stl
# {125: 22.49669, 160: 27.85324, 200: 32.77704, 250: 46.30192, 315: 52.32415, 400: 58.54912, 500: 64.36372, 630: 70.38595, 800: 76.61092, 1000: 82.80217, 1250: 87.39175, 1600: 92.54538, 2000: 97.27899, 2500: 70.36132, 3150: 77.44058, 4000: 84.8613}

Testing

python -m pytest

Formatter

black pyacoustics_stc 

Metadata

Release files for pyacoustics-stc 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyacoustics-stc 0.4.0
File Size Uploaded Provenance
pyacoustics-stc-0.4.0.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyacoustics-stc 0.4.0
File Interpreter ABI Platform
pyacoustics_stc-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / pyacoustics-stc-0.4.0.tar.gz

Download URL pyacoustics-stc-0.4.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d9c7dddcc1bbfb57e89ff8af7997e198767c55e4b0ec0bf22e063220da046b78
BLAKE2b-256 checksum
How to use checksums
9499ecf591bf39b8c4645e287af2179219a8b7fc549f91e8415b1d4b207c7f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.0b2 CPython/3.6.8 Linux/5.0.0-36-generic

Release files / pyacoustics_stc-0.4.0-py3-none-any.whl

Download URL pyacoustics_stc-0.4.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56f904513d4a42c1bb7b10f8f27ed1e9c1d897b1bef3db9d8f18e7cb8535a22a
BLAKE2b-256 checksum
How to use checksums
6afb9d7a138cf16e0f7d1a76bf188d14ab14ed97299de36fb0a42d51b52c41ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.0b2 CPython/3.6.8 Linux/5.0.0-36-generic

Security for pyacoustics-stc 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page