Anabat File Formats


Contents

Back to: Anabat Technical Notes, Anabat Contents, Home


Anabat Sequence File TYPE 129 (Obsolete)

Hex offsets into file, in bytes
(words are arranged with the low byte at the lower offset)

0000 word 2 byte pointer to data information table (= 011ah)
0002 byte 00
0003 byte constant 129 - identifies this file structure.
0004 byte 00
0005 byte 00

0006 275 bytes TEXT HEADER

Data information table

011a word 2 byte pointer to first data byte (=0120h)
(contains file offset of first data byte)
011c word
RES1
011e byte
DIVRATIO
011f byte
VRES at which file made

0120 n bytes DATA

One or two bytes of data are used to represent time, in microseconds, between CONSECUTIVE TRANSITIONS. These data bytes are interpreted according to the following rules:

If bit7=0:

only one byte is used. The remaining 7 bits form a signed, twos complement number (between -64 and 63) which is added to the value of the previous time interval to derive the value of the current time interval.

If bits 7 to 3 are all 1:

the lower 3 bits tell how many of the following data points should be turned off, even if they represent valid signal times. This is because these points were edited off before the file was saved, but they are needed to correctly calculate the positions of following points.

else:

bits 3 to 6 form an unsigned value N, and bits 0 to 2 form a value H.
The 8 bits of the next data byte form a value L. The resulting time interval
is: (H * 256 + L) shifted left N times.

For example:

If the first data bytes are

128,100,50,10,251,40,10,88,88,118,128,80,149,213, .......

these would be interpreted to give the following time intervals:

100 128,100 = ((128 AND 7)*256 + 100) shifted left ((128 AND 120)/8) times
150 50 = 100 + 50 OR (50 AND 64)*2
160 10 = 150 = 10 OR (10 AND 64)*2
251 = 251 - 248 = 3 following points not to be plotted

200 40 = 160 + 40 OR (40 AND 64)*2
210 10 = 200 + 10 OR (10 AND 64)*2
170 88 = 210 + 88 OR (88 AND 64)*2

130 88 = 170 + 88 OR (88 AND 64)*2
120 118 = 130 + 118 OR (118 AND 64)*2
200 128,80 = ((128 AND 7)*256 + 80) shifted left ((128 AND 120)/8) times
5972 149,213 = ((149 AND 7)*256 + 213) shifted left ((149 AND 120)/8) times

Back to: File Format Contents, Anabat Technical Notes, Anabat Contents, Home


Anabat Sequence File TYPE 130 (Obsolete)

Hex offsets into file, in bytes
(words are arranged with the low byte at the lower offset)

0000 word 2 byte pointer to data information table (= 011ah)
0002 byte 00
0003 byte constant 130 - identifies this file structure.
0004 byte 00
0005 byte 00

0006 275 bytes TEXT HEADER

Data information table

011a word 2 byte pointer to first data byte (=0120h)
(contains file offset of first data byte)
011c word
RES1
011e byte
DIVRATIO
011f byte
VRES at which file made

0120 n bytes DATA

One to four bytes of data are used to represent time, in microseconds, between CONSECUTIVE TRANSITIONS. These data bytes are interpreted according to the following rules:

If bit7=0:

only one byte is used. The remaining 7 bits form a signed, twos complement number (between -64 and 63) which is added to the value of the previous time interval to derive the value of the current time interval.

If bits 7 to 5 are all 1:

the lower 5 bits tell how many of the following data points should be turned off, even if they represent valid signal times. This is because these points were edited off before the file was saved, but they are needed to correctly calculate the positions of following points.

else:

if bits 5 and 6 are both 0 ( 80h <= byte <= 9fh)

next time interval is contained in 13 bits, upper 5 from the remainder of this byte, lower 8 bits from the next byte.

if bit 5 is 1 and bit 6 is 0 (a0h <= byte <= bfh)

next tme interval is contained in 21 bits, upper 5 from the remainder of this byte, next 8 from the next byte and the lower 8 from the byte after that.

if bit 5 is 0 and bit 6 is 1 (c0 <= byte <= dfh)

next time interval is contained in 29 bits, the upper 5 from the remainder of this byte, the next 8 from the following byte etc. Note that in this case, bits 0-4 of this byte must all be 0.

examples:

0 same as previous
5 previous + 5
63 (3Fh) previous + 63
118 (76h) previous - 10
64 (40h) previous - 64
230 (E6h) turn off next 6 points
255 (FFh) turn of next 31 points
128,27 (80h,1Bh) 27 (1Bh)
131,43 (83h,2Bh) 811 (32Bh)
159,255 (9Fh,FFh) 8191 (1FFFh)
160,0,33 (A0h,0,21h) 33 (21h)
191,255,255 (BFh,FFh,FFh) 2097151 (1FFFFFh)
192,255,255,255 (C0h,FFh,FFh,FFh) 16777215 (FFFFFFFh)

Back to: File Format Contents, Anabat Technical Notes, Anabat Contents, Home


Anabat Sequence File TYPE 131 (Obsolete)

