java.lang.Object
Localiser.algorithms.timeDelayLocalisers.hyperbolic.Hyperbolic
All Implemented Interfaces:
TimeDelayLocaliserModel

public class Hyperbolic extends Object implements 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
  • 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 ArrayList is 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
      hyperbolicParams - - 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 ArrayList is 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

      public Hyperbolic(HyperbolicParams hyperbolicParams)
      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 convention
      hydrophonePos - - 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 delays
      hydrophonePos -
      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 seconds
      hLoc - - 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 seconds
      hLoc - - 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 seconds
      hLoc - - 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 seconds
      hLoc - - 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: TimeDelayLocaliserModel
      Runs the localisation algorithm an creates a results. The results are dependednt on the localisation class.
      Specified by:
      runAlgorithm in interface TimeDelayLocaliserModel
    • 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

      public Boolean changeSettings()
      Description copied from interface: TimeDelayLocaliserModel
      Change any settings in the algorithm.
      Specified by:
      changeSettings in interface TimeDelayLocaliserModel
      Returns:
    • getTimeDelaysObs

      public ArrayList<ArrayList<Double>> getTimeDelaysObs()
    • getHydrophoneArray

      public ArrayList<ArrayList<javax.vecmath.Point3f>> getHydrophoneArray()
    • getSpeedOfSound

      public double getSpeedOfSound()
    • setTimeDelaysObs

      public void setTimeDelaysObs(ArrayList<ArrayList<Double>> timeDelaysObs)
    • setHydrophoneArray

      public void setHydrophoneArray(ArrayList<ArrayList<javax.vecmath.Point3f>> hydrophoneArray)
    • setSpeedOfSound

      public void setSpeedOfSound(double d)
    • stop

      public void stop()
      Description copied from interface: TimeDelayLocaliserModel
      Stop 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:
      stop in interface TimeDelayLocaliserModel
    • 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

      public HyperbolicParams getHyperbolicParams()
      Get the hyperbolic parameters
      Returns:
      the hyperbolic parameters.
    • setHyperbolicParams

      public void setHyperbolicParams(HyperbolicParams hyperbolicParams)
      Set the hyperbolic parameters
      Parameters:
      hyperbolicParams - - the hyperbolic parameters.