<!-- canonical: https://jmrplens.github.io/phonometry/buildings/insulation/spanish-building-code/ -->
Source: https://jmrplens.github.io/phonometry/buildings/insulation/spanish-building-code/

# Spanish Building Code (CTE DB-HR)

The *Documento Básico HR* "Protección frente al ruido" of the Spanish building
code states its requirements in A-weighted global quantities that are close
relatives of, but not identical to, the ISO 717-1 weighted ratings: $R_\mathrm{A}$,
$R_\mathrm{A,tr}$, $D_\mathrm{nT,A}$ and $D_{2\mathrm{m,nT,Atr}}$. This page implements the direct
Annex A route, which is the normative one for DB-HR, the requirement tables of
clause 2, and the two design calculations most often used with them: the
window-size correction and the insulation of a composite facade.

The band spectra it consumes come from field measurement or from prediction;
the ISO 717 reference-curve engine, which it is worth not confusing this with,
is in [Insulation Ratings (ISO 717)](https://jmrplens.github.io/phonometry/buildings/insulation/insulation-ratings/).

## The global index of Annex A

Instead of shifting a reference curve, DB-HR weights the measured band
insulation with a normalised source spectrum and sums it energetically
(Formulae A.5 to A.7):

$$
I_x = -10 \log_{10} \sum_i 10^{(L_{x,i} - X_i)/10} \quad \text{[dBA]}
$$

where $X_i$ is the band insulation (the sound reduction index $R$ or $R'$, the
standardized level difference $D_\mathrm{nT}$, $D_{2\mathrm{m,nT}}$ and so on) and $L_{x,i}$
the normalised source spectrum. The sum runs over **eighteen** one-third-octave
bands, 100 Hz to 5 kHz, two more than the sixteen of ISO 717-1 (100 Hz to
3150 Hz): the 4 kHz and 5 kHz bands, which are the first reason the two routes
do not always agree. The band centres are in `DB_HR_FREQUENCIES`.

| Normalised spectrum | Annex A table | Quantity it defines | Formula |
| :--- | :--- | :--- | :--- |
| A-weighted pink noise, $L_{\mathrm{Ar},i}$ | Table A.5 | $R_\mathrm{A}$, $D_\mathrm{nT,A}$, $D_{2\mathrm{m,nT,A}}$ | (A.5), (A.7) |
| Road traffic, $L_{\mathrm{Atr},i}$ | Table A.3 | $R_\mathrm{A,tr}$, $D_{2\mathrm{m,nT,Atr}}$ | (A.6) |
| Railway noise, $L_{\mathrm{Aef},i}$ | Table A.4 (numerically identical to A.3) | $D_{2\mathrm{m,nT,A}}$ | (A.5) |
| Aircraft noise, $L_{\mathrm{Aav},i}$ | Table A.2 | $D_{2\mathrm{m,nT,Atr}}$ | (A.6) |

The railway row is the one worth reading twice. Clause 3.1.3.4 point 1 says
that where railway noise dominates the facade is assessed in
$D_{2\mathrm{m,nT,A}}$ through formula (A.5), and only road traffic and aircraft give
$D_{2\mathrm{m,nT,Atr}}$ through (A.6); Table H.1 prints the same split. Because
Table A.4 is digit for digit Table A.3, a rail-dominant facade comes out at
the same *number* as a road one, but the quantity the requirement and the
report are stated in is not the same. That is why `d2m_nt_a()` and
`d2m_nt_atr()` are separate entry points and each refuses the other's
spectra, rather than one function with a spectrum switch that would silently
put the wrong name on the result.

All four are in `DB_HR_NORMALISED_SPECTRA` under the keys `"pink"`,
`"traffic"`, `"railway"` and `"aircraft"`. The calculation below reproduces
Ejemplo 7.2 of the *Manual*, the apparent sound reduction index $R'$ of a party
wall taken from a real field test report:

```python
from phonometry import building

r_prime = [36.2, 41.5, 36.9, 40.4, 44.7, 42.4, 45.7, 46.1, 47.1,
           52.3, 54.3, 57.5, 57.8, 57.3, 59.0, 62.8, 64.7, 65.3]
index = building.ra(r_prime)
index.value        # 51.44 dBA
index.intermediate # 51.4 dBA, the one-decimal intermediate
index.reported     # 51 dBA, the integer that defines the requirement
```

<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/jmrplens/phonometry/main/.github/images/dbhr_global_index_dark.svg"><img src="https://raw.githubusercontent.com/jmrplens/phonometry/main/.github/images/dbhr_global_index.svg" alt="CTE DB-HR global index R'A: per-band apparent sound reduction index as bars with the pink-noise weighted transmitted level per band, whose energy sum sets the 51.4 dBA index" width="80%"></picture>

<details>
<summary>Show the code for this figure</summary>

```python
import matplotlib.pyplot as plt
from phonometry import building

r_prime = [36.2, 41.5, 36.9, 40.4, 44.7, 42.4, 45.7, 46.1, 47.1,
           52.3, 54.3, 57.5, 57.8, 57.3, 59.0, 62.8, 64.7, 65.3]

building.ra(r_prime).plot()
plt.show()
```

</details>

`ra()`, `ra_tr()`, `dnt_a()`, `d2m_nt_a()` and `d2m_nt_atr()` are named shortcuts over
`db_hr_global_index()`, which accepts any spectrum and, given the
`frequencies` argument, selects the eighteen DB-HR bands out of a longer
series.

## Rounding and the relationship with the ISO 717 route

Clause 3.1.3.1 point 4 of DB-HR requires the final values of the quantities
that define the requirements to be expressed rounded to an integer, while
intermediate values are carried with one decimal. The result object therefore
exposes all three forms: `.value` (unrounded), `.intermediate` (one decimal)
and `.reported` (the integer used in the check).

DB-HR and ISO 717-1 reach the same place by different routes, and Annex H of
the document itself accepts three approximations as long as the two routes
differ by less than 1 dB:

$$
D_\mathrm{nT,A} \approx D_\mathrm{nT,w} + C \quad (H.1), \qquad
D_{2\mathrm{m,nT,A}} \approx D_{2\mathrm{m,nT,w}} + C \quad (H.2), \qquad
D_{2\mathrm{m,nT,Atr}} \approx D_{2\mathrm{m,nT,w}} + C_\mathrm{tr} \quad (H.3)
$$

with (H.2) covering the rail-dominant case of the previous section. On the two
published spectra this page reproduces, the agreement is exact to the integer:

| Case | Direct route (Annex A) | ISO 717-1 route | Published? |
| :--- | :--- | :--- | :--- |
| Separating wall of Ejemplo 7.2 | $R'_\mathrm{A} = 51.4$ dBA, rounded to 51 | $R'_\mathrm{w} = 52$ with $C_{100-5000} = -1$, i.e. 51 | yes, Ejemplo 7.1 prints $R'_\mathrm{w} = 52$, $C = -1$ and the 51 dBA |
| Facade of Ejercicio 7.1 | $D_{2\mathrm{m,nT,Atr}} = 32.8$ dBA, rounded to 33 | $D_{2\mathrm{m,nT,w}} = 38$ with $C_{\mathrm{tr},100-5000} = -5$, i.e. 33 | no, the book prints neither 38 nor $-5$ |

The two rows are not equally strong evidence. The wall row is a genuine
external check, because the *Manual* prints the ISO 717-1 numbers as well as
the direct one. For the facade the book publishes only the 32,8 dBA; the 38
and the $-5$ come from this library's own ISO 717-1 engine, so that row shows
the two routes agreeing with each other rather than agreeing with a source.

The real trap is the name of the spectrum adaptation terms. Annex H writes
them as plain $C$ and $C_\mathrm{tr}$ and refers their definition to
UNE-EN ISO 717-1 without narrowing the frequency range. Since the DB-HR
indices run to 5 kHz while the ISO 717-1 core range stops at 3150 Hz, the
terms that make (H.1) to (H.3) come out right are the **enlarged-range**
$C_{100-5000}$ and $C_{\mathrm{tr},100-5000}$; that reading is not in Annex H itself
but in the *Manual*, in the note to expressions [7.15] and [7.16]. It matters:
on the facade of Ejercicio 7.1 the core-range $C$ is $-2$ while $C_{100-5000}$
is $-1$, so taking the wrong one gives 36 dBA instead of 37 for the
$D_{2\mathrm{m,nT,A}}$ of that facade. On the same specimen $C_\mathrm{tr}$ and
$C_{\mathrm{tr},100-5000}$ are both $-5$, so the $D_{2\mathrm{m,nT,Atr}}$ that DB-HR actually
requires happens not to discriminate between the two readings at all.

```python
from phonometry import building, weighted_rating_extended

d2m_nt = [28.5, 28.5, 18.9, 23.7, 30.7, 31.3, 37.8, 35.2, 34.7,
          38.5, 37.7, 43.1, 42.3, 44.2, 41.9, 37.5, 39.4, 41.5]

direct = building.d2m_nt_atr(d2m_nt)
direct.intermediate, direct.reported   # 32.8 dBA -> 33 dBA

iso = weighted_rating_extended(d2m_nt, building.DB_HR_FREQUENCIES)
iso.rating, iso.ctr_100_5000           # 38 dB, -5 dB -> 33 dBA, the same figure
iso.c, iso.c_100_5000                  # -2 and -1: core range versus enlarged range
```

## The requirements of clause 2

DB-HR states its requirements on two kinds of room: the **protected room**
(*recinto protegido*, a habitable room with reinforced acoustic protection:
bedrooms, living areas, classrooms, operating theatres, professional offices)
and the **habitable room** (*recinto habitable*) in general.

**Facades (Table 2.1).** The requirement on $D_{2\mathrm{m,nT,Atr}}$ is read by bands of
the site's day noise index $L_\mathrm{d}$ ($L_\mathrm{d} \le 60$, $60 < L_\mathrm{d} \le 65$,
$65 < L_\mathrm{d} \le 70$, $70 < L_\mathrm{d} \le 75$ and $L_\mathrm{d} > 75$ dBA):

