NMPB08 Shared Libraries
Functions
PropagationNMPB08.cpp File Reference

Definition of the library functions that can be called by external software. More...

#include "PropagationNMPB08.h"
#include "CalculPropagation.h"
#include "SousCalculs/ElementaryPath.h"
#include <vector>
#include <math.h>
#include <stdio.h>

Go to the source code of this file.

Functions

bool CheckPath (PathID path)
 Check if the path is OK.
PathID NMPB08_CreatePath ()
 Creates path calculator with default frequency range.
PathID NMPB08_CreatePathEx (int nbFreq, double const *freq)
 Creates path calculator with user defined frequency range.
bool NMPB08_SetOption (PathID path, Option option, bool on_off)
 Set an option for the path.
int NMPB08_GetNbFrequencies (PathID path)
 Gets the frequencies number.
double const * NMPB08_GetFrequencies (PathID path)
 Gets the frequencies array.
bool NMPB08_DeletePath (PathID path)
 Delete the path calculator.
bool NMPB08_ClearPath (PathID path)
 clear the path profile
bool NMPB08_ExtendPath (PathID path, Position3D const *point3D, double g)
 Add a segment to the path profile.
bool NMPB08_ExtendPathExt (PathID path, Position3D const *point3D, double g, ExtensionNMPB const *ext)
 Add a segment to the path profile with extension data.
int NMPB08_SetSourceHeight (PathID path, double h)
 Set the source height.
int NMPB08_SetReceiverHeight (PathID path, double h)
 Set the receiver height.
int NMPB08_DoCalculation (PathID path)
 Do the propagation calculation.
double const * NMPB08_GetAttF (PathID path)
 Get path attenuations under favorable conditions.
double const * NMPB08_GetAttH (PathID path)
 Get path attenuations under homogeneous conditions.
double NMPB08_Leq_LT (double soundLevel_h, double soundLevel_f, double p)
 Calculates long-term sound level for the given the sound levels (homogeneous and favorable)
double NMPB08_SumLevels (int n, double const *levels)
 Calculates sound levels sum.
double NMPB08_GetFavorableConditionProbability (Position3D const *source, Position3D const *receiver, int nbAngles, const double *fcpAngles, double angleNorth)
 Calculates the favorable conditions probability for the (SR) direction.
int NMPB08_CalculateLeqLT (int nbFreq, double const *Lw, double const *attH, double const *attF, double fcp, double *LeqH, double *LeqF, double *LeqLT)
 Calculates the Long-term sound level Leq due to one source at point R, in each given frequency band.

Detailed Description

Definition of the library functions that can be called by external software.

Author:
CSTB
Version:
1.0

Definition in file PropagationNMPB08.cpp.


Function Documentation

bool CheckPath ( PathID  path)

Check if the path is OK.

Parameters:
paththe path
Returns:
true if all is OK

Definition at line 25 of file PropagationNMPB08.cpp.

int NMPB08_CalculateLeqLT ( int  nbFreq,
double const *  Lw,
double const *  attH,
double const *  attF,
double  fcp,
double *  LeqH,
double *  LeqF,
double *  LeqLT 
)

Calculates the Long-term sound level Leq due to one source at point R, in each given frequency band.

Parameters:
nbFreqThe frequencies number (user data)
LwThe sound power levels of the source, in each frequency band (user data)
attHAttenuations due to the propagation between source and receiver in homogeneous conditions, in each frequency band (user data)
attFAttenuations due to the propagation between source and receiver in downward-refraction conditions, in each frequency band (user data)
fcpProbability of occurrence of downward-refraction conditions over a long-term period in a given direction, p in [0, 1] (user data)
LeqHSound levels due to source Si at point R in homogeneous conditions, in each frequency band (calculated in this function)
LeqFSound levels due to source Si at point R in downward-refraction conditions, in each frequency band (calculated in this function)
LeqLTLong-term sound levels due to source Si at point R, in each given frequency band (calculated in this function)
Returns:
the exception number (0 if no exception)

Definition at line 682 of file PropagationNMPB08.cpp.

bool NMPB08_ClearPath ( PathID  path)

clear the path profile

Parameters:
pathThe path to clear
Returns:
true if all OK

Definition at line 214 of file PropagationNMPB08.cpp.

PathID NMPB08_CreatePath ( )

Creates path calculator with default frequency range.

Returns:
the new Propagation Path

Definition at line 41 of file PropagationNMPB08.cpp.

PathID NMPB08_CreatePathEx ( int  nbFreq,
double const *  freq 
)

Creates path calculator with user defined frequency range.

