Understanding stanag 4609 klv format

2.5k views Asked by At

I am trying to parse a stanag 4609 klv stream from external camera.

For beginning, I am trying to figure the altitude value received in stream.

By stanag 4609 documentation, the value is 2 - bytes long, in feet, represented as float.

I know that the camera altitude is approximately 39.8 meters, but I can't interpret the 2 - bytes I receive to that value (in feet). The 2 bytes I received are {12,23}.

How can I interpret it in the correct way?

1

There are 1 answers

0
jrnorth On BEST ANSWER

In STANAG 4609 KLV, floating point values are encoded as integers. You can check MISB ST0601 for the particular data element you're interested in. It will give you the conversion formula to convert the 2-byte integer into the correct floating point value.

Assuming you're referring to the Sensor True Altitude (tag 15), the conversion formula is (19900/65535) * int_value - 900.

Applying this to your data:

  1. Interpret the bytes [12, 23] ([0x0C, 0x17] in hexadecimal) as an integer. 0xC17 is equal to 3095.
  2. Apply the formula. (19900/65535) * 3095 - 900 = 39.81 meters