| Use and room | $\le 60$ | 60-65 | 65-70 | 70-75 | $> 75$ |
| :--- | ---: | ---: | ---: | ---: | ---: |
| Residential and hospital, bedrooms; cultural, health, educational and administrative, living areas | 30 | 32 | 37 | 42 | 47 |
| Residential and hospital, living areas; cultural, health, educational and administrative, classrooms | 30 | 30 | 32 | 37 | 42 |

Three rules modify the reading: a facade not directly exposed to the dominant
noise (an enclosed courtyard, a quiet surrounding) is assessed with $L_\mathrm{d}$
reduced by 10 dBA, where aircraft noise dominates the table value is increased
by 4 dBA, and where no official $L_\mathrm{d}$ exists for the site, 60 dBA is assumed
for residential acoustic areas.

**Airborne insulation between rooms (clause 2.1.1).** Partition walls
(*tabiquería*) within one use unit must have $R_\mathrm{A} \ge 33$ dBA. Against a room
of another use unit, a protected room requires $D_\mathrm{nT,A} \ge 50$ dBA and a
habitable room $\ge 45$ dBA; against a services or activity room, a protected
room requires $\ge 55$ dBA and a habitable room $\ge 45$ dBA. When the two
rooms share a door or a window, the requirement moves to the opening (sound
reduction index of 30 dBA for the protected room, 20 dBA for the habitable
one) and to the enclosure around it (50 dBA).

