<!-- canonical: https://docs.jmrp.io/phonometry/reference/api/environment/noise-reducing-devices/ -->
Source: https://docs.jmrp.io/phonometry/reference/api/environment/noise-reducing-devices/

Single-number ratings of noise reducing devices (EN 1793, EN 16272).

A barrier beside a road is not judged band by band. It is judged by single
numbers, and each is the same operation on a spectrum nobody measures on
site: the normalised traffic noise spectrum of **EN 1793-3:1997**, eighteen
one-third octave bands from 100 Hz to 5 kHz carrying relative A-weighted
levels $L_i$ that stand for what a road sounds like at the roadside.

A barrier beside a railway is judged the same way and by a different
spectrum. **EN 16272-3-1:2012** prints the normalised railway noise spectrum
over the same eighteen bands, and its Clauses 5 and 6 are the two formulas
below with that table in place of the other one: rolling noise puts its
weight higher up, so the railway spectrum is flat within one decibel from
1,25 kHz to 2,5 kHz where the road one has already begun to fall away.
The railway parts carry no category ladder; their annexes are guidance
notes, and a rating there is the number and nothing more.

* **EN 1793-1:2012** rates absorption. What matters to the neighbour is the
  energy the device sends back across the road, so the rating is what is
  *not* absorbed, in decibels (Clause 5):

  $$
  DL_\alpha = -10 \lg\left| 1 - \frac{\sum_{i=1}^{18} \alpha_{\mathrm{S}i}\, 10^{0.1 L_i}} {\sum_{i=1}^{18} 10^{0.1 L_i}} \right|
  $$

  A measured $\alpha_\mathrm{S}$ can exceed one band by band, which
  can push the weighted ratio past 1 and leave the logarithm without an
  argument. The clause says so and fixes it: the ratio is limited to 0,99.

* **EN 1793-2:2012** rates airborne insulation with the same weighting
  (Clause 5.2), on the transmitted energy rather than the absorbed:

  $$
  DL_R = -10 \lg\left| \frac{\sum_{i=1}^{18} 10^{0.1 L_i}\, 10^{-0.1 R_i}} {\sum_{i=1}^{18} 10^{0.1 L_i}} \right|
  $$

* **EN 1793-5:2016** rates the sound reflection measured in place, the
  index $RI$ of
  [`barrier_reflection`](/phonometry/reference/api/environment/barrier-reflection/), on the same
  spectrum but from the lowest band the size of the sample makes reliable
  (Clause 5.8, Formula (12)):

  $$
  DL_{RI} = -10 \lg\left[ \frac{\sum_{i=m}^{18} RI_i\, 10^{0.1 L_i}} {\sum_{i=m}^{18} 10^{0.1 L_i}} \right]
  $$

  The clause copies the 0,99 limit on the ratio from EN 1793-1, so a device
  reflecting more than it receives in the weighted sum rates 0,04 dB.

All three are reported rounded to the nearest integer (EN 1793-1 Clause 6.1,
EN 1793-2 Clause 7.1, EN 1793-5 Clause 5.11). The first two have a normative
category ladder in their Annex A: A1 to A5 for absorption, B1 to B4 for
insulation, with A0 and B0 reserved for "not determined". The categories are
read off the reported integer, which is why the ladders have no gaps between
their steps. EN 1793-5 prints no ladder.

Absorption and insulation answer different questions and are not
comparable. A device can be a perfect reflector and still keep the noise out
(high $DL_R$, low $DL_\alpha$); a device can be highly absorptive
and let sound through (the other way round). The declaration carries both.
$DL_{RI}$ answers the first question again, in the direct sound field
beside the road rather than the diffuse field of a reverberation room, so it
does not convert into $DL_\alpha$ either.

> Auto-generated from the source docstrings by `scripts/generate_api_docs.py` (`make api-docs`). Do not edit by hand.

## ABSORPTION_CATEGORIES

*Constant* (`tuple`).

```python
ABSORPTION_CATEGORIES = (('A1', -2147483648, 3), ('A2', 4, 7), ('A3', 8, 11), ('A4', 12, 15), ('A5', 16, 2147483648))
```

## ABSORPTION_RATIO_LIMIT

*Constant* (`float`).