Parameters:
nbFreq: frequencies number
freq: frequencies values
Returns:
the new Propagation Path

Definition at line 74 of file PropagationNMPB08.cpp.

bool NMPB08_DeletePath ( PathID  path)

Delete the path calculator.

Parameters:
pathThe path to delete
Returns:
true if all OK

Definition at line 186 of file PropagationNMPB08.cpp.

int NMPB08_DoCalculation ( PathID  path)

Do the propagation calculation.

Parameters:
pathThe path to do propagation calculation
Returns:
the exception number (0 if no exception)

Definition at line 398 of file PropagationNMPB08.cpp.

bool NMPB08_ExtendPath ( PathID  path,
Position3D const *  point3D,
double  g 
)

Add a segment to the path profile.

Parameters:
pathThe path to add segment
point3DThe 3D coordinates to add
gThe impedance value for the segment before the added point
Returns:
true if all OK

Definition at line 247 of file PropagationNMPB08.cpp.

bool NMPB08_ExtendPathExt ( PathID  path,
Position3D const *  point3D,
double  g,
ExtensionNMPB const *  ext 
)

Add a segment to the path profile with extension data.

Parameters:
pathThe path to add segment.
point3DThe 3D coordinates to add
gThe impedance value for the segment before the added point
extThe extension data
Returns:
true if all OK

Definition at line 281 of file PropagationNMPB08.cpp.

double const* NMPB08_GetAttF ( PathID  path)

Get path attenuations under favorable conditions.

Parameters:
pathThe path to get attenuations
Returns:
the favorable attenuation for each frequency range

Definition at line 519 of file PropagationNMPB08.cpp.

double const* NMPB08_GetAttH ( PathID  path)

Get path attenuations under homogeneous conditions.

Parameters:
pathThe path to get attenuations
Returns:
the homogeneous attenuation for each frequency range

Definition at line 546 of file PropagationNMPB08.cpp.

double NMPB08_GetFavorableConditionProbability ( Position3D const *  source,
Position3D const *  receiver,
int  nbAngles,
const double *  fcpAngles,
double  angleNorth 
)

Calculates the favorable conditions probability for the (SR) direction.

Parameters:
sourceThe source position 3D
receiverThe receiver position 3D
nbAnglesThe number of angle probabilities (should be 18)
fcpAnglesThe favorable conditions probabilities for the angles 20, 40, 60, ..., 360
angleNorthThe north direction (Ox,ON)
Returns:
the favorable conditions probability for the (SR) direction

Definition at line 637 of file PropagationNMPB08.cpp.

double const* NMPB08_GetFrequencies ( PathID  path)

Gets the frequencies array.

Parameters:
pathThe path containing frequencies
Returns:
the frequencies array

Definition at line 159 of file PropagationNMPB08.cpp.

int NMPB08_GetNbFrequencies ( PathID  path)

Gets the frequencies number.

Parameters:
pathThe path containing frequencies
Returns:
the frequencies number

Definition at line 132 of file PropagationNMPB08.cpp.

double NMPB08_Leq_LT ( double  soundLevel_h,
double  soundLevel_f,
double  p 
)

Calculates long-term sound level for the given the sound levels (homogeneous and favorable)

Parameters:
soundLevel_h: sound level in homogeneous conditions
soundLevel_f: sound level in downward-refraction conditions
pThe average occurrence of downward-refraction conditions in the direction of the path
Returns:
the calculated sound level

Definition at line 577 of file PropagationNMPB08.cpp.

bool NMPB08_SetOption ( PathID  path,
Option  option,
bool  on_off 
)

Set an option for the path.

Parameters:
pathThe path to set the option
optionThe option to set
on_offTrue if the option must be set to true
Returns:
true if all OK

Definition at line 104 of file PropagationNMPB08.cpp.

int NMPB08_SetReceiverHeight ( PathID  path,
double  h 
)

Set the receiver height.

Parameters:
pathThe path to set receiver height
hThe receiver height
Returns:
the exception number (0 if no exception)

Definition at line 341 of file PropagationNMPB08.cpp.

int NMPB08_SetSourceHeight ( PathID  path,
double  h 
)

Set the source height.

Parameters:
pathThe path to set source height
hThe source height
Returns:
the exception number (0 if no exception)

Definition at line 311 of file PropagationNMPB08.cpp.

double NMPB08_SumLevels ( int  n,
double const *  levels 
)

Calculates sound levels sum.

Used for § 5.2.4 Formula (8) and § 5.2.5 Formula (9)

Parameters:
nthe sound levels number
levelsThe sound levels to sum
Returns:
the sum

Definition at line 605 of file PropagationNMPB08.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines