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
c8bcb3cb
Commit
c8bcb3cb
authored
Dec 04, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Adding ISO 9613 header of air absorption / atmospheric attenuation
parent
d84daa74
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
c8bcb3cb
...
...
@@ -75,10 +75,11 @@ set( ITABaseHeader
"include/ITAFastMath.h"
"include/ITAFileSystemUtils.h"
"include/ITAFiniteImpulseResponse.h"
"include/ITAFunctors.h"
"include/ITAHDFTSpectra.h"
"include/ITAHDFTSpectrum.h"
"include/ITAFunctors.h"
"include/ITAInterpolation.h"
"include/ITAISO9613.h"
"include/ITALog.h"
"include/ITAMagnitudeSpectrum.h"
"include/ITAMultichannelFiniteImpulseResponse.h"
...
...
@@ -115,6 +116,7 @@ set( ITABaseSources
"src/ITAHDFTSpectra.cpp"
"src/ITAHDFTSpectrum.cpp"
"src/ITAInterpolation.cpp"
"src/ITAISO9613.cpp"
"src/ITALog.cpp"
"src/ITAMagnitudeSpectrum.cpp"
"src/ITAMultichannelFiniteImpulseResponse.cpp"
...
...
include/ITAISO9613.h
0 → 100644
View file @
c8bcb3cb
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_ISO_9613
#define INCLUDE_WATCHER_ITA_ISO_9613
// ITABase
#include
<ITABaseDefinitions.h>
#include
<ITAThirdOctaveMagnitudeSpectrum.h>
#include
<string>
namespace
ITABase
{
namespace
ISO9613
{
//! Calculates the atmospheric absorption after ISO 9613-1 for one frequency in decibels
/**
* Standard: ISO 9613-1:1993
*
* \param dFrequency Base frequency [Hz]
* \param fDistance Distance [m]
* \param fTemperature Temperature [C]
* \param fStaticPressure Static air pressure [Pa]
* \param fHumidity Relative humidity [%]
*
* @return Atmospheric absorption in dB
*/
double
AtmosphericAbsorption
(
double
dFrequency
,
double
dDistance
,
double
dTemperature
,
double
dStaticPressure
,
double
dHumidity
);
//! Calculates the atmospheric absorption after ISO 9613-1: A_{atm} (formula 8) in decibels
/**
* Standard: ISO 9613-1:1993
*
* \param oA_atm_dB Third-octave magnitude spectrum with atmospheric attenuation values in decibel
* \param fDistance Distance [m]
* \param fTemperature Temperature [C]
* \param fStaticPressure Static air pressure [Pa]
* \param fHumidity Relative humidity [%]
*/
void
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveDecibelMagnitudeSpectrum
&
oA_atm_dB
,
double
dDistance
,
double
dTemperature
,
double
dStaticPressure
,
double
dHumidity
);
//! Calculates the atmospheric absorption in linear factors (instead of decibels)
void
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveFactorMagnitudeSpectrum
&
oA_atm_factor
,
double
dDistance
,
double
dTemperature
,
double
dStaticPressure
,
double
dHumidity
);
}
}
#endif // INCLUDE_WATCHER_ITA_ISO_9613
src/ITAISO9613.cpp
0 → 100644
View file @
c8bcb3cb
#include
<ITAISO9613.h>
#include
<ITAConstants.h>
#include
<ITAException.h>
#include
<ITAThirdOctaveMagnitudeSpectrum.h>
#include
<cassert>
using
namespace
ITABase
;
using
namespace
ISO9613
;
void
AtmosphericAbsorption
(
ITABase
::
CThirdOctaveDecibelMagnitudeSpectrum
&
oA_atm_dB
,
double
dDistance
,
double
dTemperature
,
double
dStaticPressure
,
double
dHumidity
)
{
// @todo schleife ber freqs
}
double
AtmosphericAbsorption
(
double
dFrequency
,
double
dDistance
,
double
dTemperature
,
double
dStaticPressure
,
double
dHumidity
)
{
// ISO 9613-1 Acoustics - Attenuation of sound during propagation outdoors
// Noch nicht fertig ....
ITA_EXCEPT0
(
NOT_IMPLEMENTED
);
// Reference ambient atmospheric pressure (Standard Ambient Atmosphere) [kPa]
// (Referenzatmosphrendruck Umgebung nach ISO Standard)
const
double
p_r
=
101.325
f
;
const
double
p_a
=
101.325
f
;
// Inital sound pressure amplitude [kPa]
const
double
p_i
=
p_r
+
0.0
f
;
// Sound pressure amplitude [Pa]
const
double
p_t
=
1.0
f
;
// Reference air temperature [K]
const
double
T_0
=
273.15
f
+
20.0
f
;
// Temperature [K]
const
double
T
=
273.15
f
+
dTemperature
;
// Molar concentration dry air
const
double
tmp
=
(
10.79586
f
*
(
1.0
f
-
(
(
T_0
-
20.0
f
)
/
T
)
)
)
-
(
5.02808
f
*
log10
(
(
T
/
(
T_0
-
20.0
f
)
)
)
)
+
(
1.50474
f
*
0.0001
f
*
(
1.0
f
-
pow
(
(
double
)
10.0
f
,
(
-
8.29692
f
*
(
(
T
/
(
T_0
-
20.0
f
)
)
-
1.0
f
)
)
)
)
)
+
(
0.42873
f
*
0.001
f
*
(
-
1.0
f
+
pow
(
(
double
)
10.0
f
,
(
-
4.76955
f
*
(
1.0
f
-
(
(
T_0
-
20.0
f
)
/
T
)
)
)
)
)
)
-
2.2195983
f
;
// Molar concentration of water vapour [%] (Molekldichte Wasserdampf)
assert
(
0.0
f
<=
dHumidity
&&
dHumidity
<=
100.0
f
);
const
double
h
=
dHumidity
*
pow
(
(
double
)
10.0
f
,
tmp
)
/
(
p_a
/
p_r
);
// Equation (3)
const
double
f_r_o
=
(
p_a
/
p_r
)
*
(
24.0
f
+
4.04
f
*
10.0e4
*
h
*
(
0.02
f
+
h
)
/
(
0.391
f
+
h
)
);
// Equation (4)
const
double
f_r_n
=
(
p_a
/
p_r
)
*
pow
(
T
/
T_0
,
(
double
)
-
1.0
f
/
2.0
f
)
*
(
9.0
f
+
280.0
f
*
h
*
exp
(
-
4.710
f
*
(
pow
(
T
/
T_0
,
(
double
)
-
(
1
/
3.0
f
)
)
-
1.0
f
)
)
);
// Parts of Equation (5)
double
dAlpha1
=
8.686
f
*
pow
(
dFrequency
,
(
double
)
2.0
f
);
double
dAlpha2
=
1.84
f
*
10e-11
*
pow
(
p_a
/
p_r
,
(
double
)
-
1.0
f
)
*
pow
(
T
/
T_0
,
(
double
)
-
1.0
f
/
2.0
f
);
double
dAlpha3
=
pow
(
T
/
T_0
,
(
double
)
-
5.0
f
/
2.0
f
);
double
dAlpha4
=
0.01275
f
*
exp
(
-
2239.1
f
/
T
)
*
pow
(
f_r_o
+
pow
(
dFrequency
,
(
double
)
2.0
f
)
/
f_r_o
,
(
double
)
-
1.0
f
);
double
dAlpha5
=
0.10680
f
*
exp
(
-
3352.0
f
/
T
)
*
pow
(
f_r_n
+
pow
(
dFrequency
,
(
double
)
2.0
f
)
/
f_r_n
,
(
double
)
-
1.0
f
);
// Attenuation coefficient [dB/m], ~f, as assembly of Equation (5) parts
double
dAlpha
=
dAlpha1
*
(
dAlpha2
+
dAlpha3
*
(
dAlpha4
+
dAlpha5
)
);
// Resulting attenuation [dB], ~alpha (~f)
double
dAttenuationAirAbsorptionDecibel
=
dAlpha
*
dDistance
;
// Attenuation factor in decibel
return
dAttenuationAirAbsorptionDecibel
;
}
\ 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