Determination of ToF from a waveform can be done through a number of algorithms. The two that are currently implemented in the software are the short time average / long time average (STA/LTA) method and the envelope threshold method. In the STA/LTA method, two rolling averages are calculated along the waveform, one with a short time window and one with a longer time window. The ToF is taken to be the point where the ratio of these two averages exceeds a threshold value. It is up to the experimenter to define the length of the short window, long window, and the threshold value such that the algorithm consistently picks the start of the wave. In the envelope threshold method, the wave envelope is calculated by taking the magnitude of the Hilbert transform. The ToF is then defined as the time when the wave envelope exceeds a certain fraction of the maximum value of the envelope. The experimenter must choose a threshold fraction that is sensitive (to get the soonest possible arrival time) but does not lead to false positives (identifying noise as the arrival time). Many other algorithms are used in the literature, each with tradeoffs in accuracy and robustness. Fine tuning an algorithm's parameters can be time consuming but is necessary to reliably calculate ToF.