Code covered by the BSD License  

Highlights from
wfm2read.m

4.27273

4.3 | 12 ratings Rate this file 56 Downloads (last 30 days) File Size: 12.12 KB File ID: #6764

wfm2read.m

by Erik Benkler

 

21 Jan 2005 (Updated 23 Mar 2011)

Reads the wfm binary files written by Tektronix Performance Oscilloscope instrument families.

| Watch this File

File Information
Description

Read Y(t) data from new format Tektronix WFM files (tested up to WFM003 format) used by TEKTRONIX instrument families
MSO70000/C, DSA70000/B/C, DPO70000/B/C, DPO7000,
MSO/DPO5000, TDS5000/B, TDS6000/B/C, TDS/CSA7000/B

wfm2read now supports Fast Frames data.

The oscilloscopes can save to ASCII files, but this is poor, very slow and needs lots of disk memory. The binary wfm files are much faster and smaller and even contain more information.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Tektronix binary file readers
This submission has inspired the following:
Read Yokogawa *.wvf files

MATLAB release MATLAB 7.0.4 (R14SP2)
Other requirements Restrictions: Only YT-waveforms can be read (X-Y not tested yet)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (16)
19 Mar 2005 youth flexa  
06 Jun 2005 harm twaalfrink  
02 Mar 2006 dwid krueger

good

30 May 2006 Bernd H

exactly what I needed.

25 Mar 2007 Markus Kuhn

Warning: Modern Linux versions use UTF-8 as the default character encoding, and on these, MATLAB's fread with "char" will sometimes read more than 1 byte at a time. This can cause this routine (version 1.4, 2005-11-11) to fail badly.

Fix: Replace the line

  [fid,message]=fopen(filename);

with

  [fid,message]=fopen(filename, 'r', 'ieee-be', 'latin1');

to declare explicitly a single-byte character encoding (here: ISO 8859-1 Latin-1), to always guarantee that 1 fread-char = 1 byte. (Or use uint8 instead of char in fread.)

01 May 2007 Themos Kallos

Very useful file, works great.

07 Jun 2007 Paul Lundquist

This program generally works but does not read fastframe data, which is a major limitation.

25 Feb 2008 Jack J

need change to be compatible w/ WFM#003.

11 Aug 2009 John Baillie

Hi,
I've modified the example file to read data in the file test.wvf which is located in the current MATLAB directory. I get the following error:

??? Undefined function or variable 'test'.

Error in ==> wvf_logicsignals_example at 4
[y_logic,t] = wvfread(test, 5, 1); %

What am I doing wrong?
scope model: DL7480

01 Sep 2009 Erik Benkler

Dear John Bailie,

it seems that your comment refers to wvfread, not to wfm2read, where you have posted it. Anyway, you just missed the quotation marks around the file name, so you should write
[y_logic,t] = wvfread('test', 5, 1);

Best regards,
Erik

23 Oct 2009 Brian

Works great, thanks for doing this. One small bug: it always seems to report the same sampling rate, 10 GS/s (and the scope, a TDS7054, only does 5GS/s max), regardless of the actual rate. This may be a software problem in the scope though, because the MATLAB .hdr header file shows the same when you save files in the MATLAB .dat file format

20 Jan 2011 Toru  
20 Jan 2011 Toru

Works great, Thank you.

I found a small error in line 228.

> ed1.user_offset = fread(fid,1,'*double',byteorder);

28 Mar 2011 ranjith kumar  
26 Aug 2011 Matt  
17 Nov 2011 Dan

Works well. I appreciate the info structure. y-data agrees with Teks batch converter out to 7 decimal places and then, as with wfm_ascii_dpo, it adds some noisey data. This nusance appears to be related to reading of the scale and offset values from the file. Thank you for a very good tool.

Please login to add a comment or rating.
Updates
30 Nov 2005

minor changes to the code, see description in the header

23 Jul 2008

Added WFM003 file format support;
bug fix related to default char set on some Linux systems

12 Mar 2009

- improved performance

30 Apr 2009

improved file name checking

30 Apr 2009

improved file name checking (2)

25 May 2009

BSD license

25 May 2009

BSD license

25 Dec 2010

(a) implemented reading of Fast frames data
(b) added wfm2readframe for reading a single frame of a fast frames measurement
(c) Added optional input argument startind

23 Mar 2011

Version 2.0, 22.03.2011
(a)changed meaning of the "datapoints" input parameter
(b)minor changes regarding warnings / error checking

Tag Activity for this File
Tag Applied By Date/Time
data import Erik Benkler 22 Oct 2008 07:39:59
data export Erik Benkler 22 Oct 2008 07:39:59
read Erik Benkler 22 Oct 2008 07:39:59
tektronix Erik Benkler 22 Oct 2008 07:39:59
waveform Erik Benkler 22 Oct 2008 07:39:59
utilities Erik Benkler 22 Oct 2008 07:39:59
measurement Erik Benkler 30 Apr 2009 11:16:12
wfm Erik Benkler 27 Dec 2010 09:51:04
fast frames Erik Benkler 27 Dec 2010 09:51:04
data export Li 05 May 2011 21:07:26
data import Matt 26 Aug 2011 12:34:48
data export ji-ying 08 Feb 2012 07:10:30

Contact us at files@mathworks.com