WBPS Binary File Format
Last updated
Last updated
Copyright © 2024 | All Rights Reserved
WaveBPS uses a binary file format to efficiently store its raw waveform files. This document describes the file format enough for third parties to read and write the files. These files have the extension "wbps". These formats are created in Intel big endian byte order.
Internally, the WaveBPS wbps file is actually two main formats. First is the floating point format and the other uses an unsigned short (16 bits). The unsigned short is considerably smaller and is used when possible. When not possible, such as when a waveform was originally loaded from a csv file, the floating point format is used. The parser for the wavebps file can determine which file type it is by reading the file header. The short format is always used when capturing from an oscilloscope.
The file header is always 16 bytes. The header will be one of the two following possibilities (Table 1):
Table 1 - Possible 16 byte headers
Type | Header |
---|---|
Following the header is a 4 byte integer describing the number of channels (Table 2). This is the same for both formats.
Table 2 - Number of Channels
Type | Header |
---|---|
After the number of channels, the file formats diverge and are described in separate topics.
Follow this link for the double precision floating point topic.
Follow this link for the unsigned short topic.
Double Precision Floating Point
char szverion5 [] = {'w','a','v','e','b','p','s','5','0','0',0,0,0,0,0,0};
Unsigned Short (16 bits)
char szverion6 [] = {'w','a','v','e','b','p','s','6','0','0',0,0,0,0,0,0};
Unsigned int (32 bits)
m_iNumberOfChannels