Module: ISO_1996::Part_1_2016

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

Overview

ISO 1996-1:2016 Acoustics - Description, measurement and assessment of environmental noise - Part 1: Basic quantities and assessment procedures

Module implementing calculations defined in ISO 1996-1:2016

Author:

  • Maciej Ciemborowicz

Since:

  • 2025-07-13

Defined Under Namespace

Modules: Constants

Class Method Summary collapse

Class Method Details

.assessment_level(l_aeq_t, k_t, k_i) ⇒ Float

Calculate assessment level (L_r) as defined in Section 3.6

Parameters:

  • l_aeq_t (Float)

    Equivalent continuous A-weighted sound pressure level (dB)

  • k_t (Float)

    Tonal adjustment factor (dB)

  • k_i (Float)

    Impulsive adjustment factor (dB)

Returns:

  • (Float)

    Assessment level in dB

Since:

  • 2025-07-13



203
204
205
# File 'lib/iso_1996/part_1_2016.rb', line 203

def self.assessment_level(l_aeq_t, k_t, k_i)
  l_aeq_t + k_t + k_i
end

.compliance_evaluation(assessment_level, noise_limit, measurement_uncertainty) ⇒ Boolean

Note:

Returns true when assessment_level > noise_limit + measurement_uncertainty

Evaluate compliance with noise limits as defined in Section 9.2

Parameters:

  • assessment_level (Float)

    Calculated assessment level (dB)

  • noise_limit (Float)

    Applicable noise limit (dB)

  • measurement_uncertainty (Float)

    Measurement uncertainty (dB)

Returns:

  • (Boolean)

    True if limit is exceeded

Since:

  • 2025-07-13



217
218
219
# File 'lib/iso_1996/part_1_2016.rb', line 217

def self.compliance_evaluation(assessment_level, noise_limit, measurement_uncertainty)
  assessment_level > noise_limit + measurement_uncertainty
end

.day_evening_night_level(l_day, l_evening, l_night, day_duration: Constants::DAY_DURATION, evening_duration: Constants::EVENING_DURATION, night_duration: Constants::NIGHT_DURATION, evening_penalty: Constants::EVENING_PENALTY, night_penalty: Constants::NIGHT_PENALTY) ⇒ Float

Calculate day-evening-night level (L_den) as defined in Annex C.2

Examples:

Standard case

Part_1_2016.day_evening_night_level(65.0, 62.0, 58.0) # => ~67.1

Parameters:

  • l_day (Float)

    Day-time equivalent sound level (dB)

  • l_evening (Float)

    Evening-time equivalent sound level (dB)

  • l_night (Float)

    Night-time equivalent sound level (dB)

  • day_duration (Float) (defaults to: Constants::DAY_DURATION)

    Duration of day period (hours)

  • evening_duration (Float) (defaults to: Constants::EVENING_DURATION)

    Duration of evening period (hours)

  • night_duration (Float) (defaults to: Constants::NIGHT_DURATION)

    Duration of night period (hours)

  • evening_penalty (Float) (defaults to: Constants::EVENING_PENALTY)

    Penalty for evening period (dB)

  • night_penalty (Float) (defaults to: Constants::NIGHT_PENALTY)

    Penalty for night period (dB)

Returns:

  • (Float)

    Day-evening-night level in dB

Since:

  • 2025-07-13



142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/iso_1996/part_1_2016.rb', line 142

def self.day_evening_night_level(l_day, l_evening, l_night,
                                day_duration: Constants::DAY_DURATION,
                                evening_duration: Constants::EVENING_DURATION,
                                night_duration: Constants::NIGHT_DURATION,
                                evening_penalty: Constants::EVENING_PENALTY,
                                night_penalty: Constants::NIGHT_PENALTY)
  total_hours = day_duration + evening_duration + night_duration
  
  term_day = day_duration * 10 ** (l_day / 10.0)
  term_evening = evening_duration * 10 ** ((l_evening + evening_penalty) / 10.0)
  term_night = night_duration * 10 ** ((l_night + night_penalty) / 10.0)
  
  10 * Math.log10((term_day + term_evening + term_night) / total_hours)
end

.equivalent_continuous_sound_level(levels, measurement_time) ⇒ Float

Calculate equivalent continuous sound level (L_Aeq,T) as defined in Section 3.1.7

Examples:

Calculate for 3 measurements

levels = [65.0, 67.0, 63.0]
Part_1_2016.equivalent_continuous_sound_level(levels, 3.0) # => ~65.1

