0% found this document useful (0 votes)
88 views16 pages

Post Processing Slam Stick Recording Files: Matlab

The document discusses tools for analyzing data recorded by Slam Stick devices, including free software that provides a quick overview of datasets, as well as command line utilities and MATLAB/Python scripts for more advanced processing; while the free software is easy to use, more powerful options like MATLAB require purchasing a license, but Python provides a free open-source alternative through libraries like SciPy. It also provides examples of using the command line utilities and MATLAB functions to convert files, apply calibration, and analyze vibration data from a car engine recording.

Uploaded by

IndianOnRun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views16 pages

Post Processing Slam Stick Recording Files: Matlab

The document discusses tools for analyzing data recorded by Slam Stick devices, including free software that provides a quick overview of datasets, as well as command line utilities and MATLAB/Python scripts for more advanced processing; while the free software is easy to use, more powerful options like MATLAB require purchasing a license, but Python provides a free open-source alternative through libraries like SciPy. It also provides examples of using the command line utilities and MATLAB functions to convert files, apply calibration, and analyze vibration data from a car engine recording.

Uploaded by

IndianOnRun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Post Processing Slam Stick Recording Files

The Slam Stick Lab offers a Slam Stick user a very easy to use free software tool for simple data analysis. Its
greatest strength is its ability to provide a quick overview of a particular dataset. There are some limitations with
this software package for post processing data recordings. Midé’s .IDE file format is optimized for efficiency on
the device and to describe all the sensor data that the Slam Stick is capable of recording (at varying time rates
and start times). But this optimization on the device creates some inefficiencies when loading and analyzing the
data.

The .IDE file format is based on Extensible Binary Meta Language (EBML), a structured binary format; recordings
are not stored in simple arrays which requires some parsing of recording files to generate arrays for post
processing. Midé offers two command line utilities which parse through an .IDE recording file to generate more
user friendly files with simple sensor arrays.

Midé also offers some example MATLAB scripts and Python scripts for completing this analysis. MATLAB is a
programing language designed specifically for technical computing and analysis. MATLAB arguably has a higher
processing capability and can generally complete an analysis in less time than a comparable Python script. But
MATLAB costs over $2,000 for a commercial license (only $150 for a home license). If cost is a concern,
Python offers an excellent alternative because it is open source and free! Their SciPy library offers a collection
of analysis toolboxes with similar functionality to MATLAB.

The following sections will go through some examples with the car engine vibration recording detailed as part of
the how-to video series: http://www.mide.com/pages/slam-stick-how-to-videos

Command Line Executables for Converting IDE Files


These utilities are run from the command line (also called the DOS shell). To begin run the command prompt
from your Start menu by searching for cmd or command prompt.

The command prompt will begin in the default location, typically the Windows user directory in the C: drive. If
the utility is located in another drive, change the drive by entering the drive letter followed by a colon as shown.
Then change the directory by entering cd followed by the folder location as shown. Some additional basic
instructions for entering and using the command line can be found here.

raw2mat – Convert Raw Data in IDE to MAT


The raw2mat utility creates a .MAT file from an .IDE Slam Stick recording file with all raw sensor data. It is a
command line utility with the same functionality built into the Slam Stick Lab under the tools menu: “Raw Data
to .MAT Utility.” Running raw2mat.exe –h will bring up the help menu as shown below with some more
information on its capabilities. This utility offers the user the most time efficient tool for accessing raw data; but
no calibration is applied.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 1 of 16


To run the utility simply type raw2mat.exe followed by the name of the file you’d like to convert (if the file is
located in a different directory you’ll have to include the path of this file as well). In this example the utility
completed the conversion of a recording file with nearly 4 million data points in about 10 seconds.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 2 of 16


When loaded into MATLAB you’ll see a large number of variables as shown below. These arrays contain the
raw sensor data in 16-bit integer format. The calibration coefficients are also stored which can be used to
convert the 16-bit integer data to calibrated data with appropriate engineering units. See the supporting MATLAB
functions for how to apply calibration.

ide2csv – Export Calibrated Slam Stick Data as TXT, CSV, or MAT


The ide2csv utility creates a series of .CSV files (Excel readable) from an .IDE Slam Stick recording file for each
sensor. The data in these files represents fully calibrated sensor data. This command line utility has the same
functionality built into the Slam Stick Lab under the tools menu: “Calibrated Data Export Utility.” This utility is
not as time efficient as the raw2mat utility but it will make processing a little more intuitive when loading fully
calibrated sensor arrays.

The utility can export .TXT and .MAT files as well; but we’ll look at the .CSV for this example. Running ide2csv.exe
–h will bring up the help menu as shown below that has some more information.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 3 of 16


To convert the recording to .CSV files simply enter ide2csv.exe followed by the filename. If you’d like a header
line to describe what’s in the columns user –n. The title of these headers reflects the same information shown
in the legend in the Slam Stick Lab main plot window.

