Acoustical Measurements with Smartphones: Possibilities ... Acoustical Measurements with Smartphones:

  • View
    6

  • Download
    0

Embed Size (px)

Text of Acoustical Measurements with Smartphones: Possibilities ... Acoustical Measurements with...

  • 10 | Acoustics Today | Summer 2017

    Acoustical Measurements with Smartphones: Possibilities and Limitations A smartphone-based sound level meter or analyzer may or may not replace your expensive, precision instruments. Introduction With an estimated 1.4 billion units sold globally in 2016 (GfK, 2016), smartphones constitute a ubiquitous mobile computing device, capable of performance com- parable to that of high-end desktop computers of just a few years ago. Beyond their undeniably widespread adoption, smartphones are mediacentric devices, complete with microphones, cameras, wireless communications, and large touch screens. For those with a smartphone in their pocket, and particularly those inter- ested in acoustics, this raises several questions such as, “Now that I have a micro- phone connected to a computer in my pocket, what can I measure with it?” and, “How good could the measurements be?”

    The Signal Path To answer such questions regarding the use of smartphones in acoustics, it be- comes important to understand the path through which an acoustic signal must pass to be accounted for in any kind of measurement or analysis software. Al- though the signal path must obviously include some kind of transducer, such as a microphone or loudspeaker, there are other elements to consider, such as analog and digital electronics, device firmware, and operating system (OS) software. The focus of the smartphone on media creation and consumption leads to a relatively mature handling of audio signals. Existing smartphone-based solutions for acous- tical measurement and analysis rely on this well-established audio signal path to provide convenience and low cost. Figure 1 illustrates the most common audio connections for a smartphone.

    Getting Signals Into the Device The most obvious portion of the audio signal path may be the built-in microphone

    | volume 13, issue 2 ©2017 Acoustical Society of America. All rights reserved.

    Benjamin M. Faber

    Postal: 277 South 2035 West

    Lehi, Utah 84043 USA

    Email: ben@faberacoustical.com

    Figure 1. Common audio input and output connections for smartphones and other mobile devices.

  • Summer 2017 | Acoustics Today | 11

    of the smartphone. Although recent smartphone models often incorporate two or more microphones for noise re- duction and/or beamforming for the purpose of enhanc- ing speech signals, it is common to find a primary, omni- directional microphone that may be most useful for typical acoustical measurements, such as the overall sound level.

    The directionality of the microphone is an important param- eter to consider when assessing the suitability of a particu- lar smartphone as a measurement device. Dedicated sound level meters (SLMs) employ measurement microphones that are designed to exhibit a directional sensitivity that is as omnidirectional as possible. A microphone that exhibits a cardioid, supercardioid, or some other nonuniform direc- tional pattern will be of limited value for overall sound level measurements because of its decreased sensitivity to sounds coming from certain directions. It is important to note that the shape of the smartphone body will itself have some im- pact on the directional behavior of its embedded omnidirec- tional microphone(s), especially at higher frequencies.

    Beyond the built-in microphone, there are several other mechanisms available for getting signals into a typical smart- phone. These include headset microphone input, Bluetooth and Wi-Fi wireless communications protocols, and electri- cal ports that can support either standardized (e.g., USB Au- dio Class driver) or proprietary protocols for data transmis- sion. The audio signal path is currently best supported by standard protocols for Bluetooth and USB, but this does not preclude the existence of, or potential for, other proprietary solutions for acquiring acoustic signals with a smartphone.

    The simplest mechanism for connecting an external mea- surement microphone to a smartphone is via the common headset jack. Most smartphones include a headset jack, which, in addition to serving as a headphone jack for au- dio output, supports a single microphone input. A typical headset microphone may have similar characteristics to the built-in microphone of the smartphone, but the headset jack makes it possible to connect a higher quality measure- ment microphone without the need for additional adapters or power sources. This means that using a microphone con- nected to the headset jack represents the most affordable and portable means for replacing the built-in microphone as the primary input source for higher quality measurements.

    Getting Signals Out of the Device For certain kinds of measurements, such as measuring the frequency response of a sound reinforcement system or the

    impulse response of a listening room, getting signals out of the smartphone can be just as important as the inputs. Smartphones typically have very small built-in loudspeakers with a limited frequency range or limited power output, but they also have a headphone jack through which signals can be transmitted to a power amplification system or directly to a device under test (DUT). In addition to built-in ana- log outputs, smartphones offer the same alternative signal paths for output as for input. That is, signals can potentially be transmitted over Bluetooth, Wi-Fi, USB, or some other proprietary interface.

    Hardware Considerations In addition to the directional behavior of the microphone, as mentioned previously, the frequency response, dynamic range, sensitivity, and other characteristics of the various hardware components within the signal path can significant- ly impact the accuracy and/or precision of a measurement. The presence of automatic gain control (AGC), for example, which is commonly used to optimize the acquisition of speech signals for telephony, may significantly diminish the accuracy of an overall sound level measurement, even though it may not adversely affect a measurement designed solely to identify specific frequency components of an acoustic signal.

    Operating System Considerations Once a signal of interest passes through the relevant hard- ware components into the digital domain, the OS of the smartphone takes ownership. Again, this new step in the sig- nal path can potentially affect the viability of a measurement. One way for OS software to directly affect the potential for quality measurements is to offer mechanisms for control- ling certain behaviors of the hardware components within the signal path. For example, if a hardware component, such as the analog-to-digital converter (ADC), employs its own form of AGC, then it may be possible for the OS to provide an application programming interface (API) to third-party apps to allow them to disable it for the sake of measurement accuracy. As another example, the OS may provide an API for adjusting the analog gain of the microphone input signal prior to digitization.

    OS-level signal processing may also affect signal integrity. When third-party application software (an app) requests an input signal at a sample rate that is different from the hard- ware sample rate, the OS may resort to sample rate conver- sion, which requires some form of filtering that may have an impact on the frequency content of the signal. OS software

    | volume 13, issue 2 ©2017 Acoustical Society of America. All rights reserved.

  • 12 | Acoustics Today | Summer 2017

    may also include its own algorithms for manipulating the input audio signal to optimize it for telephony or automatic speech recognition. If an app developer has no way to cir- cumvent OS-level signal-processing schemes or ensure the desired behavior of the various hardware components in the signal path, then it may be impossible to provide a reliably accurate or precise measurement solution by relying on the existing audio signal path. Fortunately, some OS-level APIs include options to bypass any extra signal pro- cessing that would signifi cantly corrupt or dis- tort the incoming audio signal (whether from the built-in microphone or some other audio input source). Of course, a solution that by- passes the well-established audio signal path in favor of a proprietary one could be devel- oped. Th is kind of proprietary solution would require additional external hardware and would necessarily come at a higher cost.

    A real-world example of the impact an OS can have on the signal path is shown in Figures 2 and 3. In some iPhone OS (iOS) versions be- fore iOS 6, a high-pass fi lter was applied to both the built-in microphone signal and the headset microphone signal. Th e low-frequen- cy eff ects of this fi lter can be seen in Figure 2. For measurement purposes, the microphone inputs of the iPhone were of limited value for frequencies below about 200 Hz. When iOS 6 was introduced in 2012, an API was added that allowed app developers to enable a so-called “measurement mode.” Th e eff ect of enabling measurement mode, which also disabled AGC for the same input signals, is shown in Figure 3.

    Calibration An accurate sound level measurement re- quires that the smartphone solution be cali- brated. Calibration refers to the comparison of a sound level measured by the smartphone- based meter and a properly qualifi ed SLM with a known degree of accuracy. Once such a com- parison is made, input sensitivity values with a smartphone app can be adjusted to produce results that match those of the reference SLM.

    A digitized signal is represented