Class Hyperbolic
java.lang.Object
Localiser.algorithms.timeDelayLocalisers.hyperbolic.Hyperbolic
- All Implemented Interfaces:
 TimeDelayLocaliserModel
Hyperbolic localisation attempts to localise using the INVERSE problem. i.e. it directly solves a set of simple arithmetic equations
 to find the position of source from time delays 
 
The hyperbolic localiser also includes an error estimation by sampling time delays from a distribution of errors. As a localisation has to occur for each sample, this drastically increases the computational time for the hyperbolic localiser.
- Author:
 - Jamie Macaulay
 
- 
Field Summary
FieldsModifier and TypeFieldDescription - 
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance of a hyperbolic localiser.Hyperbolic(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray, ArrayList<ArrayList<Double>> timeDelays, ArrayList<ArrayList<Double>> timeDelayErrors, float speedOfSound) Create an instance of a hyperbolic localiser.Hyperbolic(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray, ArrayList<ArrayList<Double>> timeDelays, ArrayList<ArrayList<Double>> timeDelayErrors, float speedOfSound, HyperbolicParams hyperbolicParams) Create an instance of a hyperbolic localiser,.Hyperbolic(HyperbolicParams hyperbolicParams) Create an instance of a hyperbolic localiser. - 
Method Summary
Modifier and TypeMethodDescriptiondouble[]calcErrors(ArrayList<Double> timeDelays, ArrayList<Double> timeDelayErrors, ArrayList<javax.vecmath.Point3f> hydrophonePos, double speedOfSound, int bootStrapN) Calculate the errors in source position.double[]calcSource(ArrayList<Double> timeDelays, ArrayList<javax.vecmath.Point3f> hydrophonePos, double speedOfSound) Calculate the position of a source from time delays.Change any settings in the algorithm.static double[]createMatrixARow2D(double td, javax.vecmath.Point3f hLoc, double speedofSound, int type) Calculate a row for matrix A of (Am=b) in hyperbolic localisation;static double[]createMatrixARow3D(double td, javax.vecmath.Point3f hLoc, double speedofSound) Calculate a row for matrix A of (Am=b) in hyperbolic localisation;static double[]createMatrixBrow2D(double td, javax.vecmath.Point3f hLoc, double speedofSound, int type) Calculate a row for matrix A of (Am=b) in hyperbolic localisation - this is for the 2D case.static double[]createMatrixBrow3D(double td, javax.vecmath.Point3f hLoc, double speedofSound) Calculate a row for matrix A of (Am=b) in hyperbolic localisation -for the 3D problemintGet the type of hyperbolic localiser which is being used e.g.double[]Get errors for latest loclaisation resultGet the hyperbolic parametersdouble[]Get the latest localisation resultdoublevoidRuns the localisation algorithm an creates a results.voidsetCurrentType(int currentType) Set the type of hyperbolic loclaiser e.g.voidsetHydrophoneArray(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray) voidsetHyperbolicParams(HyperbolicParams hyperbolicParams) Set the hyperbolic parametersvoidsetSpeedOfSound(double d) voidsetTimeDelaysObs(ArrayList<ArrayList<Double>> timeDelaysObs) voidstop()Stop the localiser. 
- 
Field Details
- 
hydrophoneArray
 
 - 
 - 
Constructor Details
- 
Hyperbolic
public Hyperbolic(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray, ArrayList<ArrayList<Double>> timeDelays, ArrayList<ArrayList<Double>> timeDelayErrors, float speedOfSound, HyperbolicParams hyperbolicParams) Create an instance of a hyperbolic localiser,.- Parameters:
 hydrophoneArray- - the hydrophone array. Each ArrayListis a synchronised group of hydrophones in cartesian co-ordinates (meters) timeDelays- - time delay values in seconds. Each is a list of time delays using to indexM1 and indexM2 conventions and corresponding to hydrophones in hydrophoneArray list.timeDelayErrors- - time delay error values in seconds. Each is a list of time delay errors using to indexM1 and indexM2 conventions and corresponding to hydrophones in hydrophoneArray list.speedOfSound- - the speed of sound in m/shyperbolicParams- - hyperbolic parameters to use for this instance of the localiser.
 - 
Hyperbolic
public Hyperbolic(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray, ArrayList<ArrayList<Double>> timeDelays, ArrayList<ArrayList<Double>> timeDelayErrors, float speedOfSound) Create an instance of a hyperbolic localiser. Uses default settings.- Parameters:
 hydrophoneArray- - the hydrophone array. Each ArrayListis a synchronised group of hydrophones in cartesian co-ordinates (meters) timeDelays- - time delay values in seconds. Each is a list of time delays using to indexM1 and indexM2 conventions and corresponding to hydrophones in hydrophoneArray list.timeDelayErrors- - time delay error values in seconds. Each is a list of time delay errors using to indexM1 and indexM2 conventions and corresponding to hydrophones in hydrophoneArray list.speedOfSound- - the speed of sound in m/s
 - 