Parameters:

  • levels (Array<Float>)

    Array of sound pressure levels (dB)

  • measurement_time (Float)

    Total measurement time (seconds)

Returns:

  • (Float)

    Equivalent continuous sound level in dB

Raises:

  • (ArgumentError)

    if measurement_time is not positive

Since:

  • 2025-07-13



104
105
106
107
108
109
110
# File 'lib/iso_1996/part_1_2016.rb', line 104

def self.equivalent_continuous_sound_level(levels, measurement_time)
  raise ArgumentError, "Measurement time must be positive" if measurement_time <= 0
  return -Float::INFINITY if levels.empty?

  energy_sum = levels.sum { |l| 10 ** (l / 10.0) }
  10 * Math.log10(energy_sum / measurement_time)
end

.impulsive_adjustment_factor(is_audible: false, is_distinct: false) ⇒ Float

Note:

According to Annex D.4: - Distinct impulsive sound: 6 dB - Clearly audible but not distinct: 3 dB - Not clearly audible: 0 dB

Determine impulsive adjustment factor (K_I) as defined in Annex D.4

Parameters:

  • is_audible (Boolean) (defaults to: false)

    Whether the impulsive sound is clearly audible

  • is_distinct (Boolean) (defaults to: false)

    Whether the impulsive sound is distinct

Returns:

  • (Float)

    Impulsive adjustment factor in dB (0.0, 3.0, or 6.0)

Since:

  • 2025-07-13



187
188
189
190
191
# File 'lib/iso_1996/part_1_2016.rb', line 187

def self.impulsive_adjustment_factor(is_audible: false, is_distinct: false)
  return 0.0 unless is_audible
  return 6.0 if is_distinct
  3.0
end

.peak_sound_pressure_level(p_c_max) ⇒ Float

Calculate peak sound pressure level (L_pC,peak) as defined in Section 3.1.10

Parameters:

  • p_c_max (Float)

    Maximum C-weighted sound pressure (Pa)

Returns:

  • (Float)

    Peak sound pressure level in dB

Since:

  • 2025-07-13



120
121
122
# File 'lib/iso_1996/part_1_2016.rb', line 120

def self.peak_sound_pressure_level(p_c_max)
  20 * Math.log10(p_c_max / Constants::REFERENCE_SOUND_PRESSURE)
end

.sound_exposure_level(p_a) ⇒ Float

Note:

This method assumes a single value for simplicity. For time-varying signals, integration over time is required.

Calculate sound exposure level (L_AE) as defined in Section 3.1.8

Parameters:

  • p_a (Float)

    A-weighted sound pressure (Pa)

Returns:

  • (Float)

    Sound exposure level in dB

Since:

  • 2025-07-13



86
87
88
# File 'lib/iso_1996/part_1_2016.rb', line 86

def self.sound_exposure_level(p_a)
  10 * Math.log10((1.0 / Constants::REFERENCE_TIME) * (p_a ** 2) / (Constants::REFERENCE_SOUND_PRESSURE ** 2))
end

.sound_pressure_level(p) ⇒ Float

Calculate sound pressure level (L_p) as defined in Section 3.1.2

Examples:

Calculate for 0.1 Pa

Part_1_2016.sound_pressure_level(0.1) # => 74.0

Parameters:

  • p (Float)

    Root-mean-square sound pressure (Pa)

Returns:

  • (Float)

    Sound pressure level in dB

Since:

  • 2025-07-13



71
72
73
# File 'lib/iso_1996/part_1_2016.rb', line 71

def self.sound_pressure_level(p)
  10 * Math.log10((p ** 2) / (Constants::REFERENCE_SOUND_PRESSURE ** 2))
end

.tonal_adjustment_factor(is_audible: false, is_prominent: false) ⇒ Float

Note:

According to Annex D.3: - Prominent tone: 6 dB - Clearly audible but not prominent: 3 dB - Not clearly audible: 0 dB

Determine tonal adjustment factor (K_T) as defined in Annex D.3

Parameters:

  • is_audible (Boolean) (defaults to: false)

    Whether the tone is clearly audible

  • is_prominent (Boolean) (defaults to: false)

    Whether the tone is prominent

Returns:

  • (Float)

    Tonal adjustment factor in dB (0.0, 3.0, or 6.0)

Since:

  • 2025-07-13



169
170
171
172
173
# File 'lib/iso_1996/part_1_2016.rb', line 169

def self.tonal_adjustment_factor(is_audible: false, is_prominent: false)
  return 0.0 unless is_audible
  return 6.0 if is_prominent
  3.0
end