noise_control.cabin_insulation
What a cabin keeps out, measured in the room it stands in (ISO 11957).
An enclosure keeps noise in; a cabin keeps it out. ISO 11957:1996 measures the second, and it measures it as one subtraction: put the cabin in a sound field, measure the level in the room and the level inside the empty cabin, and take the difference band by band.
That is Equation (1) in the laboratory. Equation (2) is the same arithmetic
in situ, where the room need not be diffuse, and the answer carries a prime
to say so: . Equation (3) is the A-weighted difference
, and the standard defines it only for the third of its three
methods, the one that drives the room with the noise that is actually there.
There is no unprimed in this document, and
cabin_insulation refuses to compute one.
The three methods
Section titled “The three methods”- laboratory, clause 6, in a reverberation room to ISO 3741, with at least two loudspeaker positions;
- in situ with a loudspeaker, 7.2.1, in any room at all, where the number
of source positions is not fixed in advance but read off the spread of the
answer itself (
check_source_positions); - in situ with the actual noise, 7.2.2, where the machinery of the workplace is the source, which is the only method that yields .
Only results from the same method may be compared, which is why the method is
a field of CabinInsulationResult and not a remark in a docstring.
What is here and what is not
Section titled “What is here and what is not”Every equation of clauses 6 to 9 is implemented, plus the numeric acceptance
rules the clauses state: the source-position criterion of 7.2.1, the flatness
of the driving spectrum of 6.4, the clearance of 6.2, the background margins,
and the volume ratio clause 10 attaches its uncertainty to. The single-number
rating of clause 8 is handed to phonometry.building.weighted_rating,
which is ISO 717-1 with written where that standard writes
, and the background correction is handed to
phonometry.emission.reverberation_background_correction, which is the
ISO 3741 the clauses point at.
The leak ratio of definition 3.14 and the seal ratio of its note are printed
word for word as in ISO 11546, so they are imported from
phonometry.noise_control.enclosure_insulation rather than written twice.
The scope is tighter here: ISO 11546 only prefers a leak ratio under 2 %, while
clause 1 of ISO 11957 makes it a condition of applicability.
Instrumentation, mounting, the ten operations of every movable part and the
report template are procedure, and procedure is not arithmetic. The one piece
of clause 11 that computes is the rounding of 11.4 e), which is
CabinInsulationResult.rounded.
The document prints no worked example, so the tests are anchored on the
algebraic identities of the subtraction, on the printed thresholds, and on the
identity that makes estimated_cabin_noise_insulation agree with its own
inputs.
Auto-generated from the source docstrings by
scripts/generate_api_docs.py(make api-docs). Do not edit by hand.
BAND_FLATNESS_LIMIT_DB
Section titled “BAND_FLATNESS_LIMIT_DB”Constant (mapping).
BAND_FLATNESS_LIMIT_DB = {125.0: 6.0, 250.0: 5.0}BandFlatnessCheck
Section titled “BandFlatnessCheck”BandFlatnessCheck( octave_centres_hz: NDArray[np.float64], spread_db: NDArray[np.float64], limit_db: NDArray[np.float64], satisfied: NDArray[np.bool_],)How flat the driving spectrum is inside each octave, 6.4 and 7.2.1.
Attributes
| Name | Description |
|---|---|
octave_centres_hz | The octave centre frequencies read, in hertz. |
spread_db | The difference between the loudest and the quietest of the three one-third-octave bands in each, in decibels. |
limit_db | What 6.4 allows in each, in decibels, and nan in the octaves below 125 Hz, for which the clause prints no limit. |
satisfied | Whether each octave meets its limit. An octave with no printed limit is reported as satisfied. |
BandFlatnessCheck.all_satisfied
Section titled “BandFlatnessCheck.all_satisfied”property
Whether every octave with a printed limit meets it.
cabin_insulation
Section titled “cabin_insulation”cabin_insulation( room_levels: ArrayLike, cabin_levels: ArrayLike, *, frequencies: ArrayLike | None = None, method: CabinMethod = 'laboratory', band_fraction: int = 3, room_background_levels: ArrayLike | None = None, cabin_background_levels: ArrayLike | None = None, a_weighted_room_level: float | None = None, a_weighted_cabin_level: float | None = None, internal_noise_level: float | None = None,) -> CabinInsulationResultSound pressure insulation of a cabin, Equations (1), (2) and (3).
One function for the three equations, because the three are the same subtraction and what separates them is the method, not the arithmetic:
in the laboratory, the same in situ under the name , and the A-weighted difference when the source is the noise of the workplace. Definition 3.7 ties that last one to the actual-noise method alone, so an A-weighted pair given under another method is refused rather than quietly renamed.
Where a background spectrum is supplied it is taken off first, by the
ISO 3741 correction 6.4 asks for, and a margin under
MIN_SIGNAL_TO_BACKGROUND_DB is reported.
Parameters
| Name | Description |
|---|---|
room_levels | per band, in decibels. |
cabin_levels | per band, in decibels. |
frequencies | Nominal band centres, in hertz. |
method | "laboratory" (default), "in-situ-loudspeaker" or "in-situ-actual-noise". |
band_fraction | 3 for one-third octaves (default), 1 for octaves. |
room_background_levels | Background in the room per band, in decibels, for the correction of 7.2.2. |
cabin_background_levels | Background inside the cabin per band, in decibels, for the correction of 6.4. |
a_weighted_room_level | , in decibels. |
a_weighted_cabin_level | , in decibels. |
internal_noise_level | of 6.7, in decibels, carried into the result because 11.4 reports it beside the insulation. |
Returns: The insulation, as a CabinInsulationResult.
Raises
| Exception | When |
|---|---|
| ValueError | For spectra that do not match, an unknown method or band fraction, or an A-weighted pair under a method that does not define one. |
CabinInsulationResult
Section titled “CabinInsulationResult”CabinInsulationResult( frequencies: NDArray[np.float64] | None, room_levels: NDArray[np.float64], cabin_levels: NDArray[np.float64], insulation: NDArray[np.float64], apparent: bool, a_weighted_insulation: float | None, internal_noise_level: float | None, method: str, band_fraction: int,)The sound pressure insulation of a cabin, band by band.
Attributes
| Name | Description |
|---|---|
frequencies | Nominal band centre frequencies, in hertz, or None when the levels were given without them. |
room_levels | , in decibels, after any background correction. |
cabin_levels | , in decibels, after any background correction. |
insulation | or per band, in decibels. |
apparent | Whether the answer carries the prime of 3.6, which it does for both in-situ methods. |
a_weighted_insulation | of Equation (3), in decibels, or None. Defined only for the actual-noise method. |
internal_noise_level | of 6.7, in decibels, or None when the cabin has no integral source. |
method | "laboratory", "in-situ-loudspeaker" or "in-situ-actual-noise". |
band_fraction | 3 for one-third octaves, 1 for octaves. |
CabinInsulationResult.plot()
Section titled “CabinInsulationResult.plot()”CabinInsulationResult.plot( ax: Axes | None = None, *, language: str = 'en', **kwargs: Any,) -> AxesDraw the two levels and the difference between them.
Requires matplotlib (pip install phonometry[plot]).
Parameters
| Name | Description |
|---|---|
ax | Existing axes, or None to create a figure. |
language | Label language, "en" (default) or "es". |
kwargs | Forwarded to phonometry._plot.noise_control.plot_cabin_insulation. |
Returns: The Axes.
CabinInsulationResult.rounded()
Section titled “CabinInsulationResult.rounded()”CabinInsulationResult.rounded() -> NDArray[np.int_]The band values as 11.4 e) reports them, to the nearest decibel.
CabinInsulationResult.symbol
Section titled “CabinInsulationResult.symbol”property
The symbol clause 12 reports this as, "D_p" or "D'_p".
CabinInsulationWarning
Section titled “CabinInsulationWarning”The measurement is outside a condition ISO 11957 states.
CabinUncertainty
Section titled “CabinUncertainty”CabinUncertainty( method: str, volume_ratio: float, ratio_satisfied: bool, stateable: bool, stated_band_range_hz: tuple[float, float] | None, increased_uncertainty_band_range_hz: tuple[float, float] | None, excess_standard_deviation_db: float | None,)What clause 10 will and will not say about a measurement.
Attributes
| Name | Description |
|---|---|
method | The method the statement is about. |
volume_ratio | . |
ratio_satisfied | Whether that ratio reaches MIN_ROOM_TO_CABIN_VOLUME_RATIO. |
stateable | Whether clause 10 offers any figure at all. It does not for the actual-noise method, which it sends to ISO 4871 instead. |
stated_band_range_hz | The range the statement covers, in hertz, or None when nothing is stateable. |
increased_uncertainty_band_range_hz | The range where a larger uncertainty is expected, in hertz, or None. |
excess_standard_deviation_db | What this method adds to the standard deviation of the laboratory one, in decibels, or None. |
check_band_flatness
Section titled “check_band_flatness”check_band_flatness( third_octave_levels: ArrayLike, *, frequencies: ArrayLike,) -> BandFlatnessCheckIs the driving spectrum flat enough inside each octave? 6.4 and 7.2.1.
An octave-band measurement only means what the standard says it means if the sound that produced it was spread evenly across the octave. The clause puts a number on that: the three one-third-octave levels inside one octave shall not differ by more than 6 dB in the octave of 125 Hz, 5 dB in the one of 250 Hz and 4 dB in the bands of higher frequencies. Nothing is printed for the octaves below 125 Hz, so nothing is claimed for them here.
Parameters
| Name | Description |
|---|---|
third_octave_levels | The one-third-octave levels of the sound in the room, in decibels. |
frequencies | Their nominal centre frequencies, in hertz. |
Returns: One row per octave, as a BandFlatnessCheck.
Raises
| Exception | When |
|---|---|
| ValueError | For inputs that do not match, a frequency that names no one-third-octave band, a band given twice, or an octave that is not covered by its three bands. |
check_source_positions
Section titled “check_source_positions”check_source_positions( insulation_by_position: ArrayLike,) -> SourcePositionCheckWere there enough loudspeaker positions? 7.2.1.
The only acceptance criterion in the document that is read off the answer rather than fixed in advance: the number of source positions shall be at least the largest difference, in decibels, between the of any two positions, in octave bands. Three positions to begin with, six at most, and a spread past six goes in the report.
The clause says octave bands, and it says so because the spread of a one-third-octave answer is the wider one. A one-third-octave measurement is therefore folded to octaves at the level, by energy-summing the room and the cabin spectra, before the difference is formed; folding the difference itself is not the same number, so this function takes the octave-band already formed and does not pretend to do that conversion.
Parameters
| Name | Description |
|---|---|
insulation_by_position | in octave bands, one row per source position and one column per band, in decibels. |
Returns: The verdict, as a SourcePositionCheck.
Raises
| Exception | When |
|---|---|
| ValueError | For fewer than MIN_SOURCE_POSITIONS_IN_SITU positions, or an array that is not rectangular. |
DEFAULT_BAND_FLATNESS_LIMIT_DB
Section titled “DEFAULT_BAND_FLATNESS_LIMIT_DB”Constant (float).
DEFAULT_BAND_FLATNESS_LIMIT_DB = 4.0estimated_cabin_noise_insulation
Section titled “estimated_cabin_noise_insulation”estimated_cabin_noise_insulation( spectrum_levels: ArrayLike, insulation: ArrayLike, *, frequencies: ArrayLike,) -> floatWhat a cabin is worth against a stated spectrum, Annex A.
Both formulas of the annex, which differ only in whether or is substituted:
with the A-weighted total of the assumed spectrum. The sign of is the trap: the annex prints an attenuation, positive where the weighting takes level away, while this library’s band corrections are the correction itself, so . Both terms are built here from the same table, so the total and the sum cannot disagree, and an insulation of zero returns exactly zero.
The annex assumes a diffuse field and says so; in situ it will usually not be, and nothing here is corrected for flanking through the floor.
Parameters
| Name | Description |
|---|---|
spectrum_levels | , the assumed noise spectrum per band, in decibels. |
insulation | or per band, in decibels. |
frequencies | Nominal band centres, in hertz. |
Returns: or , in decibels.
Raises
| Exception | When |
|---|---|
| ValueError | For inputs that do not match band for band. |
IN_SITU_EXCESS_STANDARD_DEVIATION_DB
Section titled “IN_SITU_EXCESS_STANDARD_DEVIATION_DB”Constant (float).
IN_SITU_EXCESS_STANDARD_DEVIATION_DB = 2.0INCREASED_UNCERTAINTY_BAND_RANGE_HZ
Section titled “INCREASED_UNCERTAINTY_BAND_RANGE_HZ”Constant (tuple).
INCREASED_UNCERTAINTY_BAND_RANGE_HZ = (50.0, 200.0)INTERNAL_NOISE_CENTRE_HEIGHT_M
Section titled “INTERNAL_NOISE_CENTRE_HEIGHT_M”Constant (float).
INTERNAL_NOISE_CENTRE_HEIGHT_M = 1.55INTERNAL_NOISE_CENTRE_TOLERANCE_M
Section titled “INTERNAL_NOISE_CENTRE_TOLERANCE_M”Constant (float).
INTERNAL_NOISE_CENTRE_TOLERANCE_M = 0.075INTERNAL_NOISE_CORRECTION_WINDOW_DB
Section titled “INTERNAL_NOISE_CORRECTION_WINDOW_DB”Constant (tuple).
INTERNAL_NOISE_CORRECTION_WINDOW_DB = (6.0, 10.0)internal_noise_level
Section titled “internal_noise_level”internal_noise_level( levels: ArrayLike, *, background_level: float | None = None,) -> floatThe noise a cabin makes on its own, of 6.7.
The A-weighted levels measured at the three positions on the 0,3 m sphere, or over the inclined circular path, averaged on a mean-square basis with the external sources switched off.
The background rule of 6.7 is not the one of 6.4. The margin over the
background must reach MIN_SIGNAL_TO_BACKGROUND_DB, and the
correction is made only while the margin stays inside
INTERNAL_NOISE_CORRECTION_WINDOW_DB: past the top of that window
the correction is under a tenth of a decibel and the clause does not ask
for it. The correction itself is the of ISO 3741,
, applied to the A-weighted total
rather than band by band, which is what makes it a separate line here from
phonometry.emission.reverberation_background_correction.
Parameters
| Name | Description |
|---|---|
levels | The A-weighted levels at the microphone positions, in decibels. |
background_level | The A-weighted background inside the cabin with the integral sources switched off, in decibels. |
Returns: , in decibels.
Raises
| Exception | When |
|---|---|
| ValueError | For an empty or non-finite set of levels. |
LOW_BAND_CLEARANCE_M
Section titled “LOW_BAND_CLEARANCE_M”Constant (float).
LOW_BAND_CLEARANCE_M = 2.0LOW_BAND_CLEARANCE_RANGE_HZ
Section titled “LOW_BAND_CLEARANCE_RANGE_HZ”Constant (tuple).
LOW_BAND_CLEARANCE_RANGE_HZ = (50.0, 80.0)MAX_LEAK_RATIO
Section titled “MAX_LEAK_RATIO”Constant (float).
MAX_LEAK_RATIO = 0.02MAX_MICROPHONE_TO_CABIN_M
Section titled “MAX_MICROPHONE_TO_CABIN_M”Constant (float).
MAX_MICROPHONE_TO_CABIN_M = 5.0MAX_SOURCE_POSITIONS_IN_SITU
Section titled “MAX_SOURCE_POSITIONS_IN_SITU”Constant (int).
MAX_SOURCE_POSITIONS_IN_SITU = 6MIN_FIXED_MICROPHONE_POSITIONS
Section titled “MIN_FIXED_MICROPHONE_POSITIONS”Constant (int).
MIN_FIXED_MICROPHONE_POSITIONS = 6MIN_LOUDSPEAKER_POSITIONS
Section titled “MIN_LOUDSPEAKER_POSITIONS”Constant (int).
MIN_LOUDSPEAKER_POSITIONS = 2MIN_LOUDSPEAKER_SEPARATION_M
Section titled “MIN_LOUDSPEAKER_SEPARATION_M”Constant (float).
MIN_LOUDSPEAKER_SEPARATION_M = 3.0MIN_MICROPHONE_HEIGHT_M
Section titled “MIN_MICROPHONE_HEIGHT_M”Constant (float).
MIN_MICROPHONE_HEIGHT_M = 1.0MIN_ROOM_TO_CABIN_VOLUME_RATIO
Section titled “MIN_ROOM_TO_CABIN_VOLUME_RATIO”Constant (float).
MIN_ROOM_TO_CABIN_VOLUME_RATIO = 20.0MIN_SIGNAL_TO_BACKGROUND_DB
Section titled “MIN_SIGNAL_TO_BACKGROUND_DB”Constant (float).
MIN_SIGNAL_TO_BACKGROUND_DB = 6.0MIN_SOURCE_POSITIONS_IN_SITU
Section titled “MIN_SOURCE_POSITIONS_IN_SITU”Constant (int).
MIN_SOURCE_POSITIONS_IN_SITU = 3MIN_SOURCE_TO_CABIN_M
Section titled “MIN_SOURCE_TO_CABIN_M”Constant (float).
MIN_SOURCE_TO_CABIN_M = 2.0MIN_SOURCE_TO_MICROPHONE_IN_SITU_M
Section titled “MIN_SOURCE_TO_MICROPHONE_IN_SITU_M”Constant (float).
MIN_SOURCE_TO_MICROPHONE_IN_SITU_M = 3.0MIN_SOURCE_TO_MICROPHONE_M
Section titled “MIN_SOURCE_TO_MICROPHONE_M”Constant (float).
MIN_SOURCE_TO_MICROPHONE_M = 2.0minimum_cabin_clearance_m
Section titled “minimum_cabin_clearance_m”minimum_cabin_clearance_m( lowest_band_frequency_hz: float, *, speed_of_sound: float = 343.0,) -> floatHow far the cabin stands from the room, 6.2.
Half a wavelength at the centre of the lowest band of interest, between the
cabin and the walls, the ceiling and any diffusing element alike. Below
100 Hz the clause stops computing and fixes a flat
LOW_BAND_CLEARANCE_M, which at 50 Hz is less than the half
wavelength the rule above it would have asked for: the low-frequency
sentence relaxes the requirement rather than tightening it, and it is
written here exactly as printed.
Parameters
| Name | Description |
|---|---|
lowest_band_frequency_hz | The centre frequency of the lowest band of interest, in hertz. |
speed_of_sound | Speed of sound in the room, in metres per second. |
Returns: The least clearance, in metres.
Raises
| Exception | When |
|---|---|
| ValueError | For a non-positive frequency or speed. |
OPERATOR_PATH_INCLINATION_DEG
Section titled “OPERATOR_PATH_INCLINATION_DEG”Constant (float).
OPERATOR_PATH_INCLINATION_DEG = 45.0OPERATOR_SPHERE_RADIUS_M
Section titled “OPERATOR_SPHERE_RADIUS_M”Constant (float).
OPERATOR_SPHERE_RADIUS_M = 0.3PREFERRED_SIGNAL_TO_BACKGROUND_DB
Section titled “PREFERRED_SIGNAL_TO_BACKGROUND_DB”Constant (float).
PREFERRED_SIGNAL_TO_BACKGROUND_DB = 12.0SourcePositionCheck
Section titled “SourcePositionCheck”SourcePositionCheck( positions_used: int, max_octave_spread_db: float, required_positions: int, satisfied: bool, exceeds_maximum: bool,)Whether enough loudspeaker positions were used, 7.2.1.
Attributes
| Name | Description |
|---|---|
positions_used | , the number of source positions measured. |
max_octave_spread_db | The largest difference in between any two positions, over the octave bands, in decibels. |
required_positions | The fewest positions that spread calls for, never below MIN_SOURCE_POSITIONS_IN_SITU. |
satisfied | Whether positions_used reaches that number. |
exceeds_maximum | Whether the spread runs past MAX_SOURCE_POSITIONS_IN_SITU, which 7.2.1 says shall be stated in the report. |
STATED_UNCERTAINTY_BAND_RANGE_HZ
Section titled “STATED_UNCERTAINTY_BAND_RANGE_HZ”Constant (tuple).
STATED_UNCERTAINTY_BAND_RANGE_HZ = (250.0, 10000.0)uncertainty_conditions
Section titled “uncertainty_conditions”uncertainty_conditions( *, room_volume_m3: float, cabin_volume_m3: float, method: CabinMethod = 'laboratory',) -> CabinUncertaintyWhat clause 10 is willing to say about this measurement.
In the laboratory the uncertainty of ISO 3741 carries over from 250 Hz to
10 kHz, but only while the room is at least
MIN_ROOM_TO_CABIN_VOLUME_RATIO times the volume of the cabin; below
that ratio, and from 50 Hz to 200 Hz in any case, a larger uncertainty is
expected. The loudspeaker method in situ adds about
IN_SITU_EXCESS_STANDARD_DEVIATION_DB to the standard deviation. For
the actual-noise method the clause states nothing at all and sends a
declared value to ISO 4871.
Parameters
| Name | Description |
|---|---|
room_volume_m3 | , in cubic metres. |
cabin_volume_m3 | , in cubic metres. |
method | "laboratory" (default), "in-situ-loudspeaker" or "in-situ-actual-noise". |
Returns: The statement, as a CabinUncertainty.
Raises
| Exception | When |
|---|---|
| ValueError | For a non-positive volume or an unknown method. |
WALL_CLEARANCE_FACTOR
Section titled “WALL_CLEARANCE_FACTOR”Constant (float).
WALL_CLEARANCE_FACTOR = 0.5weighted_cabin_insulation
Section titled “weighted_cabin_insulation”weighted_cabin_insulation( insulation: ArrayLike, *, apparent: bool = False, band_fraction: int = 3,) -> WeightedCabinInsulationThe single-number rating of a cabin, clause 8.
ISO 717-1 with or written where that standard
writes the sound reduction index: the reference curve, the shift and the
adaptation terms come from phonometry.building.weighted_rating, and
what is done here is the trim to the rating bands and the prime.
Clause 4 calls this the preferred single number and then warns against
reading too much into it, because what a cabin is worth depends on the
spectrum it stands in. estimated_cabin_noise_insulation is the
answer to that objection.
Parameters
| Name | Description |
|---|---|
insulation | or over the 16 one-third-octave rating bands or the 5 octave ones, in decibels. |
apparent | Whether the spectrum is the in-situ one, which decides whether the rating is or . |
band_fraction | 3 for one-third octaves (default), 1 for octaves. |
Returns: The rating, as a WeightedCabinInsulation.
Raises
| Exception | When |
|---|---|
| ValueError | For a spectrum that is not the rating bands. |
WeightedCabinInsulation
Section titled “WeightedCabinInsulation”WeightedCabinInsulation( rating: int, c: int, ctr: int, unfavourable_sum: float, band_centres_hz: NDArray[np.float64], apparent: bool,)The single-number rating of a cabin, clause 8 by way of ISO 717-1.
Attributes
| Name | Description |
|---|---|
rating | or , in decibels. |
c | The spectrum adaptation term , in decibels. |
ctr | The spectrum adaptation term , in decibels. |
unfavourable_sum | The sum of unfavourable deviations at the shift the rating was read at, in decibels. |
band_centres_hz | The bands the rating was read over, in hertz. |
apparent | Whether the rating carries the prime of 3.9. |