There is lots of way to store time series data (i.e. data recorded at a fixed sample rate). In OpenMA, recorded data can be markers' trajectories, analog signals, pressure insole, orientation, pose, etc. For example, for each sample, a trajectory has 3 coordinates and one residual, while for an analog channel, a sample is equal to a single value. Instead of distinguish each kind of data series by several subclasses (and add specific members and methods each time), it was decided to create a multidimensionnal time series container. Combined with static and dynamic propertie (see Property), this would give the possibility to store any kind of time series (or should be) wit any kind of sample (in terms of dimensions and components).

To go futher, reconstructed data (e.g. acquired by a sterephotogrammetric system) and raw data (e.g. acquired by a digital-to-analog converter: ADC) are stored in the same way. Howver, the former has (at least) a supplementary component to store associated residual. This is the responsability of the developer to add this/these extra components when the TimeSequence object is created. To possibliy know if a TimeSequence object has residual compoents, the type() of the object can be tested against the enum value Reconstructed (see the example below). Of course, this methods works only if the given Type use the flag Reconstructed.

// The following code creates a time sequence:
// - named LHEE
// - where each sample has 1 dimension with 4 components (X, Y, Z, residual)
// - with 1000 samples
// - sampled at 100.0Hz
// - starting at 0.0 second of the beginning of the acqusition
// - typed as a Marker
// - where the main unit (i.e. for the coordinates) is the millimeter.
auto marker = ma::TimeSequence("LHEE",4,1000,100.0,0.0,ma::TimeSequence::Marker,"mm");
// Check if the object stores reconstructed data
std::cout << marker.type() & ma::TimeSequence::Reconstructed << std::endl;

For ADC data, some members were added to give supplementary information that could be used useful when exporting the TimeSequence into a file. You can pass to the constructor 3 ADC parameters: scale, offset, and range. By default, the ADC resolution is not stored as it is assumed that all TimeSequence objects use the same converter. However, you could add a dynamic property (e.g. resolution) using setProperty() to store this information. In general the file formats proposed in OpenMAto to read/write ADC data use only the three stored ADC parameter (scale, offset, range). You should read their dedicated documentation for more details.

Contextual information about the kind of data stored in the time sequence.

Constant

Value

Description

Unknown

= 0x00

Unknown type. This is the default type if none is given to a constructor

Reconstructed

= 0x01

Internal flag to indicated if these data are reconstructed data. The usage of this flag shall mean that some components are resevred for reconstruction residuals. For example if a TimeSequence is set to the Type Marker (predefined value included the Reconstructed flag), the given dimension should be set to 4. Three of them are for the coordinates and the later is for the reconstruction residuals.

Marker

= 0x02 | Reconstructed

Should be used to represent a reconstructed/computed 3D trajectory. Data sample shall be represented by an 1D array with 4 components: X, Y, Z coordinates and valid/reconstruction residuals. The associated unit shall be millimeter ("mm").

Angle

= 0x04 | Reconstructed

Should be used to represent a reconstructed/computed 3D angle. Data sample shall be represented by an 1D signal with 4 components: X, Y, Z values and valid/reconstruction residuals. The associated unit shall be radian ("rad").

Force

= 0x08 | Reconstructed

Should be used to represent a reconstructed/computed 3D force. Data sample shall be represented by an 1D signal with 4 components: X, Y, Z values and valid/reconstruction residuals. The associated unit shall be newton ("N").

Moment

= 0x10 | Reconstructed

Should be used to represent a reconstructed/computed 3D moment. Data sample shall be represented by an 1D signal with 4 components: X, Y, Z values and valid/reconstruction residuals. The associated unit shall be newton-millimeter ("Nmm").

Power

= 0x20 | Reconstructed

Should be used to represent a reconstructed/computed 1D-2D-3D power. Data sample shall be represented by an 1D signal with 2-3-4 components: X, Y, Z values and valid/reconstruction residuals. The associated unit shall be watt ("W").

Scalar

= 0x40 | Reconstructed

Should be used to represent a reconstructed/computed 1D-2D-3D values. Data sample shall be represented by an 1D signal with 2-3-4 components: X, Y, Z values and valid/reconstruction residuals.

Complete constructor for time series signal with xD data sample. The number of data sample dimensions is determined by the number of components given. This constructor can be usefull for pressure matrix or any measuring system with 2D (or more) data sample dimension.

Simplified constructor for time series signal with xD data sample. The number of data sample dimensions is determined by the number of components given. This constructor can be usefull for pressure matrix or any measuring system with 2D (or more) data sample dimension.

Note

The given type should be based on the enum Type.

ma::TimeSequence::~TimeSequence () noexcept

unsignedma::TimeSequence::components () const noexcept

Returns the total number of components for one data sample. This method multiplies each dimensions together to compute the total number of component. It can be usefull to convert a xD signal into a 1D signal.

const double *ma::TimeSequence::data () const noexcept

Return the pointer storing the internal data

double *ma::TimeSequence::data () noexcept

Return the pointer storing the internal data. These data are stored by column.

Warning

You should used this method very carefully. It is recommended to call the method modified() manually if you apply modifications on the data.

Extract a read-only element of the time sequence for the given sample index and dimensions indices. In case the the number of indices is not consistent with the number of dimension, ths missing ones are set to 0.

Extract a reference to a read-only element of the time sequence for the given sample index and dimensions indices. In case the the number of indices is not consistent with the number of dimension, ths missing ones are set to 0. If the data are modified by this method, it is adviced to call modified() manually