Select Page

We are proud to announce that StellarNet customers can now run their spectrometers from MATLAB!  Our Engineers have integrated our new StellarNet python driver with the flexible MATLAB interface so now you can acquire spectroscopic data from any StellarNet spectrometer and utilize advanced MATLAB features such as signal processing, data visualization, machine learning and data analytics.


The StellarNet_matlab.m file is a MATLAB demo and solution for using StellarNet spectrometers to write custom MATLAB code.
When called, it performs the following task:

  • Initializes the instrument using programmed parameters such as integration time, scans to average, smoothing and digitizer timing.
  • Acquires the spectrum and plots the data to a graph (amplitude vs wavelength information).

The demo is written in MATLAB 2019a and has been tested under Windows 7 and 10. Since it uses a python interface, any MATLAB version that supports python interaction will be compatible with this script.

We recommend setting up your spectrometer(s) and verifying correct operation before using this software.



The MATLAB demo requires the following files:

  • pyd (Python driver)
  • Stellarnet.hex (firmware load file)

Our MATLAB demo uses our python drivers to communicate with spectrometers. Python 2.7 64 bit version is required along with the following libraries that can be installed using PIP:

  • Numpy
  • Scipy
  • Pyusb==1.0.0a3
  • Cython

Please refer to the instruction set in the SDK package for step by step instructions on how to install libraries using PIP.

The MATLAB code also requires .INF files to associate StellarNet spectrometers with LibUSB so that the spectrometer doesn’t associate with a Windows DLL. Right now, the easiest way to do that is installing LibUSB filter program provided in the package and following the instructions to register StellarNet spectrometer correctly.

How to Run

Open the stellarnet_matlab.m file with compatible MATLAB version. Make sure to connect the spectrometer and use LibUSB filter to register the spectrometer. If running for the first time, uncomment the first line in code that define python version and provide the python executable version.  Run the script the get the spectrum.