Wolfram Blog
Håkan Wettergren

How to Use Your Smartphone for Vibration Analysis, Part 2: The Wolfram Cloud

April 7, 2017 — Håkan Wettergren, Applications Engineer, SystemModeler (MathCore)

Making tone with wine glass

Vibration measurement is an important tool for fault detection in rotating machinery. In a previous post, “How to Use Your Smartphone for Vibration Analysis, Part 1: The Wolfram Language,” I described how you can perform a vibration analysis with a smartphone and Mathematica. Here, I will show how this technique can be improved upon using the Wolfram Cloud. One advantage with this is that I don’t need to bring my laptop.

The configuration of files may vary depending on whether you use an iPhone or an Android. I used an iPhone. I also used Dropbox for storing the sound file. At the moment, the file format from the default app in iPhone, Voice Memo, saves the sound file only in M4A format, and that format can’t yet be imported with the Wolfram Language. Therefore, I used the app Awesome Voice Recorder, AVR, which can also store the file in Dropbox.

  1. First, create a Wolfram Cloud Account.
  2. Install the Wolfram Cloud app on your smartphone.
  3. If you don’t already have a Dropbox account, create one.
  4. Download an app that can save the sound file in MP3 format to your Dropbox. I use AVR.

You are now ready to create a vibration analysis tool.

With my iPhone, I recorded 10 seconds of the sound of my finger rubbing around the rim of a wine glass.

I named the file “wineglass.mp3” and stored it on Dropbox. Some simple code for the Fourier transform of that sound looks like the following:

Smartphone Vibration Analysis Part 2 - InOut Img - 1

It is now easy to deploy the same code to the Wolfram Cloud. Name the file “FFT Basic”. With modifications to obtain the sound data from a form instead of the file system, the FFT code looks like this:

Smartphone Vibration Analysis Part 2 - InOut Img - 5

Now go to the top-left menu in the mobile cloud app. Select Deployments and then Instant Web Forms, and you’ll see the executable file. Click it and then click to select the file, and the fast Fourier transform (FFT) results will be shown.

Progression of fast Fourier transform analysis on smartphone

The tool can be generalized by allowing the user to change the scale and draw a line to show known frequencies. Typical frequencies that you may want to follow in vibration analysis are gear mesh frequencies, imbalances, blade-passing frequencies and known resonances. For the wine glass, we don’t currently have a known disturbance or resonance frequency, but I included a line anyway:

Smartphone Vibration Analysis Part 2 - InOut Img - 6

Deploy the code to the Wolfram Cloud, naming the file “FFT Analysis”:

Smartphone Vibration Analysis Part 2 - InOut Img - 7

With the improved code, I can also work with the FFT plot in the app:

FFT analysis phone screenshot

This was my first experience with the Wolfram Cloud, and within an hour I had an application ready to go. The resonant frequency of the glass is 771 Hz, a frequency the human voice is capable of, so the opera trick of shattering a glass by singing is plausible. We tried using a loudspeaker playing a tone at 771 Hz, but had no success. There will be YouTube videos when we have managed this.

Leave a Comment

No Comments

Leave a comment


Or continue as a guest (your comment will be held for moderation):