Class AttenuationParameters
java.lang.Object
org.noise_planet.noisemodelling.propagation.AttenuationParameters
Data input for a propagation Path process.
- Author:
- Pierre Aumond, Judicaël Picaut, UMRAE
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubledouble[]doubleRepresents the default speed of sound in air under standard conditions, measured in meters per second.doublestatic final doublestatic final doubleFrequency bands values, by third octavebooleandouble[]double[]double[]Frequency power terms of the ground effect equation (2.5.15), one value per frequency banddoubleRepresents the relative humidity in percentage, ranging from 0 to 100.static final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doubledoubleStandard atmosphere atm (Pa)booleandoubleTemperature in celsiusprobability occurrence favourable condition -
Constructor Summary
ConstructorsConstructorDescriptionAttenuationParameters(boolean thirdOctave) AttenuationParameters(List<Integer> freq_lvl, List<Double> freq_lvl_exact, List<Double> freq_lvl_a_weighting) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]Converts a java.sql.Array to a double[] array.static doublegetAlpha(double frequency, double temperature, double pressure, double humidity) ISO-9613 p1double[]get the atmospheric attenuation coefficient in dB/km at the nominal centre frequency for each frequency band, in accordance with ISO 9613-1.static double[]getAtmoCoeffArray(List<Double> freq_lvl, double temperature, double pressure, double humidity) doublestatic doublegetCoefAttAtmos(double frequency, double humidity, double pressure, double T_kel) Compute AAtmstatic doublegetCoefAttAtmosCnossos(double freq, double humidity, double pressure, double T_kel) static doublegetCoefAttAtmosSpps(double frequency, double humidity, double pressure, double tempKelvin) This function calculates the atmospheric attenuation coefficient of sound in air ISO 9613-1:1993(F)doubledoubledoubledoubleReturns the wind rose for favourable probability calculations.protected voidinit()booleanisgDisc()booleanstatic voidparseFavourableProbabilityString(String occurrence, AttenuationParameters params) static voidreadFromDatabase(ResultSet rs, Map<String, AttenuationParameters> cnossosParametersPerPeriod) Reads attenuation parameters from a database ResultSet and populates a map with these parameters for different periods.voidsetDefaultOccurrence(double defaultOccurrence) voidsetFrequencies(List<Integer> freq_lvl) voidsetgDisc(boolean gDisc) setGDisc(boolean gDisc) setHumidity(double humidity) Set relative humidity in percentage.setPressure(double pressure) setPrime2520(boolean prime2520) setTemperature(double temperature) voidsetWindRose(FavourableProbability windRose) Sets the wind rose for favourable probability calculations.voidwriteToDatabase(Connection connection, String tableName, String period) Writes the attenuation parameters to an H2 database table.
-
Field Details
-
K_0
public static final double K_0- See Also:
-
Pref
public static final double Pref- See Also:
-
Kref
public static final double Kref- See Also:
-
FmolO
public static final double FmolO- See Also:
-
FmolN
public static final double FmolN- See Also:
-
KvibO
public static final double KvibO- See Also:
-
KvibN
public static final double KvibN- See Also:
-
K01
public static final double K01- See Also:
-
a8
public static final double a8 -
freq_lvl
-
freq_lvl_exact
-
freq_lvl_a_weighting
-
temperature
public double temperatureTemperature in celsius -
celerity
public double celerityRepresents the default speed of sound in air under standard conditions, measured in meters per second. The value is typically used as a constant for computations requiring the speed of sound. Standard conditions assume a temperature of 15°C at sea level atmospheric pressure. -
humidity
public double humidityRepresents the relative humidity in percentage, ranging from 0 to 100. This variable is utilized in various calculations related to atmospheric attenuation and sound propagation. -
pressure
public double pressureStandard atmosphere atm (Pa) -
alpha_atmo
public double[] alpha_atmo -
groundFm25
public double[] groundFm25Frequency power terms of the ground effect equation (2.5.15), one value per frequency band -
groundFm15
public double[] groundFm15 -
groundFm075
public double[] groundFm075 -
defaultOccurrence
public double defaultOccurrence -
gDisc
public boolean gDisc -
prime2520
public boolean prime2520 -
windRose
probability occurrence favourable condition
-
-
Constructor Details
-
AttenuationParameters
public AttenuationParameters() -
AttenuationParameters
public AttenuationParameters(boolean thirdOctave) -
AttenuationParameters
-
AttenuationParameters
-
-
Method Details
-
init
protected void init() -
getFrequencies
-
setFrequencies
-
getFrequenciesExact
-
getFrequenciesAWeighting
-
setHumidity
Set relative humidity in percentage.- Parameters:
humidity- relative humidity in percentage. 0-100
-
setPressure
-
getWindRose
Returns the wind rose for favourable probability calculations.- Returns:
- the favourable probability interface
-
setWindRose
Sets the wind rose for favourable probability calculations.- Parameters:
windRose- the favourable probability interface
-
getTemperature
public double getTemperature() -
getCelerity
public double getCelerity() -
getHumidity
public double getHumidity() -
getPressure
public double getPressure() -
isPrime2520
public boolean isPrime2520() -
isgDisc
public boolean isgDisc() -
setgDisc
public void setgDisc(boolean gDisc) -
getDefaultOccurrence
public double getDefaultOccurrence()- Returns:
- Default favourable probability (0-1)
-
setDefaultOccurrence
public void setDefaultOccurrence(double defaultOccurrence) - Parameters:
defaultOccurrence- Default favourable probability (0-1)
-
setGDisc
-
setPrime2520
-
setTemperature
- Parameters:
temperature- Temperature in ° celsius
-
getAtmoCoeffArray
-
getAlpha_atmo
public double[] getAlpha_atmo()get the atmospheric attenuation coefficient in dB/km at the nominal centre frequency for each frequency band, in accordance with ISO 9613-1.- Returns:
- alpha_atmo
-
getCoefAttAtmosCnossos
public static double getCoefAttAtmosCnossos(double freq, double humidity, double pressure, double T_kel) - Parameters:
freq- Frequency (Hz)humidity- Humidity %pressure- Pressure in pascalT_kel- Temperature in kelvin- Returns:
- Atmospheric absorption dB/km
-
getCoefAttAtmos
public static double getCoefAttAtmos(double frequency, double humidity, double pressure, double T_kel) Compute AAtm- Parameters:
frequency- Frequency (Hz)humidity- Humidity %pressure- Pressure in pascalT_kel- Temperature in kelvin- Returns:
- Atmospheric absorption dB/km
-
getCoefAttAtmosSpps
public static double getCoefAttAtmosSpps(double frequency, double humidity, double pressure, double tempKelvin) This function calculates the atmospheric attenuation coefficient of sound in air ISO 9613-1:1993(F)- Parameters:
frequency- acoustic frequency (Hz)humidity- relative humidity (in %) (0-100)pressure- atmospheric pressure (in Pa)tempKelvin- Temperature in Kelvin (in K)- Returns:
- atmospheric attenuation coefficient (db/km)
-
getAlpha
public static double getAlpha(double frequency, double temperature, double pressure, double humidity) ISO-9613 p1- Parameters:
frequency- acoustic frequency (Hz)temperature- Temperative in celsiuspressure- atmospheric pressure (in Pa)humidity- relative humidity (in %) (0-100)- Returns:
- Attenuation coefficient dB/KM
-
writeToDatabase
public void writeToDatabase(Connection connection, String tableName, String period) throws SQLException Writes the attenuation parameters to an H2 database table. If the specified table does not exist, it will create the table. Then it inserts or merges the data into the table for the given period.- Parameters:
connection- the database connection to the H2 instancetableName- the name of the table in the databaseperiod- the time period for which the parameters are being saved- Throws:
SQLException- if a database access error occurs
-
readFromDatabase
public static void readFromDatabase(ResultSet rs, Map<String, AttenuationParameters> cnossosParametersPerPeriod) throws SQLException Reads attenuation parameters from a database ResultSet and populates a map with these parameters for different periods.- Parameters:
rs- the ResultSet object containing the query results with attenuation parameterscnossosParametersPerPeriod- a map to store the attenuation parameters indexed by the corresponding period- Throws:
SQLException- if a database access error occurs or if the wind rose array length does not match the expected default length
-
parseFavourableProbabilityString
public static void parseFavourableProbabilityString(String occurrence, AttenuationParameters params) throws SQLException - Throws:
SQLException
-
convertSqlArrayToDoubleArray
Converts a java.sql.Array to a double[] array.- Parameters:
array- the SQL Array containing double values- Returns:
- a double[] array or an empty array if the input is null
- Throws:
SQLException- if a database access error occurs
-