**Party walls (clause 2.1.1 c).** Against a *medianería* DB-HR offers two
**alternative** routes, not cumulative ones: either each of the two leaves
reaches $D_{2\mathrm{m,nT,Atr}} \ge 40$ dBA, or the two leaves taken together reach
$D_\mathrm{nT,A} \ge 50$ dBA. `db_hr_party_wall_requirement()` returns whichever route
is asked for.

**Impact sound (clause 2.1.2).** The standardized impact sound pressure level
$L'_\mathrm{nT,w}$ must not exceed 65 dB in a protected room against a room of another
use unit, nor 60 dB against a services or activity room; that same 60 dB limit
applies to the habitable room.

**Reverberation and absorption (clause 2.2).** The reverberation time must not
exceed 0.7 s in an empty classroom or conference hall under 350 m³, 0.5 s with
the fixed seating installed, or 0.9 s in empty restaurants and dining rooms. In
common areas sharing doors with protected rooms, the equivalent sound
absorption area must be at least 0.2 m² per cubic metre of volume.

```python
from phonometry import building

facade = building.db_hr_facade_requirement(65.0, "residential", "bedrooms")
facade.limit                                        # 32 dBA (Table 2.1)

airborne = building.db_hr_airborne_requirement("protected", "other_unit")
[(r.quantity, r.limit) for r in airborne]           # [("DnT,A", 50.0)]

building.db_hr_impact_requirement("protected", "other_unit").limit    # 65 dB
building.db_hr_party_wall_requirement().limit                         # 40 dBA per leaf
building.db_hr_party_wall_requirement("DnT,A").limit                  # 50 dBA both together
building.db_hr_reverberation_requirement("classroom").limit           # 0.7 s

check = building.assess_db_hr([(33.0, facade), (51.44, airborne[0])])
check.complies                                      # True
```