Hex offsets into file, in bytes
(words are arranged with the low byte at the lower offset)

0000 word 2 byte pointer to data information table (= 011ah)
0002 byte 00
0003 byte constant 131 - identifies this file structure.
0004 byte 00
0005 byte 00

0006 275 bytes TEXT HEADER

Data information table

011a word 2 byte pointer to first data byte (=0120h)
(contains file offset of first data byte)
011c word
RES1
011e byte
DIVRATIO
011f byte
VRES at which file made

0120 n bytes DATA

One to four bytes of data are used to represent time, in microseconds, between CONSECUTIVE TRANSITIONS. These data bytes are interpreted according to the following rules:

If bit7 = 0 ( 0 <= byte <= 7Fh )

only one byte is used. The remaining 7 bits form a signed, twos complement number (between -64 and 63) which is added to the value of the previous time interval to derive the value of the current time interval.

if bit 7 = 1, bit 6 = 0, bit 5 = 0 ( 80h <= byte <= 9Fh)

next time interval is contained in 13 bits, upper 5 from the remainder of this byte, lower 8 bits from the next byte.

if bit 7 = 1, bit 6 = 0, bit 5 = 1 (A0h <= byte <= BFh)

next tme interval is contained in 21 bits, upper 5 from the remainder of this byte, next 8 from the next byte and the lower 8 from the byte after that.

if bit 7 = 1, bit 6 = 1 bit 5 = 0(C0h <= byte <= DFh)

next time interval is contained in 29 bits, the upper 5 from the remainder of this byte, the next 8 from the following byte etc. Note that in this case, bits 0-4 of this byte will all be 0 in a file with a maximum duration of 15 seconds.

if bit 7 = 1, bit 6 = 1 bit 5 = 1 (E0h <= byte <= FFh)

lower 5 bits represent a status value which is set for the number of points contained in the next byte. At this stage (June 99) only 4 status values are defined:

0 - point is out of range
1 - point is turned off
2 - point is normal dot
3 - point is maindot

so bits 2 to 4 are all zero and in practice, only values of E1h or E3h will be used. So if this and the next byte were E1h and 5, that would turn off the five next data points. The points E3h and 7 would make the next 7 data points maindots.

examples:

0 same as previous
5 previous + 5
63 (3Fh) previous + 63
118 (76h) previous - 10
64 (40h) previous - 64
128,27 (80h,1Bh) 27 (1Bh)
131,43 (83h,2Bh) 811 (32Bh)
159,255 (9Fh,FFh) 8191 (1FFFh)
160,0,33 (A0h,0,21h) 33 (21h)
191,255,255 (BFh,FFh,FFh) 2097151 (1FFFFFh)
192,255,255,255 (C0h,FFh,FFh,FFh) 16777215 (FFFFFFFh)
225,1 (E1h,1) turn off next data point
225,255 (E1h,FFh) turnoff next 255 points
227,3 (E3h,3) next 3 points are maindots
227,255 (E3h,FFh) next 255 points are maindots

Back to: File Format Contents, Anabat Technical Notes, Anabat Contents, Home


Anabat Sequence File TYPE 132

Hex offsets into file, in bytes
(words are arranged with the low byte at the lower offset)

0000 word 2 byte pointer to data information table (= 011ah)
0002 byte 00
0003 byte constant 132 - identifies this file structure.
0004 byte 00
0005 byte 00

0006 275 bytes TEXT HEADER

Data information table

011a word 2 byte pointer to first data byte (=0150h)
(contains file offset of first data byte)
011c word
RES1
011e byte
DIVRATIO
011f byte
VRES at which file made

Date and time at start of file
0120 word year (eg 2001)
0122 byte month (Jan=1,Dec=12)
0123 byte day (1st=1 etc)
0124 byte hour (0-23)
0125 byte minute (0-59)
0126 byte second (0-59)
0127 byte hundredsth of a second (0-99)
0128 word microseconds (0-9999)

012a 6 byte ID code

0130-014f 32 bytes GPS position data
0130-0139 10 bytes specifying datum

013a if numeric, specifies UTM data
013a-013c 3 bytes for Zone (eg "10S")
013d char(32)
013e-0143 6 bytes for Easting in metres
0144 char(32)
0145-014b 7 bytes for Northing in metres

013a if 'N' or 'S', specifies Degree data
013b-013c 2 bytes for latitude Degrees
013d-0141 5 bytes for decimal Degrees
0142 char(32)
0143 'W' or 'E'
0144-0146 3 bytes for longitude Degrees
0147-014b 5 bytes for decimal Degrees

014c-014f 4 bytes for Altitude in metres (-999 to 9999)

0150 n bytes DATA

One to four bytes of data are used to represent time, in microseconds, between
CONSECUTIVE TRANSITIONS. These data bytes are interpreted according to the
following rules:

If bit7 = 0 ( 0 <= byte <= 7Fh )

only one byte is used. The remaining 7 bits form a signed, twos complement number (between -64 and 63) which is added to the value of the previous time interval to derive the value of the current time interval.

