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

Date

July 13, 2025

Defined Under Namespace

Modules: Constants

Constant Summary

Constants included from Constants

Constants::BACKGROUND_CORRECTION_THRESHOLD, Constants::MIN_BACKGROUND_LEVEL_DIFFERENCE

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

A_atm = α * d dB

Parameters:

  • attenuation_coefficient (Float)

    Atmospheric attenuation coefficient (dB/m)

  • propagation_distance (Float)

    Sound propagation distance (m)

Returns:

  • (Float)

    Atmospheric absorption correction in dB



65
66
67
# File 'lib/iso_1996/part_2_2017.rb', line 65

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

.background_noise_correction(l_total, l_background) ⇒ Float

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

K₁ = -10 * log10(1 - 10^(-0.1 * ΔL)) dB where ΔL = L_total - L_background

Example:

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)



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/iso_1996/part_2_2017.rb', line 44

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

u_total = √(Σ(u_i²)) dB

Example:

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



80
81
82
# File 'lib/iso_1996/part_2_2017.rb', line 80

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