Using Minim to Deconstruct Waveform for Machine Troubleshooting

Hi,

I’m new to this forum. Currently trying to characterize different sounds in a mechanical process for troubleshooting purposes. My current approach utilizes a combination of the example script offlineAnalysis in the minim library for a visual representation as well as reading band data and finding the max amplitudes for targeted bands. No errors just looking for some direction here. Should I be doing more with breaking the targeted bands and maybe increasing the resolution or something else?

Hi, welcome to the forum :wave: Just some general suggestions - it’s always helpful to attach example data, code and screenshot etc so that people can give you more specific advice.

Another thing is that generally people here are oriented towards art and education. Your problem seems to be more engineering, specifically signal processing related, so you may want to look into other communities like Matlab. If you decide to crosspost, please post the link to this topic so we are on the same page.

Happy coding :robot:

2 Likes

Personally I have found the processing.sound library to be more practical in doing audio analysis than using minim. If you have a focusrite or other external audio interface I would suggest using a set up where you process “microphone” input, but you set your computer’s audio input to the audio interface, and play the sounds you are trying to analyze in through the interface while running the processing program. Here are the main parts of what that code would look like, where the spectrum array will contain pitch/frequency information:

import processing.sound.*;

FFT fft;
AudioIn in;
int bands = 512; // bands has to be a power of 2
float spectrum = new float[bands];

void setup() {
fft = new FFT(this, bands);
in = new AudioIn(this, 0);
in.start();
fft.input(in);
}

void draw() {
fft.analyze(spectrum);

// add code which processes the spectrum array

}