It took 5 times longer (50 seconds) to generate the calibrated .CSV files of that vibration recording. Three
separate files are generated because there are three sensors. You’ll notice the data files are quite a bit larger
than the .IDE recording file because the data is no longer stored in a binary format and it isn’t 16-bit raw integer
data.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 4 of 16


The directory is shown below with the exported files.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 5 of 16


Opening one of the files in Excel lets you quickly and easily plot and analyze the data as shown.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 6 of 16


ide_split – Splitting Large IDE Recording Files
The battery life and storage capacity of the Slam Stick products can generate very large .IDE files, potentially
large enough to adversely affect the performance of Slam Stick Lab and even MATLAB and Python scripts. Midé
developed this command-line tool to split up large files into more manageably sized files for more efficient data
analysis. Running ide_split.exe –h will bring up the help menu as shown below that has some more information.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 7 of 16


In the below example we split the car engine recording file into 2 separate files.

When split files are loaded in Slam Stick Lab, blank space may appear before the start of the accelerometer data.
This visual gap does not indicate a loss of data. This occurs when temperature/pressure data appears before
accelerometer data. To accommodate this, the recording’s starting time is shifted back, overlapping the end of
the previous file. The time of the first accelerometer sample will be correct relative to the last accelerometer
sample.

MATLAB Example Functions


Midé provides some MATLAB functions to work with the raw2mat utility to apply calibration and perform some
simple analysis as well as plotting the data. The analysis supported in these files includes computing an FFT,
PSD, and spectrogram.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 8 of 16


SSL_Analyzer
The SSL_Analyzer_1.m function can run independently to prompt the user to select a .MAT file created with the
raw2mat. It can also be run as a function if you pass the filename as an argument when calling the function.
For the vibration example recoding from the car engine, the script takes about 10 seconds to load the data, apply
calibration, plot all data, and compute and plot FFTs, PSDs, and spectrograms. The code is fairly well
commented to help run a user through how all this is being done.

SSL_Converter
This function uses the command line utility raw2mat to take an .IDE file and convert it to .MAT, then calls the
SSL_Analyzer function to apply calibration and plot the data. This function then goes on to save the calibrated
data in a .MAT file with all sensor data. In a subdirectory the script also saves separate .MAT files for each sub-

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 9 of 16


channel with just an array with two columns: first column is time data, second is calibrated sensor values. The
array is named SS_data.

This function takes a little longer compared to running the raw2mat directly in the command prompt but still
completes the conversion, plotting/analysis, and saving calibrated data in just over 20 seconds.

Vibrationdata: Free MATLAB Signal Analysis and Structural Dynamics Package


Vibration expert Tom Irvine makes his MATLAB analysis package available online for free. This package is
incredibly useful and he has a lot of great content on his blog detailing how to use the package. Some of the
functions embedded in this free package are only available to paying customers of MATLAB’s signal processing
toolbox. This free package can be downloaded from his blog.

The following are a few screen shots showing the functions that are available to you in this package. We went
through a double integration example to compute the velocity and displacement of the car engine data. That
SSL_Converter function saves .MAT files in the two column format which makes it easier to load these files to
use with the vibrationdata GUI.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 10 of 16


Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 11 of 16
Python Support Functions
Python is a free programming language. Most vibration analysis will benefit from the NumPy library and the
SciPy library. Downloading all these library and dependencies can be a little cumbersome, Midé has had good
luck with the process outlined in this online video.

Load_Plot_RMS_FFT_Spectrogram
Midé provides an example Python script named Load_Plot_RMS_FFT_Spectrogram.py that can be run from the
command line. The script, shown below, prompts the user for a two column CSV file (time is the first column,
second represents data of interest), and plots the data. It then goes on to compute the moving RMS levels, and
an FFT and spectrogram of the entire dataset and plots these.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 12 of 16


Figure 1: An example python script to load a CSV, plot data, compute moving RMS, compute a FFT, and
compute a spectrogram.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 13 of 16


The script can be run from the command line as shown and it will output diagnostic information.

The plots generated from this script analyzing the car engine data are shown below.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 14 of 16


Vibrationdata: Free Python Signal Analysis and Structural Dynamics Package
Vibration expert Tom Irvine also posts a signal analysis toolbox in python that is similar to the MATLAB one. It
can be downloaded from his blog. It reads in a CSV file that has just two columns: time and the data of interest.
Use that example.py python script to see how to take data from a CSV file with multiple sensor sub-channels
and save a CSV with just two columns. This analysis package includes FFTs, PSDs, integration for velocity and
displacement, filtering, and many other functions. In the below example we show how to use it for a
spectrogram/waterfall FFT analysis.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 15 of 16


Python Code to Convert IDE to XML
Some example python code is provided to demonstrate how an .IDE file can be converted to .XML for the more
advanced user looking to directly load data in a recording file. The scripts are well documented but contact Midé
with any specific questions. Only advanced programmers with a thorough understanding of parsing through
binary data files should attempt to utilize these scripts.

Part Number Revision 18-Aug-16 www.mide.com mide.com/pages/contact 16 of 16

You might also like