Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITABase
Commits
3f32d1b5
Commit
3f32d1b5
authored
Dec 05, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Renaming ISO 9613 air attenuation functions
parent
d52c746c
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ITAISO9613.h
View file @
3f32d1b5
...
...
@@ -67,10 +67,10 @@ namespace ITABase
* \param fHumidity Relative humidity [%]
* \param fStaticPressure Static air pressure [kPa]
*/
ITA_BASE_API
void
AtmosphericAbsorption
Level
(
ITABase
::
CThirdOctaveDecibelMagnitudeSpectrum
&
oA_atm_dB
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
=
101.325
);
ITA_BASE_API
void
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveDecibelMagnitudeSpectrum
&
oA_atm_dB
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
=
101.325
);
//! Calculates the atmospheric absorption in linear factors (instead of decibels)
ITA_BASE_API
void
AtmosphericAbsorption
Factor
(
ITABase
::
CThirdOctaveFactorMagnitudeSpectrum
&
oA_atm_factor
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
=
101.325
);
ITA_BASE_API
void
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveFactorMagnitudeSpectrum
&
oA_atm_factor
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
=
101.325
);
}
}
...
...
src/ITAISO9613.cpp
View file @
3f32d1b5
...
...
@@ -9,7 +9,7 @@
using
namespace
ITABase
;
double
ISO9613
::
AtmosphericAbsorptionLevel
(
double
dFrequency
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
double
ISO9613
::
AtmosphericAbsorptionLevel
(
double
dFrequency
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
{
// ISO 9613-1 Acoustics - Attenuation of sound during propagation outdoors
...
...
@@ -18,20 +18,20 @@ double ISO9613::AtmosphericAbsorptionLevel( double dFrequency, double dDistance,
const
double
p_r
=
101.325
f
;
// Ambient atmospheric pressure [kPa]
const
double
p_a
=
dStaticPressure
;
const
double
p_a
=
dStaticPressure
;
// Reference air temperature [K]
const
double
T_0
=
273.15
+
20.0
;
// Temperature [K] used for equation (B.3)
const
double
T_01
=
273.15
+
0.01
;
const
double
T_01
=
273.15
+
0.01
;
// Ambient atmospheric temperature [K]
const
double
T
=
273.15
+
dTemperature
;
// Equations (B.3) and (B.2) of Annex B used for calculation of h in (B.1)
const
double
C
=
-
6.8346
*
pow
(
T_01
/
T
,
1.261
)
+
4.6151
;
const
double
p_sat_p_r
=
pow
(
(
double
)
10.0
f
,
C
);
const
double
C
=
-
6.8346
*
pow
(
T_01
/
T
,
1.261
)
+
4.6151
;
const
double
p_sat_p_r
=
pow
(
(
double
)
10.0
f
,
C
);
// Molar concentration of water vapour [%] (Molekldichte Wasserdampf)
// Equation (B.2)
...
...
@@ -45,7 +45,7 @@ double ISO9613::AtmosphericAbsorptionLevel( double dFrequency, double dDistance,
// Nitrogen relaxation frequency [Hz]
// Equation (4)
const
double
f_r_n
=
(
p_a
/
p_r
)
*
pow
(
T
/
T_0
,
-
1.0
/
2.0
)
*
(
9.0
f
+
280.0
*
h
*
exp
(
-
4.710
*
(
pow
(
T
/
T_0
,
-
(
1
/
3.0
)
)
-
1.0
)
)
);
// Parts of Equation (5) for the calculation of the attenuation coefficient [dB/m]
double
dAlpha1
=
8.686
*
pow
(
dFrequency
,
2.0
);
double
dAlpha2
=
1.84e-11
*
pow
(
p_a
/
p_r
,
-
1.0
)
*
pow
(
T
/
T_0
,
1.0
/
2.0
);
...
...
@@ -64,34 +64,34 @@ double ISO9613::AtmosphericAbsorptionLevel( double dFrequency, double dDistance,
return
dAirAbsorptionDecibel
;
}
double
ISO9613
::
AtmosphericAbsorptionFactor
(
double
dFrequency
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
double
ISO9613
::
AtmosphericAbsorptionFactor
(
double
dFrequency
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
{
double
dAirAbsorptionDecibel
=
AtmosphericAbsorptionLevel
(
dFrequency
,
dDistance
,
dTemperature
,
dHumidity
,
dStaticPressure
);
double
dAirAbsorptionDecibel
=
AtmosphericAbsorptionLevel
(
dFrequency
,
dDistance
,
dTemperature
,
dHumidity
,
dStaticPressure
);
//Factor of absorped signal energy [0:1]
double
dAirAbsorptionFactor
=
1
-
pow
(
10
,
-
dAirAbsorptionDecibel
/
10.0
);
double
dAirAbsorptionFactor
=
1
-
pow
(
10
,
-
dAirAbsorptionDecibel
/
10.0
);
return
dAirAbsorptionFactor
;
}
void
ISO9613
::
AtmosphericAbsorption
Level
(
ITABase
::
CThirdOctaveDecibelMagnitudeSpectrum
&
oA_atm_dB
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
void
ISO9613
::
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveDecibelMagnitudeSpectrum
&
oA_atm_dB
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
{
// loop over all frequencies
for
(
int
i
=
0
;
i
<
oA_atm_dB
.
GetNumBands
();
i
++
)
for
(
int
i
=
0
;
i
<
oA_atm_dB
.
GetNumBands
();
i
++
)
{
double
dFrequency
=
(
double
)
oA_atm_dB
.
GetCenterFrequencies
()[
i
];
double
dAirAbsorptionDecibel
=
AtmosphericAbsorptionLevel
(
dFrequency
,
dDistance
,
dTemperature
,
dHumidity
,
dStaticPressure
);
oA_atm_dB
.
SetMagnitude
(
i
,
(
float
)
dAirAbsorptionDecibel
);
double
dFrequency
=
(
double
)
oA_atm_dB
.
GetCenterFrequencies
()[
i
];
double
dAirAbsorptionDecibel
=
AtmosphericAbsorptionLevel
(
dFrequency
,
dDistance
,
dTemperature
,
dHumidity
,
dStaticPressure
);
oA_atm_dB
.
SetMagnitude
(
i
,
(
float
)
dAirAbsorptionDecibel
);
}
}
void
ISO9613
::
AtmosphericAbsorption
Factor
(
ITABase
::
CThirdOctaveFactorMagnitudeSpectrum
&
oA_atm_factor
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
void
ISO9613
::
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveFactorMagnitudeSpectrum
&
oA_atm_factor
,
double
dDistance
,
double
dTemperature
,
double
dHumidity
,
double
dStaticPressure
/*= 101.325*/
)
{
// loop over all frequencies and converting from decibel to a factor between 0 and 1
for
(
int
i
=
0
;
i
<
oA_atm_factor
.
GetNumBands
();
i
++
)
for
(
int
i
=
0
;
i
<
oA_atm_factor
.
GetNumBands
();
i
++
)
{
double
dFrequency
=
(
double
)
oA_atm_factor
.
GetCenterFrequencies
()[
i
];
double
dAirAbsorptionFactor
=
AtmosphericAbsorptionFactor
(
dFrequency
,
dDistance
,
dTemperature
,
dHumidity
,
dStaticPressure
);
oA_atm_factor
.
SetMagnitude
(
i
,
(
float
)
dAirAbsorptionFactor
);
double
dFrequency
=
(
double
)
oA_atm_factor
.
GetCenterFrequencies
()[
i
];
double
dAirAbsorptionFactor
=
AtmosphericAbsorptionFactor
(
dFrequency
,
dDistance
,
dTemperature
,
dHumidity
,
dStaticPressure
);
oA_atm_factor
.
SetMagnitude
(
i
,
(
float
)
dAirAbsorptionFactor
);
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment