Jump to content
  • 0

Data export from dwfbodedata file?


mkj

Question

Hi - really like the capability of the Network Analyzer - is it possible to export data form a saved DWFBODEDATA file?  The data shows up if I use HotTrack but the export is grayed out.   So the data looks to be there, I just cannot save it.  Is there a conversion (or can someone help convert) the binary dwfbodedata file to numerical values?

 

PS - I *know* it should have been exported during the data acq process.  But the dwfbodedata was only saved so I will either have to redo the test or find a way to get the data.

'

THANKS in advance

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

These files are basically archives, containing configuration and binary data.

Install python, for instance WinPython and use the following script to convert .dwfbodedata to .csv

import numpy as np
import zipfile, re, math

#extract file
zipfile.ZipFile("your_file.dwfbodedata").extractall("./tmp")

#check number of samples and start/stop frequency
cfg = open("./tmp/config.config", "r").read()
csteps = int(re.compile(r"bodedata.NSteps\" value=\"(\d+)").search(cfg).groups()[0])
hzstart = float(re.compile(r"bodedata.BodeFreqStart\" value=\"(\d+)").search(cfg).groups()[0])
hzstop = float(re.compile(r"bodedata.BodeFreqStop\" value=\"(\d+)").search(cfg).groups()[0])

#read and decode binary data
ch1db = np.fromfile("./tmp/bodedata.channel0.BodeMag.bin", dtype=float)
ch2db = np.fromfile("./tmp/bodedata.channel1.BodeMag.bin", dtype=float)
ch2deg = np.fromfile("./tmp/bodedata.channel1.BodePhase.bin", dtype=float)

print(str(csteps)+" steps from "+str(hzstart)+" Hz to "+ str(hzstop)+" Hz")

#export to csv
f = open("your_file.csv", "w")
f.write("Frequency (Hz),Channel 1 (dB),Channel 2 (dB),Channel 2 (deg)\n")
for i in range(0,csteps):
    hz = hzstop * math.pow(10.0, 1.0*(1.0*i/(csteps-1)-1)*math.log10(hzstop/hzstart))
    f.write(str(hz)+","+str(ch1db[i])+","+str(ch2db[i])+","+str(ch2deg[i])+"\n")
f.close()

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...