Module: ISO_1996::Part_2_2017

Includes:
Constants
Defined in:
lib/iso_1996/part_2_2017.rb

Overview

ISO 1996-2:2017 Acoustics - Description, measurement and assessment of environmental noise - Part 2: Determination of sound pressure levels

Module implementing calculations defined in ISO 1996-2:2017

Author:

  • Maciej Ciemborowicz

Since:

  • 2025-07-13

Defined Under Namespace

Modules: Constants

Class Method Summary collapse

Class Method Details

.atmospheric_absorption_correction(attenuation_coefficient, propagation_distance) ⇒ Float

Calculate atmospheric absorption correction (A_atm) as defined in Section 7.3 and Annex A

Parameters:

  • attenuation_coefficient (Float)

    Atmospheric attenuation coefficient (dB/m)

  • propagation_distance (Float)

    Sound propagation distance (m)

Returns:

  • (Float)

    Atmospheric absorption correction in dB

Since:

  • 2025-07-13



72
73
74
# File 'lib/iso_1996/part_2_2017.rb', line 72

def self.atmospheric_absorption_correction(attenuation_coefficient, propagation_distance)
  attenuation_coefficient * propagation_distance
end

.background_noise_correction(l_total, l_background) ⇒ Float

Note:

Correction is not applied when ΔL ≥ 10 dB

Calculate background noise correction (K₁) as defined in Section 6.3 and Annex D

where @math \Delta L = L_\mathrm{total} - L_\mathrm{background}

Examples:

Part_2_2017.background_noise_correction(65, 60) # => 1.7 dB

Parameters:

  • l_total (Float)

    Total sound pressure level (dB)

  • l_background (Float)

    Background sound pressure level (dB)

Returns:

  • (Float)

    Background noise correction in dB

Raises:

  • (ArgumentError)

    if ΔL ≤ 3 dB (measurement uncertain)

See Also:

Since:

  • 2025-07-13



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/iso_1996/part_2_2017.rb', line 51

def self.background_noise_correction(l_total, l_background)
  delta_l = l_total - l_background

  if delta_l <= Constants::MIN_BACKGROUND_LEVEL_DIFFERENCE
    raise ArgumentError, "Measurement uncertain: ΔL ≤ #{Constants::MIN_BACKGROUND_LEVEL_DIFFERENCE} dB"
  elsif delta_l >= Constants::BACKGROUND_CORRECTION_THRESHOLD
    0.0
  else
    -10 * Math.log10(1 - 10 ** (-0.1 * delta_l))
  end
end

.measurement_uncertainty(uncertainty_components) ⇒ Float

Calculate combined measurement uncertainty as defined in Section 9

Examples:

Part_2_2017.measurement_uncertainty([0.5, 1.0, 0.7]) # => 1.28 dB

Parameters:

  • uncertainty_components (Array<Float>)

    Array of uncertainty components (dB)

Returns:

  • (Float)

    Combined measurement uncertainty in dB

Since:

  • 2025-07-13



87
88
89
# File 'lib/iso_1996/part_2_2017.rb', line 87

def self.measurement_uncertainty(uncertainty_components)
  Math.sqrt(uncertainty_components.sum { |c| c ** 2 })
end