```python
ABSORPTION_RATIO_LIMIT = 0.99
```

## airborne_insulation_rating

```python
airborne_insulation_rating(
    sound_reduction_index_db: ArrayLike,
    *,
    spectrum: str = 'road',
) -> RoadDeviceRating
```

`DL_R`, the single-number rating of airborne sound insulation.

EN 1793-2:2012 Clause 5.2 for a road device, EN 16272-3-1:2012 Clause 6
for a railway one, on the same weighting as the absorption rating above.

**Parameters**

| Name | Description |
| :--- | :--- |
| `sound_reduction_index_db` | $R$ in decibels, in the eighteen one-third octave bands of [`TRAFFIC_NOISE_BANDS_HZ`](/phonometry/reference/api/environment/noise-reducing-devices/#traffic_noise_bands_hz). |
| `spectrum` | `"road"` (EN 1793-3, the default) or `"railway"` (EN 16272-3-1). |

**Returns:** The rating, its reported integer and, for a road device, its Annex A category.

**Raises**

| Exception | When |
| :--- | :--- |
| ValueError | If the input does not cover the eighteen bands, is not finite, or the spectrum is not one of the two. |

## INSULATION_CATEGORIES

*Constant* (`tuple`).

```python
INSULATION_CATEGORIES = (('B1', -2147483648, 14), ('B2', 15, 24), ('B3', 25, 34), ('B4', 35, 2147483648))
```

## NORMALISED_RAILWAY_NOISE_SPECTRUM_DB

*Constant* (`tuple`).

```python
NORMALISED_RAILWAY_NOISE_SPECTRUM_DB = (-27.0, -25.0, -23.0, -21.0, -19.0, -17.0, -15.0, -13.0, -12.0, -11.0, -10.0, -9.0, -9.0, -9.0, -9.0, -10.0, -13.0, -17.0)
```

## NORMALISED_TRAFFIC_NOISE_SPECTRUM_DB

*Constant* (`tuple`).

```python
NORMALISED_TRAFFIC_NOISE_SPECTRUM_DB = (-20.0, -20.0, -18.0, -16.0, -15.0, -14.0, -13.0, -12.0, -11.0, -9.0, -8.0, -9.0, -10.0, -11.0, -13.0, -15.0, -16.0, -18.0)
```

## RoadDeviceRating

```python
RoadDeviceRating(
    rating: float,
    reported: int,
    category: str | None,
    quantity: str,
    spectrum: str,
    bands_hz: NDArray[np.float64],
    values: NDArray[np.float64],
    weights: NDArray[np.float64],
    lowest_band_hz: float = 100.0,
)
```

One single-number rating of a road traffic noise reducing device.

**Attributes**

| Name | Description |
| :--- | :--- |
| `rating` | The rating before rounding, in dB. `DLα` (EN 1793-1), `DL_R` (EN 1793-2) or `DL_RI` (EN 1793-5), depending on `quantity`. |
| `reported` | The same rating rounded to the nearest integer, which is what a test report carries and what the category is read off. |
| `category` | The Annex A category of the reported value, `"A1"` to `"A5"` for absorption or `"B1"` to `"B4"` for insulation, or `None` for a railway rating and for reflection, whose standards print no ladder. |
| `quantity` | `"absorption"`, `"insulation"` or `"reflection"`. |
| `spectrum` | `"road"` (EN 1793-3) or `"railway"` (EN 16272-3-1). |
| `bands_hz` | The eighteen band centre frequencies, in Hz. |
| `values` | The per-band input the rating was weighted from: the sound absorption coefficients, the sound reduction indices in dB, or the sound reflection indices (`nan` allowed below `lowest_band_hz`). |
| `weights` | The normalised traffic noise spectrum, in dB. |
| `lowest_band_hz` | The lowest band the rating sums from: 100 Hz for `DLα` and `DL_R`, which sum all eighteen, and the lowest reliable band $m$ for `DL_RI`. |

### RoadDeviceRating.plot()

```python
RoadDeviceRating.plot(
    ax: Axes | None = None,
    *,
    language: str = 'en',
    **kwargs: Any,
) -> Axes
```

Plot the per-band input against the spectrum that weights it.

Requires matplotlib (`pip install phonometry[plot]`); returns the
`Axes`.

## RoadDeviceWarning

Raised when a rating is computed on data the standard bounds.

## sound_absorption_rating

```python
sound_absorption_rating(
    absorption_coefficients: ArrayLike,
    *,
    spectrum: str = 'road',
) -> RoadDeviceRating
```

`DLα`, the single-number rating of sound absorption.

EN 1793-1:2012 Clause 5 for a road device, EN 16272-3-1:2012 Clause 5
for a railway one: the same formula over the same eighteen bands, with
the spectrum of the matching part in the weights. Only the road parts
print a category ladder, so a railway rating carries none.

**Parameters**

| Name | Description |
| :--- | :--- |
| `absorption_coefficients` | $\alpha_\mathrm{S}$ in the eighteen one-third octave bands of [`TRAFFIC_NOISE_BANDS_HZ`](/phonometry/reference/api/environment/noise-reducing-devices/#traffic_noise_bands_hz). |
| `spectrum` | `"road"` (EN 1793-3, the default) or `"railway"` (EN 16272-3-1). |

**Returns:** The rating, its reported integer and, for a road device, its Annex A category.

**Raises**

| Exception | When |
| :--- | :--- |
| ValueError | If the input does not cover the eighteen bands, is not finite, or the spectrum is not one of the two. |

**Warns**

| Warning | When |
| :--- | :--- |
| RoadDeviceWarning | If the weighted ratio reaches the 0,99 limit both standards put on it, which means the rating is the limit and not the data. |

## sound_reflection_rating

```python
sound_reflection_rating(
    reflection_indices: ArrayLike,
    *,
    lowest_band_hz: float = 200.0,
) -> RoadDeviceRating
```

`DL_RI`, the single-number rating of sound reflection.

EN 1793-5:2016 Clause 5.8, Formula (12): the sound reflection index
weighted by the normalised traffic noise spectrum of EN 1793-3, summed
from the lowest reliable band $m$ to 5 kHz. For the qualification
sample of 4 m by 4 m that band is 200 Hz (5.5.7), the default; a smaller
device starts higher and the report names the range, for example
`DL_RI (400 - 5 000 Hz)` for a 3,5 m barrier. Annex B's example rates
7,68 dB before rounding on the two-decimal averages of Table B.1
(7,65 dB on its particular values), reported as 8 dB. EN 1793-5 prints no
category ladder.

**Parameters**

| Name | Description |
| :--- | :--- |
| `reflection_indices` | $RI$ in the eighteen one-third octave bands of [`TRAFFIC_NOISE_BANDS_HZ`](/phonometry/reference/api/environment/noise-reducing-devices/#traffic_noise_bands_hz); a band below `lowest_band_hz` may be `nan`. |
| `lowest_band_hz` | The centre of the lowest reliable band, one of the eighteen. |

**Returns:** The rating and its reported integer, category `None`.

**Raises**

| Exception | When |
| :--- | :--- |
| ValueError | If there are not eighteen values, a band from `lowest_band_hz` up is not a finite non-negative number, the band is not positive or not one of the eighteen, or the weighted ratio is zero. |

**Warns**

| Warning | When |
| :--- | :--- |
| RoadDeviceWarning | If the weighted ratio exceeds the maximum of 0,99 Clause 5.8 limits it to; a ratio of 0,99 itself is not limited. |

## SPECTRA

*Constant* (`mapping`).

```python
SPECTRA = {'road': (-20.0, -20.0, -18.0, -16.0, -15.0, -14.0, -13.0, -12.0, -11.0, -9.0, -8.0, -9.0, -10.0, -11.0, -13.0, -15.0, -16.0, -18.0), 'railway': (-27.0, -25.0, -23.0, -21.0, -19.0, -17.0, -15.0, -13.0, -12.0, -11.0, -10.0, -9.0, -9.0, -9.0, -9.0, -10.0, -13.0, -17.0)}
```

## TRAFFIC_NOISE_BANDS_HZ

*Constant* (`tuple`).

```python
TRAFFIC_NOISE_BANDS_HZ = (100.0, 125.0, 160.0, 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, 2000.0, 2500.0, 3150.0, 4000.0, 5000.0)
```
