MATLAB Spectrometer Software
Source Code DemoWe are proud to announce that StellarNet customers can now run their spectrometers from MATLAB! Our engineers have integrated our 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.
App Features
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 in SpectraWiz before using this software.
Dependencies
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 the StellarNet spectrometer correctly.
How to Run
Open the stellarnet_matlab.m file with a 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 defines the python version and provide the python executable version. Run the script to get the spectrum.
Documentation
Other Software Options
Technical Information Request
Cooking Oil Spectroscopy for the Perfect Thanksgiving Turkey
Happy Thanksgiving! Every year, we like to analyze popular Thanksgiving foods by using spectroscopy. As we gather around the Thanksgiving table, the spotlight shines on the star of the feast: the perfectly roasted turkey. While the turkey is often center stage, the...