How to Use Your Smartphone for Vibration Analysis, Part 2: The Wolfram Cloud
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.
- First, create a Wolfram Cloud Account.
- Install the Wolfram Cloud app on your smartphone.
- If you don’t already have a Dropbox account, create one.
- 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:
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:
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.
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:
Deploy the code to the Wolfram Cloud, naming the file “FFT Analysis”:
With the improved code, I can also work with the FFT plot in the app:
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.