File Exchange

image thumbnail

SDF Importer

version 1.0.4 (6.82 MB) by Justin Dinale
Enables importing of HP/Agilent/Keysight Standard Data Format (SDF) files within MATLAB and Octave.

14 Downloads

Updated 05 Aug 2018

View Version History

View License

We present the ‘SDF Importer’, a package developed to enable reading of HP/Agilent/Keysight Standard Data Format (SDF) files within MATLAB and Octave.
We provide a brief introduction to the package’s functions, a description of the structure of the extracted data, and step by step instruction on extracting and displaying single-trace and multi-trace datasets. Additionally an assessment of the importer against the Standard Data Format Utilities supplied with original HP equipment is performed.

Cite As

Justin Dinale (2021). SDF Importer (https://www.mathworks.com/matlabcentral/fileexchange/67513-sdf-importer), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Justin Dinale

Hi Mike and Utku,
Sorry for the late reply.
If you could both send me an email with the file you are experiencing issues with attached, I'll have a look at it.
My email address is in the function comments.

Regards,
Justin

Utku Emre Ali

I have the following problem with my SDF file:

Unable to perform assignment with 0 elements on the right-hand side.

Error in SDF_import>SDF_Interpret_Template (line 367)
eval(['retval.zz_' cnt.FieldName ' = cnt.Table{' ...

Error in SDF_import (line 121)
data.SDF_MEAS_HDR = SDF_Interpret_Template('SDF_MEAS_HDR',
file_raw,data.SDF_FILE_HDR.recordSize+3);

Error in SDF_demo (line 47)
[data, file_raw] = SDF_import('aaaa.DAT');

Mike Ravicz

I have a similar problem with a file from a HP 35665A spectrum analyzer:
Error using eval
Undefined function or variable 'uint480'.

Error in SDF_import>SDF_uintX_vector (line 605)
eval(['retval = uint' num2str(bytes * 8) '(0);']);

Error in SDF_import>SDF_float_vector (line 875)
retval = double(typecast(SDF_uintX_vector(arg),'single'));

Error in SDF_import (line 202)
eval(['data.SDF_SCAN_STRUCT.scanVar(n,:) = SDF_' data.SDF_SCAN_STRUCT.zz_scanVar_type

It seems to be the same type of error that Bart Kus encountered - is it possible that the code didn't get updated?
Thanks for any assistance - Mike Ravicz

Justin Dinale

Bart,
I have made changes in v1.0.4 which should address the error you experienced. It was caused by an error in the way the arrays were reshaped just prior to line 195. Let me know how it goes.

Bart Kus

HP 89441A time capture file doesn't work with this SDF importer:

>> SDF_import('A:/CAPT2.DAT')
Error using eval
Undefined function or variable 'uint40'.

Error in SDF_import>SDF_uintX_vector (line 595)
eval(['retval = uint' num2str(bytes * 8) '(0);']);

Error in SDF_import>SDF_float_vector (line 865)
retval = double(typecast(SDF_uintX_vector(arg),'single'));

Error in SDF_import (line 195)
eval(['data.SDF_SCAN_STRUCT.scanVar(n,:) = SDF_' data.SDF_SCAN_STRUCT.zz_scanVar_type ...

Justin Dinale

Please be aware that for some reason File Exchange is not uploading the new version of SDF_Import.
I have been in contact with Mathworks, and they are investigating the problem.

Justin Dinale

JBSAAR,
If you email me a sample multi-channel measurement file from the HP35670a Dynamic Signal Analyzer, I'll have a look at it. Contact details functions comments.

JBSAAR

It does not appear to work for multi-channel measurements with data from an HP35670a Dynamic Signal Analyzer. I get the following error.

Error in SDF_import>SDF_Multi_ChannelY (line 1090)
tmp = data.SDF_YDATA_HDR.zz_raw_data(y_idx+1:y_idx+numBytes);

Error in SDF_import>SDF_YDATA_Process (line 425)
[data,y_idx] = SDF_Multi_ChannelY(data,n_ns,y_idx); % For some reason 'data' was 'tmp'

Error in SDF_import (line 237)
data = SDF_YDATA_Process(data,file_raw);

Single channel measurements work just fine.

JBSAAR

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!