7
\$\begingroup\$

I need to do some audio spectrum analysis (basically, listening to a machine and tell if it is properly calibrated).

I will record the sound it makes with a microphone (it sounds differently if it is calibrated correctly than if it is not), and then want to look at the audio spectrum, with plans to automatically tell if a machine is set up correctly (currently, a human operator listens to the machine and does this job manually).

As a first step, this does not need to be real time, i.e., I will just make recordings of the machine (once set up correctly, once not), and compare the audio spectra.

My question is: Aside from the microphone, do I need a hardware spectrum analyzer, or does PC software suffice for this (FFT can of course be done on a computer too...). Particularly, because for a start, I do not need real-time analysis.

I am mainly asking because it seems that spectrum analysers cost quite a lot, and I don't want to purchase such a device if I don't actually need it.

\$\endgroup\$
  • 4
    \$\begingroup\$ There are free Android spectrum analysers for your phone. Did you try one? \$\endgroup\$ – Transistor Mar 26 '18 at 9:00
  • \$\begingroup\$ If it has a dominant tone, then guitar tuner apps may be worth a try too - mine has excellent tuning displays, and waterfall plots.... \$\endgroup\$ – Henry Crun Mar 26 '18 at 9:30
  • \$\begingroup\$ If your microphone is a smart microphone, you don't need anything else. It will show the spectrogram in real time, inside any webbrowser. And if you need the raw data, just peek at the Javascript which renders it - the spectrogram data is HTML5 Server-Sent Events. Full disclosure: I co-wrote the software of the linked product, although not these parts. \$\endgroup\$ – MSalters Mar 26 '18 at 13:02
  • \$\begingroup\$ It's rather unlikely that you would find a traditional analog swept spectrum analyzer for sensible audio purposes today. Pretty much anything is going to be a digital sample-and-FFT instrument. The only critical part of that is doing good sampling; after that, while it's possible to do the math incorrectly, no special hardware is required. So really this boils down to needing a good audio sampler and some decent software. Buying it in a special purpose box is probably possible, but the only thing you really need to spend money on is the sampler, and there's already a prosumer market for those. \$\endgroup\$ – Chris Stratton Mar 26 '18 at 16:18
  • \$\begingroup\$ At present, given that you have no performance criteria it unknowable if the stock audio hardware in your PC/laptop/phone could work. Probably best to find out before you go further - time for some experiments with Audacity, Octave, Matlab, or whatever you prefer. If you care about high frequencies it's worth noting that the MEMS microphones found in phones often do much better up there than the condenser mics found in laptops and cheap peripherals. \$\endgroup\$ – Chris Stratton Mar 26 '18 at 16:21
17
\$\begingroup\$

The deciding factor between stand-alone analyzer or soundcard would be the frequencies you're interested in.

I will record the sound it makes with a microphone (it sounds differently if it is calibrated correctly than if it is not),

If the difference is audible, this means the frequencies you want to measure are lower than 20kHz, which means audio gear will work. This is good news as it's readily available and cheap.

Don't use a RF spectrum analyzer for this! First, there is no need to pay for extra bandwidth you don't need, and second they have lower bandwidth limits that may not suit you. There is no need for specialized equipment either.

A soundcard (or audio input jack) on a PC, a tablet or a phone should work fine. If you have noise issues, the most likely culprit would be a cheapo microphone preamp inside your hardware, so consider an external preamp, or a microphone with integrated preamp. Try the cheapest solution first!

Your problem will most likely be how to get a good signal, which means select the right microphone/sensor, preamp, and technique.

If the sound is airborne, then a mic will work. However if you're interested in vibrations (say, to check on a bearing) then a piezo transducer or accelerometer applied to the chassis of the machine will pick up vibrations a lot better, while ignoring airborne noise. Why not a guitar piezo pickup? Or perhaps a directional microphone. Or two mics and take the difference between the signals. Good acquisition is essential, a clean signal is much easier to work with.

So think about where the sound you want to acquire comes from, where the noise you want to ignore comes from, and decide on which sensor you need.

There are several nice software packages to display real time FFT on a PC, try visual analyzer (free) for example. If you can see differences in spectrum then you can write a bit of software to acquire the signal, FFT it, and detect the relevant stuff automatically. I'd use python+scipy for this, as it has powerful and convenient signal processing tools. Or exploit a guitar tuning app as Henry says.

\$\endgroup\$
  • 4
    \$\begingroup\$ As a first step to play around with sound on a PC, Audacity is free and open source, and has recording (in your choice of format), and has spectrographs and a direct FFT "plot spectrum" dialog box with configurable FFT size and windowing function. Those links to the manual have images of what the UI looks like. Audacity doesn't do on-the-fly analysis while recording, but while experimenting you prob. want to re-analyze the same samples multiple ways to see what works. \$\endgroup\$ – Peter Cordes Mar 26 '18 at 13:37
  • \$\begingroup\$ The last RF analyzed I used went from 2Hz to 18GHz, perfectly suitable for audio ^^ \$\endgroup\$ – PlasmaHH Mar 26 '18 at 15:50
  • \$\begingroup\$ @PeterCordes yes audacity is nice too. I also recommend visual analyzer (link in answer) as it's free and has lots of useful features. \$\endgroup\$ – peufeu Mar 26 '18 at 16:22
  • 1
    \$\begingroup\$ Neat. Too bad Visual Analyzer appears to be Windows-only and closed source. :/ It looks like it's designed for what the OP is doing. Audacity builds are available for Windows / Linux / OS X (and other platforms), though. \$\endgroup\$ – Peter Cordes Mar 26 '18 at 16:26
  • 1
    \$\begingroup\$ @PeterCordes yeah it's closed source. If you want a free matlab-like tool which can acquire from soundcard and do any computation you want, I can recommend python+scipy. It's very powerful, and open source cross platform. \$\endgroup\$ – peufeu Mar 26 '18 at 20:04
