File format:Tektronix WFM

From sigrok
(Redirected from File format:Tektronix wfm)
Jump to navigation Jump to search

The Tektronix WFM format is a special format used by the Tektronix TDS series scopes. It uses less space than the CSV/Matlab export functions provided.

Header

TODO The table may need an update, Tektronix documents at least three file format versions, with some fields added and others changing data types in more recent versions.

Bytes Field
0 - 1 Magic bytes
2 - 5 Format code
6 Length of data, unsigned integer (so far always 4)
7 - 11 Number of bytes following
12 - 15 Another magic
16-20 Length of header + data (big endian, signed integer)
21 - 28 Vertical position (double)
29 - 36 Horizontal position (double)
37 - 43 Vertical zoom (double)
44 - 51 Horizontal zoom (double)
52 - 53 Acquisition mode (signed integer, currently unknown)
54 - 55 Min max (unknown)
56 - 63 Duration in seconds (double)
63 - 64 Vertical coupling (signed integer)
65 - 66 Horizontal unit (signed integer)
67 - 74 Horizontal time per point (double)
75 - 76 Vertical unit (signed integer)
77 - 84 Vertical offset (double)
85 - 92 Vertical position (double)
93 - 100 Vertical gain (double)
101 - 105 Record length (unsigned integer)
106 - 107 Trigger position (signed integer), possibly in points
108 - 109 Header version (signed integer)
110 - 111 Sampling density (??) (signed integer)
112 - 113 Burst segment length (signed integer)
114 - 115 Waveform source (signed integer)
116 - 121 3x Video 1 (signed integer)
122 - 129 Video 2 (double)
130 - 131 Video 3 (signed integer)
131 - 163 Preamble (???)

Data

Waveform data. Length of this segment is stored in Record length.

To reconstruct the waveform use the following:

y = data[i] * vertgain / 25 / 256 + vertoffset - vertposition * vertgain
x = (i - (reclength*trigpos/100)) * horizscaleperpoint

Resources