`check_db_hr_requirement()` rounds the achieved value the way DB-HR asks before
comparing it (to an integer for the dB quantities, to one decimal for the
reverberation time) and returns the margin; `assess_db_hr()` does the same over
a list of value-requirement pairs.

## Windows and composite facades

The tests that determine the sound reduction index of a window are run on
specimens of about 1.8 m², and a larger window insulates less. The *Catálogo de
Elementos Constructivos* of the building code corrects the catalogue value of
$R_\mathrm{A}$ and $R_\mathrm{A,tr}$ by total window area: 0 dB up to 2.7 m², $-1$ dB between
2.7 and 3.6 m², $-2$ dB between 3.6 and 4.6 m² and $-3$ dB above 4.6 m². A 4 m²
sliding window with 4-6-4 glazing, catalogued at $R_\mathrm{A} = 26$ dBA, ends up at
24 dBA (Ejemplo 7.4).

A real facade is not a homogeneous element: it has a blind part and one or more
openings. The sound reduction index of the whole follows from the
area-weighted sum of the transmittances, which is what
`composite_transmission_loss()` does in
[Predicting Panel Sound Insulation](https://jmrplens.github.io/phonometry/buildings/design/panel-sound-insulation/). With the 8 m²
facade of Ejemplo 7.5, a blind part of 40 dBA and a 2 m² window of 26 dBA, the
whole comes out at 31.5 dBA:

```python
from phonometry import building
from phonometry.building.prediction.aperture_transmission import composite_transmission_loss

building.window_size_correction(4.0)          # -2 dB: 26 dBA catalogued -> 24 dBA

composite_transmission_loss([6.0, 2.0], [40.0, 26.0])   # 31.53 dBA
composite_transmission_loss([6.0, 2.0], [50.0, 26.0])   # 31.97 dBA: +10 dBA on the blind part
composite_transmission_loss([6.0, 2.0], [40.0, 31.0])   # 35.63 dBA: +5 dBA on the window
```

Those last three lines hold the most useful rule of thumb in facade design:
improving the blind part by 10 dBA raises the overall insulation by 0.4 dBA,
practically nothing, whereas improving the window by 5 dBA raises it by
4.1 dBA, almost the full increment. The weak element is where the effort pays.

## Plots

`DbHrGlobalIndexResult.plot()` draws the band insulation together with the
transmitted level weighted by the normalised spectrum, as in the figure above:
it shows at a glance which bands dominate the energy sum, and therefore where
the element has to be improved. `DbHrAssessment.plot()` draws the achieved
values against their limits, one per checked requirement.

## What this guide covers

**Covered.** The DB-HR Annex A global index (Formulae A.5 to A.7) over the
eighteen bands from 100 Hz to 5 kHz with the four normalised spectra of Tables
A.2 to A.5, the rounding of clause 3.1.3.1 point 4, the requirements of clause
2 (Table 2.1 for facades, 2.1.1 airborne and party walls, 2.1.2 impact and 2.2
reverberation and absorption) and the window-size correction of the *Catálogo
de Elementos Constructivos*.

**Not covered.** The design options of clause 3 (the simplified option with its
solution tables, and the general option, which is the EN 12354 prediction) are
not implemented here: the calculation route of the general option lives in
[Predicting Sound Insulation (EN 12354)](https://jmrplens.github.io/phonometry/buildings/design/insulation-prediction/). The
execution conditions of clause 5 and the maintenance conditions of clause 6
are out of scope as well.

## Quick answers

### How does the DB-HR index RA differ from the Rw of ISO 717-1?

The $R_\mathrm{w}$ of ISO 717-1 comes from shifting a reference curve over sixteen
one-third-octave bands (100 Hz to 3150 Hz). The $R_\mathrm{A}$ of DB-HR comes from
weighting the band sound reduction index with a normalised pink-noise spectrum
and summing energetically over **eighteen** bands (100 Hz to 5 kHz). DB-HR
accepts the equivalence $R_\mathrm{A} \approx R_\mathrm{w} + C$, but that $C$ is the
enlarged-range term $C_{100-5000}$, not the core-range one.

## See also

- [Insulation Ratings (ISO 717)](https://jmrplens.github.io/phonometry/buildings/insulation/insulation-ratings/): the reference-curve
  route with $R_\mathrm{w}$, $C$, $C_\mathrm{tr}$ and the enlarged-range terms that DB-HR
  calls simply $C$ and $C_\mathrm{tr}$.
- [Spanish Noise Regulation (RD 1367/2007)](https://jmrplens.github.io/phonometry/environment/assessment/spanish-noise-regulation/): where
  the site's day noise index $L_\mathrm{d}$ that Table 2.1 is entered with comes from.
- [Façade Sound Insulation](https://jmrplens.github.io/phonometry/buildings/insulation/facade-insulation/): the ISO 16283-3 measurement
  of $D_{2\mathrm{m,nT}}$ and its EN 12354-3 prediction, which feed the $D_{2\mathrm{m,nT,Atr}}$ index of
  this page.
- [Predicting Panel Sound Insulation](https://jmrplens.github.io/phonometry/buildings/design/panel-sound-insulation/): the
  composite-facade calculation and transmission through openings and slits.
- [Field Insulation Measurement (ISO 16283)](https://jmrplens.github.io/phonometry/buildings/insulation/insulation-field/): the band
  spectra of $R'$, $D_\mathrm{nT}$ and $L'_\mathrm{nT}$ that these global quantities summarise.
- API reference: [`building.regulation.spain`](https://jmrplens.github.io/phonometry/reference/api/building/spain/).

## References

- Avilés López, R., & Perera Martín, R. (2017). *Manual de acústica ambiental
  y arquitectónica*. Paraninfo. ISBN 978-84-283-3814-1.
  Ejemplo 7.2 and Ejercicio 7.1 (pp. 394-395) are the numeric oracles of the
  global index on this page, and Ejemplos 7.4 and 7.5 (pp. 408-410) the
  window-size correction and the composite-facade calculation.
- Ministerio de la Presidencia (Spain). (2007). *Real Decreto 1367/2007,
  developing Ley 37/2003 del Ruido on acoustic zoning, quality objectives and
  acoustic emissions* (BOE-A-2007-18397).
  [BOE consolidated text](https://www.boe.es/buscar/act.php?id=BOE-A-2007-18397).
  The source of the day noise index $L_\mathrm{d}$ that Table 2.1 of DB-HR is read
  against.

## Standards

CTE Documento Básico HR *Protección frente al ruido*, the noise part of the
Spanish building code:
[codigotecnico.org](https://www.codigotecnico.org/pdf/Documentos/HR/DBHR.pdf).
The Annex A global index (Formulae A.5 to A.7) over the eighteen bands 100 Hz
to 5 kHz with the normalised spectra of Tables A.2 to A.5, the rounding rule of
clause 3.1.3.1 point 4, and the requirements of clause 2: Table 2.1 for
facades, 2.1.1 for airborne insulation and party walls, 2.1.2 for impact sound
and 2.2 for reverberation and absorption.
