bewantbe / audio-analyzer-for-android

A fork of audio-analyzer-for-android in Google code, with a lot of enhancement.
Apache License 2.0
284 stars 116 forks source link

Possibility to add calibration function? #13

Open bewantbe opened 7 years ago

bewantbe commented 7 years ago

As per user request in Play Store, have the ability to calibrate the spectrum would be nice.

But:

@nfsmaster208

nfsmaster208 commented 7 years ago

1) Yes, to both. The standard file format is *.cal, and the procedure for calibrating the microphone is best described with the following information:

AudioTool supports loading a calibration file for the Dayton Audio iMM-6 microphone. These files have names like "99-0101.txt" when downloaded from Dayton's website. For use in AudioTool, you will simply need to rename the file so that it has the .cal file type (e.g. "99-0101.cal") and save it in the AudioTool directory on your Android phone. Then, in AudioTool, select the "Load Cal" option from the Menu, and choose the Dayton file from the list. The calibration data will be loaded, power summed to the 1/3 octave bins used by AudioTool, and saved in your Preferences - there is no further need to load the file whenever you start AudioTool, unless you change the calibration method or alter the calibration values manually.

:information_source: https://sites.google.com/site/bofinit/audiotool#TOC-Calibration

2) If a user purchases a relatively affordable, pre-calibrated microphone (recommended method), they will be able to ensure high bandwidth and high accuracy microphone input. In the above example, the manufacturer provides a calibration file specific to the user's purchased microphone, which is accessible online as a ".txt" file, which in the manufacturer's current recommended procedure is converted to a .cal file by the user, and loaded into the AudioTool Android app.

3) It may be possible to calibrate any microphone, but with an external Sound Pressure Level (SPL) meter, which is a calibrated, external device which may be used to validate the sound pressure readings from the microphone on the device. For example, playing a 1kHz tone at 75dB, with the calibration settings available to the user with an uncalibrated microphone, they may be able to offset the readings on the Android device if the app is registering the correct frequency but at an incorrect reading of 78dB, with an offset of 3dB at that particular frequency.

This above method is largely unreliable manually, and could be automated, but with additional hardware and expense. It would be better to have a previously calibrated microphone with a calibration file, as previously discussed.

bewantbe commented 7 years ago

Thank you for these valuable information! I didn't relized that there are calibrated mic for smart phone (and with 3.5mm jack).

  1. I downloaded some .cal/.txt files (for Dayton Audio iMM-6 or MiniDSP), they are plain text, so it should be easy to parse and implement in my app.

  2. I was think about for example you have a reference mic that connects to PC (through audio interface or whatever), then how to calibrate your phone? i.e. How to get consistent and comparable results across different devices(mics). This is my original understanding of your question about having the calibration related ability.

    But now you show me that there are cheap calibrated microphones, so purchase that mic with calibration file would be much more handy for both app developer and user.

    Looks like AudioTool is a powerful app and more or less is the official recommendation. Did you try it, or have any comment on it?

  3. So basically a sine sweep test right? Agree that it is unreliable due to environment noise, room reverberation and pointing etc.

    I'm just thinking about what if the user do not have any calibrated mic available. But maybe a quiet place can be found, so that the environmental noise may be assumed to be the pink noise...... OK, forget that, purchase a good mic.

nfsmaster208 commented 7 years ago

1) That sounds great! 2) I don't have any personal comment on AudioTool. I have not had the opportunity to use it. 3) Yes. And a good mic helps to solve many of those concerns. :+1: