Help needed decoding data

John Van Ostrand john at vanostrand.com
Sun Jun 29 19:37:26 PDT 2014


On Fri, Jun 27, 2014 at 5:46 PM, John Van Ostrand <john at vanostrand.com>
wrote:

>
> Hi All,
>
> I've been staring at and playing with this data for a week now and I don't
> feel any closer to deciphering the dive profile sample data from my Cochran
> EMC-20H.
>
> Personally I love a challenge like this and I'm hoping some of you do as
> well because this one is tough. Instead of digging into a good book this
> weekend why not sit back with a laptop or tablet and this puzzle.
>
> You'll find everything you need at the link below. I've removed the
> mundanely easy work from this puzzle. Included are binary files, annotated
> hexdumps to illustrate the data and some programs to extract and display
> data (don't judge, these are quick and dirty programs.) Start with the
> README and you'll be into the fun part within minutes.
>
>
> https://drive.google.com/file/d/0B-VD5cn7zgGHN1pVRWpib2pJc0k/edit?usp=sharing
>

I've made some progress on this but I could still use another set of eyes.

Each sample is in 3 byte structure and the composition of that structure
changes every second between two types. The odd seconds (if it starts at 1
sec) have a structure that seems to have a pressure change in mbar, the
even seconds have a structure that seems to store temperature samples. Both
types of structures seem to hold tissue compartment estimates.

Two seconds of samples looks like this (hex and binary for each sample
shown):

Odd Seconds (bytes 1 to 3)
0x02 00000010  Bit 7, when 0, indicates that a sample follows. Bits 6 is a
flag, maybe + or - indicator or data, bits 5-3 are always 0, bits 2-0 vary
often.
0x14 00010100  Bit 7 indicates a negative value in this byte, bits 6-0 seem
to be mbar increments from the last sample.
0x03 00000011  Byte indicates tissue compartment loading for one
compartment.

Even Seconds (bytes 4 to 6)
0x01 00000001 Bit 7, when 0, indicates that a sample follows. Bits 6 is a
flag, maybe + or - indicator or data, bits 5-3 are always 0, bits 2-0 vary
often.
0x30 00110000 Bits 6-0 change very slow, like a temperature sample but the
value is off and may need to be adjusted, maybe to a calibration.
0x02 00000010 Byte indicates tissue compartment loading for one compartment.

It's clear from using the dive software that samples for depth and temp are
displayed for each second yet it appears that depth and temp are only
recorded every other second. I've extracted what appears to be the mbar
increment data bits and graphed them. They closely, but not exactly, follow
a dive profile from the vendor software. There is detail missing and the
computed depths are a few feet off. I may not have mbar to feet conversion
right or there is a calibration I need to consider.

I suspect that bytes 1 and 4 hold sample data as well but there aren't
enough free bits to match the 7 bits used for depth and the 7 bits
seemingly used for temperature.

I think the bits may be scattered across more than one sample too.

There are 20 tissues tracked by the DC and the samples are spread across 20
seconds of depth/temp samples. That set of 20 samples is separated from the
next set with 4 seconds of depth/temp samples except instead of tissue
loading there is different data. Where tissue data would be are either FF
or 00. I don't recall seeing the 00s change but the FFs change about mid
dive and most bits go to 0. On a repetitive dive, a deeper wreck in this
case, the FFs never showed up. It may be tissue loading, or OTUs or some
other data.

Because of all this scattering of samples I'm suspecting that there is a
temperature increment in the depth sample and a depth increment in the temp
sample. The temp increment could be simple, just a -1 or +1 indicating a
change in temperature. I've only looked briefly but I can't see which bits
it could be. There aren't enough bits left over to make 7 bits of mbar
increment so maybe the even-second depth sample is an increment of the
odd-second depth sample.

In thinking this through to a practical application because maybe I'm
including bits in the LSB portion that aren't part of the sample. The
software displays increments of 0.25 feet, that's about 8 mbar suggesting a
minimum increment and a four foot per second change in depth might be a
reasonable limit giving a max increment of about 128. I suppose this could
be done with 5 bits (a +/- bit and 4 data bits) but it appears to be done
with 8 in the main depth sample.

I'm done for the evening and I'll be driving or diving all day tomorrow.

I'd be happy to discuss this later this week if anyone is also working on
this.

-- 
John Van Ostrand
At large on sabbatical
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libdivecomputer.org/pipermail/devel/attachments/20140629/362eef99/attachment.html>


More information about the devel mailing list