Hyperbolic
Create an instance of a hyperbolic localiser. Time delays, time delay errors, hydrophone positions and speed of sound must be set before a localisation can occur.- Parameters:
 hyperbolicParams- - hyperbolic paramaters to use for this instance of the localiser.
 - 
Hyperbolic
public Hyperbolic()Create an instance of a hyperbolic localiser. Uses default settings. Time delays, time delay errors, hydrophone positions and speed of sound must be set before a localisation can occur. 
 - 
 - 
Method Details
- 
calcSource
public double[] calcSource(ArrayList<Double> timeDelays, ArrayList<javax.vecmath.Point3f> hydrophonePos, double speedOfSound) Calculate the position of a source from time delays.- Parameters:
 timeDelays- - time delays using indexM1 and indexM2 conventionhydrophonePos- - hydrophone positions.speedOfSound- - speed of sound in m/s- Returns:
 - the source location in cartesian co-ordinates.
 
 - 
calcErrors
public double[] calcErrors(ArrayList<Double> timeDelays, ArrayList<Double> timeDelayErrors, ArrayList<javax.vecmath.Point3f> hydrophonePos, double speedOfSound, int bootStrapN) Calculate the errors in source position. This is achieved by sampling a rando number from the time delay error distributions, loclaising and looking at the distribution in position of loclaisation results.- Parameters:
 timeDelays- - time delayshydrophonePos-speedOfSound-bootStrapN-- Returns:
 
 - 
createMatrixARow3D
public static double[] createMatrixARow3D(double td, javax.vecmath.Point3f hLoc, double speedofSound) Calculate a row for matrix A of (Am=b) in hyperbolic localisation;- Parameters:
 td- - time delay in secondshLoc- - position of hydrophone, asusming the primary hydrophone at the origin.speedofSound- - speed of sound in meters per second.- Returns:
 - double[] row of Matrix A.
 
 - 
createMatrixARow2D
public static double[] createMatrixARow2D(double td, javax.vecmath.Point3f hLoc, double speedofSound, int type) Calculate a row for matrix A of (Am=b) in hyperbolic localisation;- Parameters:
 td- - time delay in secondshLoc- - position of hydrophone, asusming the primary hydrophone at the origin.speedofSound- - speed of sound in meters per second.- Returns:
 - double[] row of Matrix A.
 
 - 
createMatrixBrow3D
public static double[] createMatrixBrow3D(double td, javax.vecmath.Point3f hLoc, double speedofSound) Calculate a row for matrix A of (Am=b) in hyperbolic localisation -for the 3D problem- Parameters:
 td- - time delay in secondshLoc- - position of hydrophone, assuming the primary hydrophone at the origin.speedofSound- - speed of sound in meters per second.- Returns:
 - double[] row of Matrix A.
 
 - 
createMatrixBrow2D
public static double[] createMatrixBrow2D(double td, javax.vecmath.Point3f hLoc, double speedofSound, int type) Calculate a row for matrix A of (Am=b) in hyperbolic localisation - this is for the 2D case.- Parameters:
 td- - time delay in secondshLoc- - position of hydrophone, assuming the primary hydrophone at the origin.speedofSound- - speed of sound in meters per second.- Returns:
 - double[] row of Matrix A.
 
 - 
runAlgorithm
public void runAlgorithm()Description copied from interface:TimeDelayLocaliserModelRuns the localisation algorithm an creates a results. The results are dependednt on the localisation class.- Specified by:
 runAlgorithmin interfaceTimeDelayLocaliserModel
 - 
getResult
public double[] getResult()Get the latest localisation result- Returns:
 - cartesian position of source in meters
 
 - 
getErrors
public double[] getErrors()Get errors for latest loclaisation result- Returns:
 - errors of latest localisation result in meters
 
 - 
changeSettings
Description copied from interface:TimeDelayLocaliserModelChange any settings in the algorithm.- Specified by:
 changeSettingsin interfaceTimeDelayLocaliserModel- Returns:
 
 - 
getTimeDelaysObs
 - 
getHydrophoneArray
 - 
getSpeedOfSound
public double getSpeedOfSound() - 
setTimeDelaysObs
 - 
setHydrophoneArray
 - 
setSpeedOfSound
public void setSpeedOfSound(double d)  - 
stop
public void stop()Description copied from interface:TimeDelayLocaliserModelStop the localiser. For MCMC, which can takes minutes to compute this is important. For other localisers, such as Simplex, this is unimportant and can be left blank.- Specified by:
 stopin interfaceTimeDelayLocaliserModel
 - 
getCurrentType
public int getCurrentType()Get the type of hyperbolic localiser which is being used e.g. LOC_3D- Parameters:
 currentType- v- type to set.
 - 
setCurrentType
public void setCurrentType(int currentType) Set the type of hyperbolic loclaiser e.g. LOC_3D- Parameters:
 currentType- v- type to set.
 - 
getHyperbolicParams
Get the hyperbolic parameters- Returns:
 - the hyperbolic parameters.
 
 - 
setHyperbolicParams
Set the hyperbolic parameters- Parameters:
 hyperbolicParams- - the hyperbolic parameters.
 
 -