7
\$\begingroup\$

I would personally recommend using a PC for several reasons.

From a monetary stand point, if there is sufficient information currently to identify issues using a trained ear, there is no need for an expensive hardware analyser with extended bandwidth. Most microphones are only designed to measure 20 Hz - 20 kHz anyway. You can probably buy a modest interface/preamp setup with a microphone, or even just get a USB microphone that includes all of that hardware built in for simplicity.

If you have experience in applied signal processing, you could even write a python/MATLAB/etc. script that would automate this whole process. This option would not be possible with a hardware analyser.

Just as an side if you are new to audio measurements: the key will be to focus on repeatability. Get a good measurement of a correctly calibrated machine, and make sure that you have noted down the exact procedure so that there won't be differences in the FFT due to changes in the setup. Room acoustics may play a part here, however if you place the microphone close enough you should be able to isolate the direct sound sufficiently. You may want to choose a directional microphone to ease this task too (cardiod/supercardiod/shotgun).

\$\endgroup\$
4
\$\begingroup\$

These days, any audio input hardware will be perfectly acceptable. Even the soundcard input to your PC will normally be OK; if you spend a few tens of bucks on a "proper" audio input box, it's guaranteed. The mic input circuit and ADCs have not been a limiting factor for audio for at least a decade, and any PC will be able to turn that into a frequency plot.

The microphone is critical though! Every microphone is different. If you want your calibration to be worth anything at all, you need a properly-designed measurement microphone. All other microphones are designed to have nonlinearities in their response, whether that's to make them pleasing to the ear, to create a polar response, or other characteristics. A measurement mic is designed to be the best possible omnidirectional profile with the least possible colouration to that sound.

They don't have to be expensive. If you just want "good enough", a Behringer ECM8000 or similar would be perfectly adequate. If your customers want properly traceable calibrations, you might need something better like a Beyer MM-1 with a factory-supplied calibration profile. Do not assume you can just throw any random microphone in there and have it work correctly though.

(Edit: Measurement mics are always small-diaphragm condensor/capacitor mics. This means your audio input hardware needs to be able to supply phantom power. Make sure you've checked this is the case.)

Also don't forget the microphone mount. The microphone will be pretty good at being omnidirectional, but the equipment may not be, depending on how the noise gets out of holes in the machinery and which parts resonate in what way. You need to mount the microphone in the same place relative to the machinery every time. You also need the stand not to be transmitting noise/vibration from the machinery to the microphone. A good stand (e.g. a Rycote Lyre) may cost more than the microphone.

\$\endgroup\$
  • 1
    \$\begingroup\$ It could be argued that the microphone can be somewhat calibrated out of the measurement, so long as the same setup is used in each measurement it would still be possible to compare a known good measurement to the new, unknown measurement (it's just relative, not absolute). However you make a very important point about the mounting. \$\endgroup\$ – loudnoises Mar 26 '18 at 15:49
  • 2
    \$\begingroup\$ @loudnoises Possibly - I guess it'd depend on the application. And if you absolutely knew where the sound was coming from, you could use something more directional to avoid sound from elsewhere. In both cases though I'd be worried about making my test process dependent on a single mic, and the tests not working if you change the mic. Some mics have good manufacturing control, so any two random mics will be rather similar, but some (especially cheaper ones) are a lot less so. \$\endgroup\$ – Graham Mar 26 '18 at 17:45
3
\$\begingroup\$

A PC can do spectrum analysis of captured sound. A hardware spectrum analyser can do a better job - so it depends on how good the analysis needs to be. The PC will probably be fine, for a couple of reasons:

  • You are only trying to be as good as or a bit better than a person listening and judging. The PC is way better than a human ear at making quantitative assessments of a sound

  • Much of the cost of a good spectrum analyser is the ability to work at high frequencies above the ones we can hear. If you're sticking in the audio range, then you don't need that.

So I would try it with a PC. Get a decent microphone too. And only if that doesn't work consider a spectrum analyser.

\$\endgroup\$
  • 3
    \$\begingroup\$ FFTS are very optimised, and run very fast when the data all fits inside one cores L1 or L2 cache on the PC e.g 16k points. It is likely to take longer for software to rummage through the frequency bins trying to make sense of it, than the FFT itself takes to execute. \$\endgroup\$ – Henry Crun Mar 26 '18 at 9:35
0
\$\begingroup\$

A PC (the main unit) has multiple switching supplies in it besides a lot of switching logic. These contribute to both conducted and radiated interference.

Whereas, a standalone or DSO based spectrum analyzer is designed ground up to have low self interference and excellent shielding to prevent pick up from external sources. So, in general they will have superior performance.

If you want to save money and yet get reasonable performance, take a look at an USB DSO with higher resolution/ quieter ADC. They may have better performance than card plugged in one of the PCIe slots

\$\endgroup\$
0
\$\begingroup\$

I have used Visual Analyzer with a $10 Sony handheld mic plugged into my laptop sound card, it worked well to help me determine that the hum from a tube amplifier was power line related - some at 60 Hz, more at 120 Ha and 180 Hz. Hard to filter out, but minimizable by playing with the voltage level of the heater elements of some of the tubes.

No idea if it works with Win10. I think I had Win Vista on an older laptop when I was using it. http://www.sillanumsoft.org/

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.