if bit 7 = 1, bit 6 = 0, bit 5 = 0 ( 80h <= byte <= 9Fh)

next time interval is contained in 13 bits, upper 5 from the remainder of this byte, lower 8 bits from the next byte.

if bit 7 = 1, bit 6 = 0, bit 5 = 1 (A0h <= byte <= BFh)

next tme interval is contained in 21 bits, upper 5 from the remainder of this byte, next 8 from the next byte and the lower 8 from the byte after that.

if bit 7 = 1, bit 6 = 1 bit 5 = 0(C0h <= byte <= DFh)

next time interval is contained in 29 bits, the upper 5 from the remainder of this byte, the next 8 from the following byte etc. Note that in this case, bits 0-4 of this byte will all be 0 in a file with a maximum duration of 15 seconds.

if bit 7 = 1, bit 6 = 1 bit 5 = 1 (E0h <= byte <= FFh)

lower 5 bits represent a status value which is set for the number of points contained in the next byte. At this stage (June 99) only 4 status values are defined:

0 - point is out of range
1 - point is turned off
2 - point is normal dot
3 - point is maindot

so bits 2 to 4 are all zero and in practice, only values of E1h or E3h will be used. So if this and the next byte were E1h and 5, that would turn off the five next data points. The points E3h and 7 would make the next 7 data points maindots.

examples:

0 same as previous
5 previous + 5
63 (3Fh) previous + 63
118 (76h) previous - 10
64 (40h) previous - 64
128,27 (80h,1Bh) 27 (1Bh)
131,43 (83h,2Bh) 811 (32Bh)
159,255 (9Fh,FFh) 8191 (1FFFh)
160,0,33 (A0h,0,21h) 33 (21h)
191,255,255 (BFh,FFh,FFh) 2097151 (1FFFFFh)
192,255,255,255 (C0h,FFh,FFh,FFh) 16777215 (FFFFFFFh)
225,1 (E1h,1) turn off next data point
225,255 (E1h,FFh) turnoff next 255 points
227,3 (E3h,3) next 3 points are maindots
227,255 (E3h,FFh) next 255 points are maindots

Thanks to Chris Phillips for pointing out errors in the text above.

Back to: File Format Contents, Anabat Technical Notes, Anabat Contents, Home


Explanation of terms used

TEXT HEADERS

Text Headers consist of 275 ASCII bytes ordered into the following fields:

TAPE     8 bytes
DATE     8 bytes
LOC     40 bytes
SPECIES 50 bytes
SPEC    16 bytes
NOTE    73 bytes
NOTE1   80 bytes

In practice, NOTE1 appears as the second line of NOTE.

DIVRATIO

The division ratio used in the recording. This is the value which the original signal frequency has been divided by before input to the ZCAIM.

SCALE

The vertical (frequency) resolution of the graph in Herz. SCALE is the number of Herz represented by the distance between 2 adjacent lines in the vertical axis.

VRES

This value is used to determine what value of SCALE is to be used. The value (VRES AND 70h)/16 is used to lookup a table which gives SCALE, ie:

(VRES AND 70h)/16      SCALE
        0               10
        1                25
        2                50
        3               100
        4               250
        5               500
        6              1000
        7              2500

The lower nibble of VRES may contain a value which is used to decide which of three possible vertical axes to draw on the graph.

RES1

is the number of counts (derived from ZCAIM) which represent a time interval of 25ms. = 25000 unless recalibration is in effect.

TRANSITION

A change in the input signal from -ve to +ve (positive going) or from +ve to -ve (negative going). The ZCAIM outputs a value which is the time (in us) since the previous transition (of opposite sign). Note that CONSECUTIVE TRANSITIONS have opposite signs, while LIKE TRANSITIONS have the same sign and are separated by a transition of opposite sign. Frequency calculations use the time between LIKE TRANSITIONS.

The term TRANSITION can be used in two different ways. In several places in the Anabat software, the term is used to denote TRANSITIONS in the original bat call, while in the sense used here, in explaining the file formats, it is used to denote a TRANSITION as seen by the ZCAIM. Because of the way an Anabat detector works, each TRANSITION at the output of the detector, and hence the input to the ZCAIM, will have resulted from counting a number of TRANSITIONS in the original sugnal.

Back to: File Format Contents, Anabat Technical Notes, Anabat Contents, Home


C++ Program for loading a file

For Programmers!

You can download this C++ source code and use it in a program to download the contents of an Anabat sequence file into memory. Instructions are in the source code.

Download LOADER.TXT (9k)

Back to: File Format Contents, Anabat Technical Notes, Anabat Contents, Home


Contact Information

To the best of my knowledge, the information in this web page is correct, but I make no guarantee of this. If you use this information, you do so at your own risk, but I am happy to assist anyone with any queries they may have, and will especially welcome any suggestions for improvements, notification of errors etc. Please Email me at:

Email:

Back to: Anabat Technical Notes, Anabat Contents, Home


Last revised: June 04, 2011.