• 0
mkj

Data export from dwfbodedata file?

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

Edited by sudharsan.sukumar

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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()

 

Edited by attila

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now