The purpose of this burst finder is to parse Lotek tag pulses emitted by the pulse finder plugin to VAMP and output detected bursts. The bursts are detected by matching against a tag database provided in CSV format and applying default frequency, signal strength and timing slop.
While this test program outputs bursts the actual intended function is to filter pulses, i.e. to remove all pulses that do not correspond to a burst. Filtering pulses instead of outputting bursts is expected to reduce the output volume when there is aliasing and, more importantly, allows subsequent server-side processing to apply different burst detection criteria. For the latter reason it is most likely desirable to set the slop values somewhat larger to provide more leeway in tuning the burst & tag finder settings server-side.
This test program includes the actual burst finder classes and a main application all in
one file.
It is written in Javascript and can be run using node.js.
The example here are for Linux and expect to find node at /usr/local/bin/node
so the command
line will need tweaking on other OSes.
To run the program specify the tag definition file as argument and pipe the pulses in via
stdin:
> ./find-bursts.mjs two-tags.csv <sgv2-1BA7RPI47F3A-046-2024-06-
30T17-04-53.703Z-all.txt
Tag count: 2
B1,1719767212.837,2,22.0,24.4,43.9,22,25,44
P1,1719767212.837,4.2,-47
P1,1719767212.859,4.2,-45
P1,1719767212.883,4.3,-47
P1,1719767212.927,4.2,-47
B1,1719767238.535,2,22.0,24.4,43.9,22,25,44
P1,1719767238.535,4.2,-45
P1,1719767238.557,4.2,-47
P1,1719767238.582,4.3,-48
P1,1719767238.625,4.3,-48
B1,1719767570.239,2,22.0,24.4,43.9,22,25,44
P1,1719767570.239,4.2,-46
P1,1719767570.261,4.2,-46
P1,1719767570.285,4.3,-48
P1,1719767570.329,4.2,-45
B1,1719767595.937,2,22.0,24.4,43.9,22,25,44
P1,1719767595.937,4.2,-45
P1,1719767595.959,4.2,-47
P1,1719767595.984,4.3,-45
P1,1719767596.027,4.3,-47
Each line starting with B
denotes a burst with the port number, the timestamp of the first pulse,
the tag ID, the three intervals measured between the pulses. and the three intervals specified
for the tag ID in the tag definition.
The B
line is followed by a printout of the actual pulses.
The test program also included some simple test cases to (partially) verify correctness, these can be run by providing two arguments (the value of the second doesn't matter). Sample run:
> ./find-bursts.mjs two-tags.csv test
Tag count: 2
Test one burst
PASS
Test two overlapping bursts
PASS
Test overlapping burst with wrong freq
PASS
Test overlapping burst with wrong signal
PASS
Test overlapping burst with wrong port
PASS
Test overlap thanks to to time slop
PASS
Test overlap with too much time slop
PASS