impedancetube
A routine to calculate plane wave transmission loss in rectangular and circular tubes following ASTM E2611
Dependencies: acoular, numpy, traits. matplotlib is recommended but not required.
Using conda and pip, you can install the required packages into your environment with these commands:
conda install -c acoular acoular
conda install matplotlib
pip install impedancetube
I recommend doing the measurements as described here and modifying the example script for evaluation. The scripts assume that you are measuring with 6 microphones simultaneously and that you are using the first microphone (nearest to the sound source) as the reference. At the end of this instruction you can find more detailed instructions if your measurements are done with custom configurations.
How to measure (E2611 one load method)
Switched Microphone Measurements
First, we will need to make measurement in the empty tube with an anechoic back end. These will be used to calculate amplitude and phase correction factors between the microphones. For the direct configuration, route the microphones as shown in the figure above. Recommended measuring time is 60s.
For the switched configurations, switch the microphone positions without un- and replugging the cables. For example: This would be the routing for the switched configuration of microphones 0 and 1:
- mic #0 in position 1 going into ch. 0
- mic #1 in position 0 going into ch. 1
The other switched configurations follow the same rule, just switch the positions of n-th microphone and the reference microphone. Do the following measurements:
- Measure with the direct configuration
- Measure with reference mic (#0) switched with mic #1
- Measure with reference mic (#0) switched with mic #2
- Measure with reference mic (#0) switched with mic #3
- Measure with reference mic (#0) switched with mic #4
- Measure with reference mic (#0) switched with mic #5
Afterwards, don't forget to bring the microphones back into their original order.
Measurements
Insert your test specimen(s) and do your measurement(s) For the two-load method, use two different tube terminations as described in ASTM E2611.
How do modify the example scripts for your measurements
The easiest way to evaluate measurements is taking the example scripts from the Examples folder and modifying them to use your measurements. Here, the process is explained exemplary for the E2611 one-load method
Put the files where you need them:
Clone/download this repository. Open Examples/example_E2611_one_load.py.
Audio Files
For the easiest workflow, copy all your audio (.h5) files into the Resources directory. Alternatively you can modify soundfilepath = './Resources/' to match the path where all your audio files are.
General Parameters:
If your measurements were done as instructed, your reference channel is the first channel (0) and your four microphone channels for the narrow and wide microphone configurations don't need to be modified. T
ref_channel = 0
mic_channels_narrow = [1, 2, 3, 4]
mic_channels_wide = [0, 2, 3, 5]
Set the filenames for the Amplitude/Phase correction
Set the filenames of your empty measurements with the direct configuration and the switched configurations (See section Switched Microphone Measurements). The key of the dictionary denotes the index of the microphone that was switched with the reference (keep in mind that indexing starts at 0). The values represent the corresponding filenames.
filename_direct = 'empty_direct.h5'
filenames_switched = {1: 'empty_switched_1-0.h5',
2: 'empty_switched_2-0.h5',
3: 'empty_switched_3-0.h5',
4: 'empty_switched_4-0.h5',
5: 'empty_switched_5-0.h5'}
Set the filename(s) for the Measurement
The measurement sound files have to be in the same directory as the other sound files defined in soundfilepath. You can add multiple filenames to the list.
filenames_measurement = ['measurement.h5',
]
Set the parameters for the frequency data handling
In the norm a Hanning window is required. A large block size increases the frequency resolution. If you set cached = True, the PowerSpectra object will use caching. This makes calculations faster if run repeatedly.
block_size = 4*2048
window = 'Hanning'
overlap = '50%'
cached = False
Set parameters for plotting
Decide if you want the plot to be saved and set the save directory. The directory will be created if it doesn't exist yet.
savePlot = True
plotpath = './Plots'
When you run the script, you should get a plot of the transmission loss in dB for each measurement.
Metadata
Release files for impedancetube 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| impedancetube-0.2.5.tar.gz | 14.4 kB | Without provenance | Details for impedancetube-0.2.5.tar.gz |
Release files / impedancetube-0.2.5.tar.gz
| Download URL | impedancetube-0.2.5.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b9730f402027bc464d125315537e243f3d836ae9080c2761a6f1fa9856d249a
|
|
BLAKE2b-256 checksum How to use checksums |
90f4eefbd9cb58d4afd36fa46af57144c4e1a14c97d3485cdb561a1a679f06f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Security for impedancetube 0.2.5
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.