CSV File Reader

Summary

Doc_BoxAlgorithm_CSVFileReader.png
  • Plugin name : CSV File Reader
  • Version : 1.0
  • Author : Baptiste Payan
  • Company : INRIA
  • Short description : Read signal in a CSV (text based) file
  • Documentation template generation date : Jul 24 2014
  • WARNING : this box has been marked as UNSTABLE by the developer. It means that its implementation may be incomplete or that the box can only work under well known conditions. It may possibly crash or cause data loss. Use this box at your own risk, you've been warned.

Description

This box allows to input some of the OpenViBE streams from a text file that is easy to read by the machine and easy to read by the human. CSV files are text files with different values separated by a special character such as a colon, a semicolon or a tabulation. This basic syntax makes them very easy to read for both machine and human. The purpose of this box is to quickly import some data from other softwares.

!NOTE! The file format the box accepts is NOT the usual N times M matrix. There must be a few extra items: the first column must be the time, and the first line must have one more value than the other lines. This last value should be the sampling rate. See below for details.

Outputs

1. Streamed matrix

This output is used to import data from a CSV File to an OpenViBE stream. The type of this output can be modified by the user and the format of the file will be adapted depending on this type. Supported outputs are : Signal, Spectrum and Stimulations. Format specific to each of these stream types is detailed in section Miscellaneous.

  • Type identifier : Signal (0x5ba36127, 0x195feae1)

Settings

1. Filename

This setting contains the file where to load the data.

  • Type identifier : Filename (0x330306dd, 0x74a95f98)
  • Default value : [ ]

2. Column separator

This setting contains the special character to use as a separation for the different fields. Typical examples are colon, semi colon and tabulations.

  • Type identifier : String (0x79a9edeb, 0x245d83fc)
  • Default value : [ ; ]

3. don't use the file time

This option can be only used for an output signal type. Sometimes, the time of the first sample isn't equal 0 or the file contains many parts of samples, space in the time. If you want used a continues signal, start at the begin of the scenario, tick this setting. All samples are send with the sampling rate specified at the end of the second line of the csv file.

  • Type identifier : Boolean (0x2cdb2f0b, 0x12f231ea)
  • Default value : [ false ]

4. Samples per buffer

Number of samples per channel in a streamed matrix.

  • Type identifier : Integer (0x007deef9, 0x2f3e95c6)
  • Default value : [ 32 ]

Examples

Miscellaneous

In this section, we detail the typical inputs that you will find in the input file depending on the type of the input connector.

For the Signal stream, you will have something like this :

Time (s), Channel 1, Channel 2, ..., Channel n, Sampling Rate
Time of measure 1, Measure 1 of channel 1, Measure 1 of channel 2, ..., Measure 1 of channel n, Value of the sampling rate
Time of measure 2, Measure 2 of channel 1, Measure 2 of channel 2, ..., Measure 2 of channel n
...
Time of measure t, Measure t of channel 1, Measure t of channel 2, ..., Measure t of channel n

For the Spectrum stream, you will have something like this :

Time (s), Channel 1, Channel 2, ..., Channel n, Min frequency band, Max frequency band
Time of measure 1, Freq band 1 of m. 1 of chan 1, Freq band 1 of m. 1 of chan 2, ..., Freq band 1 of m. 1 of chan n, Value Min Frequency Band of band 1, Value Max Frequency Band of band 1
Time of measure 1, Freq band 2 of m. 1 of chan 1, Freq band 2 of m. 1 of chan 2, ..., Freq band 2 of m. 1 of chan n, Value Min Frequency Band of band 2, Value Max Frequency Band of band 2
...
Time of measure 1, Freq band f of m. 1 of chan 1, Freq band f of m. 1 of chan 2, ..., Freq band f of m. 1 of chan n, Value Min Frequency Band of band f, Value Max Frequency Band of band f
Time of measure 2, Freq band 1 of m. 2 of chan 1, Freq band 1 of m. 2 of chan 2, ..., Freq band 1 of m. 2 of chan n
Time of measure 2, Freq band 2 of m. 2 of chan 1, Freq band 2 of m. 2 of chan 2, ..., Freq band 2 of m. 2 of chan n
...
Time of measure 2, Freq band f of m. 2 of chan 1, Freq band f of m. 2 of chan 2, ..., Freq band f of m. 2 of chan n
...
...
...
Time of measure t, Freq band 1 of m. t of chan 1, Freq band 1 of m. t of chan 2, ..., Freq band 1 of m. t of chan n
Time of measure t, Freq band 2 of m. t of chan 1, Freq band 2 of m. t of chan 2, ..., Freq band 2 of m. t of chan n
...
Time of measure t, Freq band f of m. t of chan 1, Freq band f of m. t of chan 2, ..., Freq band f of m. t of chan n

For the Stimulation stream, you will have something like this :

Time (s), Identifier, Duration
Time of stim 1, Identifier of stim 1, Duration of stim 1
Time of stim 2, Identifier of stim 2, Duration of stim 2
...
Time of stim n, Identifier of stim n, Duration of stim n