Package PamController.soundMedium
Class GlobalMedium
java.lang.Object
PamController.soundMedium.GlobalMedium
Defines the assumed medium that sound is propogating through i.e. water or
air.
Other mediums may be added by adding a new enum and modifying switch
statements. For example if PAMGuard is used in any space missions to the water
moons of Saturn or perhaps someone wants to see how well a dolphin swims
through custard.
- Author:
- Jamie Macaulay
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getdBreference
(GlobalMedium.SoundMedium currentMedium) Get the reference unit commonly used for this medium e.g.static String
getdBRefString
(GlobalMedium.SoundMedium currentMedium) Get a string description of the Pascal reference for the dBstatic double
getdBSensOffset
(GlobalMedium.SoundMedium currentMedium) Get the dB offset to convert form sensitivity value units to received amplitude units.static String
getdBSensRefString
(GlobalMedium.SoundMedium currentMedium) Get a string description of the Pascal reference for receiver sensitivities in dB.static double[]
getDefaultAmplitudeScales
(GlobalMedium.SoundMedium currentMedium) Get default amplitude scales for display for different mediumstatic double[]
getDefaultdBHzScales
(GlobalMedium.SoundMedium currentMedium) Get default dB/Hz scales for display for different mediumstatic double
getDefaultSens
(GlobalMedium.SoundMedium currentMedium) Get the default sensitivity of a reciever in dB referenced to the medium dependent reference value.static double
getDefaultSoundSpeed
(GlobalMedium.SoundMedium currentMedium) Get the default sound speed for the medium.static String
getRecieverString
(GlobalMedium.SoundMedium currentMedium, boolean caps, boolean plural) Hydrophones are used under water and microphones in air.static String
getToolTip
(GlobalMedium.SoundMedium currentMedium) static double
getZCoeff
(GlobalMedium.SoundMedium currentMedium) Get the z coefficient value for displays.static String
getZString
(GlobalMedium.SoundMedium currentMedium, boolean caps, boolean plural) Get a string description of the z dimensions e.g.
-
Constructor Details
-
GlobalMedium
public GlobalMedium()
-
-
Method Details
-
getDefaultSoundSpeed
Get the default sound speed for the medium.- Parameters:
currentMedium
- - the current medium.- Returns:
- the default sound speed in meters per second.
-
getdBreference
Get the reference unit commonly used for this medium e.g. 1uPa in water and 20uPa in air- Returns:
- the reference unit commonly used for the medium.
-
getDefaultSens
Get the default sensitivity of a reciever in dB referenced to the medium dependent reference value. This will be highly variable but just to get in a few tens of dB of where it should.- Returns:
- the reference unit commonly used for the medium.
-
getRecieverString
public static String getRecieverString(GlobalMedium.SoundMedium currentMedium, boolean caps, boolean plural) Hydrophones are used under water and microphones in air. Need to change these words around...- Parameters:
currentMedium
- - the current medium e.g. water, air.caps
- true to capitalise the first letter of the string.plural
- - true to pluralise the string.- Returns:
- the string describing the reciever.
-
getToolTip
-
getZString
public static String getZString(GlobalMedium.SoundMedium currentMedium, boolean caps, boolean plural) Get a string description of the z dimensions e.g. depth or height.- Parameters:
currentMedium
- - the current medium e.g. water, air.caps
- true to capitalise the first letter of the string.plural
- - true to pluralise the string.- Returns:
- the string description of the Z dimensions
-
getdBSensRefString
Get a string description of the Pascal reference for receiver sensitivities in dB.- Parameters:
currentMedium
- - the current medium. return string of dB reference
-
getdBSensOffset
Get the dB offset to convert form sensitivity value units to received amplitude units. Sensitivity values in PG are always stored in the same reference as received amplitude. However they may be different units in the display because terrestrial acoustics is annoying.Add this to input from display to get stored unit. Subtract to get display units.
- Parameters:
currentMedium
- - the current medium.- Returns:
- the daB offset.
-
getdBRefString
Get a string description of the Pascal reference for the dB- Parameters:
currentMedium
- - the current medium.- Returns:
- string of dB reference
-
getZCoeff
Get the z coefficient value for displays. Height are always stored so that +z points up (i.e. -g). In display height is input as depth as so must be multiplied by -1 before being stored. In air height is more sensible to think of as +z and so does not need multiplied (or multiplied by 1). The height coefficient is the value height inputs are multiplied before being stored. @see getZString- Parameters:
currentMedium
- - the current medium.- Returns:
- the height coefficient.
-
getDefaultAmplitudeScales
Get default amplitude scales for display for different medium- Parameters:
currentMedium
- - the current medium.- Returns:
- the minimum and maximum amplitude in dB
-
getDefaultdBHzScales
Get default dB/Hz scales for display for different medium- Parameters:
currentMedium
- - the current medium.- Returns:
- the minimum and maximum amplitude in dB/Hz
-