Skip to content

  There is a link at the bottom of the page for Matlab.zip with a Matlab Script to read the acquired data in Matlab/Octave and convert the data to a spectrum:

               AmptekPlot.pdf - An example plot

               SpecPlot.m - A Matlab Script to read a spectrum data file

               trig.txt - Matlab/Octave spectrum data

 

There is a document that explains the spectrum file format in the Amptek documentation: Amptek_Spectrum_File_Format.pdf

The LabVIEW SDK can also be downloaded.

This file is also in the C DP5 API SDK and the LabVIEW SDK.

               (LabVIEW SDK\LabVIEW DP5 SDK Help\Development Topics\Amptek_Spectrum_File_Format.pdf)

 

 

To read the file into matlab (the octave version)

1. Read the file (fileread)

2. Split the file into a string cell array (strsplit)

3. Find the "<<DATA>>" tag (n1) (n1 = find(ismember(z, "<<DATA>>"));

4. Find the "<<END>>" tag (n2) n2 = find(ismember(z, "<<END>>"));

5. The number of spectrum channels is (n2 - n1) - 1

6. The data array is in z (n1 + 1) to (n2 - 1)

 

 

FYI:

 

Another solution is to use the C DP5 API SDK DLL with MATLAB.

The C DP5 API SDK makes the process easier by simplifying the command interface.

C DP5 API SDK DLL download: C_DP5_API_SDK.zip

 

See:

               Getting Started -> C DP5 API SDK\Quick Start Guide.pdf 

               C Example -> "C DP5 API SDK\dppAcquire"

 

The C DP5 API SDK is in the process of being officially released.

 

https://www.mathworks.com/solutions/matlab-and-c.html

MATLAB can be used with C and C++ in a variety of ways.

The two environments can be used together for signal processing design,

including for calling MATLAB from C or C++,

using MATLAB code directly in C, or using C code directly in MATLAB.


 C_DP5_API_SDK   -DP5 SDK for C programming language
 Matlab SDK  -SDK for use with MATLAB 
 Labview SDK  -Labview SDK for DP5 devices