The ANALOG group

The ANALOG parameters group provides information about the analog data stored within a C3D file.  As a result, the parameter ANALOG:USED should be stored in all C3D files even if the file does not contain any analog data.  C3D files that do not contain analog data should set the value of the USED parameter to zero.

The original specification for analog data storage within the C3D file assumed that data values were sampled by an Analog to Digital Converter (ADC) and then written to the C3D file.  The assumption was that the value stored in the C3D file would be a signed 16-bit integer unless the C3D file used floating-point format, in which case the signed 16-bit value would be converted to a floating-pint value before being written to the file.

This method worked well for many years because the majority of analog data was sampled at 12-bit resolution and programmers implementing analog storage functions did not have to think too hard about the differences between storing signed offset or unsigned offset data.  The sampled values obtained from the ADC could simply be written to the file as an integer value and any necessary scaling or format conversions could be handled by creating the appropriate OFFSET parameters.  It made no difference whether the data was considered a signed integer or an unsigned integer as all the possible unsigned values could be stored within the range of a signed 16-bit integer.

This situation changed in two ways with the introduction of 16-bit analog data samples:

·      The potential for integer overflow exists when the ANALOG:OFFSET parameter is applied to 16-bit resolution data..  This requires that all math operations on analog data be performed with 32-bit integers to handle any potential overflow when large analog data values are encountered with large OFFSET values.

·      The format used to store the analog data sample is significant.  Before the introduction of 16-bit ADCs, most analog data samples contained 12-bit data samples with a range of 4096 discreet values that could be stored as either signed or unsigned integer values within the range of a signed 16-bit integer.  The introduction of 16-bit data samples changed this and required that the analog values are stored as signed integers, as required by the original C3D format description.

The first C3D application (from Vicon Motion Systems) to implement 16-bit analog data stored all their analog data as unsigned 16-bit integer values, thus rendering the analog data unreadable to standard applications that expect to read signed integers from the C3D file.  Vicon Motion Systems was unwilling to correct this as the problems were only discovered after the software had been widely distributed and  users started complaining that other C3D applications could not read the new format. 

In order to work around this problem two additional parameters (ANALOG:FORMAT and ANALOG:BITS) have been added to the C3D file format description to document the analog sample format and measurement resolution.  These two parameters are “optional” in the sense that they are unnecessary unless the analog data has been (incorrectly) stored as unsigned integers.  Many older C3D applications will not read these parameters and will fail to read Vicon Motion Systems 16-bit analog data.

It is strongly recommended that anyone storing 16-bit analog data in C3D files follow the original C3D format description and store their data using signed integers wherever possible.  Care is needed when writing code to convert between signed and unsigned formats or reading/writing all format variants.

The parameters listed below should always be provided if the C3D file does contain analog data.  Other ANALOG parameters may be required by particular software applications – consult your manufacturer’s documentation for details of application specific parameters.

More:

USED

LABELS

DESCRIPTIONS

GEN_SCALE

SCALE

OFFSET

UNITS

RATE

FORMAT

BITS