Article On Power Consumption in Acoustic Environment Monitoring Applications

Sergey Zhidkov * ID , Andrey Sychev, Alexander Zhidkov and Alexander Petrov

Cifrasoft Ltd., Izhevsk 426001, Russia; [email protected] (A.S.); [email protected] (A.Z.); [email protected] (A.P.) * Correspondence: [email protected]; Tel.: +7-341-260-0526

Received: 18 January 2018; Accepted: 14 March 2018; Published: 19 March 2018

Abstract: In this paper, we provide a systematic analysis of smartphone power consumption in background audio recording scenarios. We report comprehensive measurement results for several Android smartphone models with diverse hardware specifications, running different types of Android operating systems (OS). Our experimental results show that with respect to background audio sensing applications, the major impact on smartphone power consumption is associated with the core audio recording functionality. On the other hand, moderately complex digital signal processing algorithms (e.g., sound pressure level estimation, acoustic feature extraction, and audio fingerprinting) that operate simultaneously with background audio recording do not significantly affect overall smartphone power consumption or battery life. Power consumption varies significantly from model to model, and we found no obvious correlation between the power consumption of background audio recording scenarios and factors such as the year of release, the OS version, or the model of smartphone processor or system-on-chip (SoC) hardware.

Keywords: ; power consumption; acoustic monitoring; digital signal processing

1. Introduction Recently, there has been growing interest in the use of inexpensive off-the-shelf smartphones in various innovative applications beyond regular voice calls. A modern smartphone is equipped with multiple sensors, including a microphone, which is perhaps the most ubiquitous and universally available sensor to third-party application developers. Several emerging mobile applications in such fields as healthcare and environmental monitoring require mobile devices that continuously perform microphone sensing and real-time digital signal processing in background mode. Examples of such applications include:

• Mobile applications that measure a person’s exposure to background acoustic noises to assess the risk of noise-induced hearing loss (also known as “noise dosimeters”) [1,2]; • Applications for crowd-sourced noise pollution monitoring and urban noise mapping [3–5]; • Sleep quality monitoring [6], estimation of respiratory rates [7], and obstructive sleep apnea monitoring applications [8]; • Smartphone-based TV and radio audience research applications [9,10]; • In-door location and proximity detection based on near-ultrasound acoustic beacons [11,12].

One of the major challenges in developing practical applications that require background audio monitoring is the power consumption of the microphone sensor and the associated digital signal processing. The Android (OS), which is one of the most widely used OSs in the smartphone market, allows audio recording in background mode. However, the commercial feasibility

Appl. Syst. Innov. 2018, 1, 8; doi:10.3390/asi1010008 www.mdpi.com/journal/asi Appl. Syst. Innov. 2018, 1, 8 2 of 11 of the abovementioned applications strongly depends on the impact of background audio sensing on a smartphone’s battery life [13]. A number of previous studies have been devoted to the analysis of smartphone power consumption in different use scenarios [14–18]. However, most of these works do not explicitly analyze the background audio recording mode. For example, in [14] the authors analyze the power consumption of Wi-Fi use, the graphical processing unit, and video recording of four mobile devices ( Galaxy line). In [18], the authors report the results of power consumption measurements for typical multimedia applications that extensively use a smartphone display. Finally, in [19], the authors report the power consumption of the microphone recording mode, yet they only provide the results for the S6 smartphone. In this paper, we provide a systematic analysis of smartphone power consumption in background audio recording scenarios. We report comprehensive measurement results for several Android smartphones with diverse hardware and specifications. We also report the power consumption results for typical real-time digital signal processing algorithms that are frequently used simultaneously with background audio recording.

2. Methodology We selected 18 mid-range and low-end Android smartphones from various device manufacturers, running different versions of the Android OS. In our test sample, one device was running Android 7.0, three devices were running Android 6.x, five devices were running Android 5.x, eight devices were running Android 4.x, and one device was running Android 2.3. These devices and their essential characteristics are listed in Table1. To perform power consumption measurements, a test smartphone was connected to the digital programmable power supply Rigol DP832A with the high-resolution option [20], and the digital programmable power supply was linked to a notebook PC via USB interface for loggingsubsequent data analysis. The schematic diagram of the experiment and the test setup are illustrated in Figure1. To automate the process of power consumption measurements in different modes of operation, we developed a custom Android application that periodically performed microphone audio recording and digital signal processing using several signal processing algorithms with different levels of complexity. The audio signal from the microphone was captured using the Android AudioRecord class [21] at a sampling rate of 44.1 kHz, and all digital signal processing algorithms were implemented in optimized fixed-point C++ code and integrated into the test application via the Android Native Development Kit [22]. To minimize the influence of other hardware and software components on the measurement results, we turned off 2G/3G/LTE mobile data transfer, disabled Wi-Fi and Bluetooth radios, and uninstalled or disabled all non-system applications (social networks, messengers, etc.) that could consume battery power in background mode. Firstly, we ran audio recording tests without any signal processing at all. In this mode of operation, the audio samples that were received in the audio recording callbacks were simply ignored and the processing thread was inactive. Secondly, we run three real-time digital signal processing algorithms: “simple” (algorithm #1), “moderately complex” (algorithm #2), and “fairly complex” (algorithm #3), listed in Table2. Each algorithm was active for 15 min with a 2 min “cool down” interval between runs, and then the measurement cycle was repeated multiple times. Each experiment lasted for at least 24 h. Instant (second-by-second) power consumption measurements were recorded using a digital programmable power supply and transferred to the notebook PC via USB interface. A typical sequence of recorded power consumption measurements is illustrated in Figure2. As one can see, the instant power consumption never drops below a certain minimum level (in our example, 170 mW), and has occasional spikes as high as 650 mW (algorithm #3). These power variations are caused by the complex and dynamic nature of Android OS behavior. Moreover, all modern Android smartphones use dynamic central processing unit (CPU) frequency scaling (CPU throttling). Due to computational Appl. Syst. Innov. 2018, 1, 8 3 of 11 Appl. Syst. Innov. 2018, 1, x FOR PEER REVIEW 3 of 11 complexity,switch to a higher algorithm CPU #3 frequency, usually causes which the results CPU in governor an overall to switch power to consumption a higher CPU increase frequency, (see whichFigure results2). in an overall power consumption increase (see Figure2).

(a) (b)

Figure 1. ((a)) A typical typical schematic diagram of the test environment;environment, and (b) an example of testtest setup.setup.

Table 1. The list of tested Android smartphones and their essential characteristics. Table 1. The list of tested Android smartphones and their essential characteristics. Smartphone Model OS SoC/Processor CPU Core Battery SmartphoneLenovo A1000 Model OS5.0 SoC/ProcessorSC7731 4×1.3 CPUGHz Core Cortex‐A7 2000 Battery mAh LenovoFly FS510 A1000 5.06.0 SC7731MT6580 4×1.3 4×1.3 GHz GHz Cortex-A7Cortex‐A7 4000 2000 mAh mAh SamsungFly FS510 Galaxy S4 6.04.2 Exynos MT6580 5410 4×1.2 4×1.3 GHz GHz Cortex-A7Cortex‐A7 2600 4000 mAh mAh 4.2 Exynos 5410 4×1.2 GHz Cortex-A7 2600 mAh PrestigioPrestigio PAP4055Duo PAP4055Duo 4.14.1 MT6577TMT6577T 2×1.2 2×1.2 GHz GHz Cortex-A9Cortex‐A9 2500 2500 mAh mAh LGLG G2 G2 mini mini 5.05.0 MSM8226MSM8226 4×1.2 4×1.2 GHz GHz Cortex-A7Cortex‐A7 2440 2440 mAh mAh LGLG Optimus Optimus L3 L3 2.32.3 MSM7225AMSM7225A 800 800 MHz Cortex-A5Cortex‐A5 1500 1500 mAh mAh AlcatelAlcatel Pixi Pixi 4 (5) 4 (5) 6.06.0 MT6735MMT6735M 4×1.0 4×1.0 GHz GHz Cortex-A53Cortex‐A53 2000 2000 mAh mAh LG L50 4.4 MT6572 2×1.3 GHz Cortex-A7 1900 mAh LG L50 4.4 MT6572 2×1.3 GHz Cortex‐A7 1900 mAh Micromax Juice (Q3551) 6.0 SC8830 4×1.2 GHz Cortex-A7 3000 mAh MicromaxSamsung Juice Ace 2(Q3551) 4.16.0 DB8500SC8830 24×1.2×800 GHz MHz Cortex Cortex-A9‐A7 3000 1500 mAh mAh SamsungSamsung Galaxy Ace S2 2 4.14.1 ExynosDB8500 4210 2×800 2×1.2 MHz GHz Cortex-A9 Cortex‐A9 1500 1650 mAh mAh SamsungMeizu Galaxy M3 S2 5.14.1 Exynos MT6750 4210 82×1.2×1.5 GHz Cortex-A53 Cortex‐A9 1650 2870 mAh mAh × SamsungMeizu Galaxy M3 S4 mini 4.25.1 MSM8930ABMT6750 8×1.5 2 1.7 GHz GHz Cortex Cortex-A7‐A53 2870 1900 mAh mAh S890 4.1 MT6577 2×1.2 GHz Cortex-A9 2250 mAh SamsungPhilips Galaxy S386 S4 mini 7.04.2 MSM8930AB MT6580 2×1.7 4×1.3 GHz GHz Cortex-A7Cortex‐A7 1900 5000 mAh mAh SamsungLenovo Galaxy S890 Tab 2 4.14.1 OMAP4430MT6577 2×1.2 2×1.2 GHz GHz Cortex-A9Cortex‐A9 2250 4000 mAh mAh LeagooPhilips Z1 S386 5.17.0 MT6580MT6580 4×1.3 4×1.3 GHz GHz Cortex-A7Cortex‐A7 5000 1300 mAh mAh SamsungZTE Blade Galaxy L5 Tab 2 5.14.1 OMAP4430 MT6572 2×1.2 2×1.3 GHz GHz Cortex-A7Cortex‐A9 4000 2150 mAh mAh Leagoo Z1 5.1 MT6580 4×1.3 GHz Cortex‐A7 1300 mAh ZTETable Blade 2. Experimental L5 5.1 algorithms MT6572 used for the power2×1.3 consumption GHz Cortex evaluation.‐A7 2150 mAh

Algorithm Complexity Algorithm No.Table 2. Experimental algorithms Description used for the power consumption evaluation. Measure 1 Algorithm A-weighting, sound pressure level estimation, simple audio feature Algorithm Complexity Algorithm #1 Description 0.9 No. extraction in time-domain [3,23] Measure 1 A‐weighting, sound pressure level estimation, simple audio feature extraction AlgorithmAlgorithm #1 #2 Algorithm #1 + calculation of audio fingerprints (audio hashes) [24] 70.9 in time‐domain [3,23] Detection and decoding of near-ultrasound communication signal AlgorithmAlgorithm #2 #3 Algorithm #1 + calculation of audio fingerprints (audio hashes) [24] 887 (greedy synchronization algorithm, OFDM demodulator, Viterbi decoder) Detection and decoding of near‐ultrasound communication signal (greedy Algorithm1 #3 88 Algorithmsynchronization complexity was algorithm, measured inOFDM millions demodulator, of required Viterbi CPU cycles decoder) per second on a single core digital signal processing platform TMS320C6748 clocked at 300 MHz [25]. 1 Algorithm complexity was measured in millions of required CPU cycles per second on a single core digital signal processing platform TMS320C6748 clocked at 300 MHz [25].

Appl. Syst. Innov. 2018, 1, 8 4 of 11 Appl. Syst. Innov. 2018, 1, x FOR PEER REVIEW 4 of 11 Instant power consumption (mW) Instant power

FigureFigure 2. 2.Example Example of instant of instant power power consumption consumption measurements measurements using the developedusing the testdeveloped application. test application. 3. Results and Discussion 3. Results and Discussion 3.1. Power Consumption in Background Audio Recording with and without Digital Signal Processing 3.1. Power Consumption in Background Audio Recording with and without Digital Signal Processing The second-by-second power consumption readings for all signal processing algorithms were averagedThe andsecond plotted‐by‐second in Figure power3, along consumption with 99% confidence readings for intervals. all signal As processing one can see, algorithms the difference were betweenaveraged the and devices plotted with in Figure the lowest 3, along and with highest 99% powerconfidence consumption intervals. mayAs one be can quite see, high the (updifference to six timesbetween in our the experiments).devices with the It islowest also interestingand highest to power note thatconsumption “simple” may and “moderatelybe quite high complex”(up to six digitaltimes in signal our processingexperiments). algorithms It is also do interesting not significantly to note that contribute “simple” to overalland “moderately smartphone complex” power consumption.digital signal Onlyprocessing the most algorithms complex do signal not processingsignificantly algorithm contribute #3 visiblyto overall increases smartphone smartphone power powerconsumption. consumption. Only Nonetheless,the most complex even thesignal extreme processing optimization algorithm of algorithm #3 visibly #3 increases (for example, smartphone down topower complexity consumption. of algorithm Nonetheless, #1) would even reduce the theextreme power optimization consumption of by algorithm 28% on average, #3 (for whileexample, in certaindown smartphonesto complexity the of potential algorithm power #1) would consumption reduce reductionthe power would consumption be only 7%–15%.by 28% on average, whileFigure in certain4 shows smartphones the expected the battery potential life power for all consumption 18 tested smartphones reduction inwould the case be only of continuous 7%–15%. audioFigure recording 4 shows without the anyexpected signal battery processing life for and all in 18 the tested case smartphones of audio recording in the andcase simultaneous of continuous real-timeaudio recording digital signal without processing any signal (algorithm processing #3). and The in median the case expected of audio battery recording life was and approximately simultaneous 28real h‐ withtime algorithmdigital signal #3 and processing approximately (algorithm 40 h without #3). anyThe digital median signal expected processing. battery Nonetheless, life was 3approximately out of 18 devices 28 (17%) h with were algorithm not able #3 to and operate approximately longer than 40 22 h h without in continuous any digital audio signal recording processing. mode evenNonetheless, without any 3 out real-time of 18 devices digital (17%) signal were processing. not able It to is worthoperate mentioning longer than that 22 these h in continuous results represent audio arecording rather idealistic mode even scenario, without because any wereal disabled‐time digital mobile signal data processing. transfer, Wi-Fi It is worth and Bluetooth mentioning radios, that allthese third-party results represent background a rather applications, idealistic and scenario, used the because nominal we battery disabled capacity mobile to data predict transfer, battery Wi life.‐Fi Inand a realistic Bluetooth device radios, usage all scenario, third‐party the battery background life would applications, be shorter and due toused the batterythe nominal degradation battery effectcapacity [26]. to predict battery life. In a realistic device usage scenario, the battery life would be shorter due to the battery degradation effect [26].

Appl. Syst. Innov. 2018, 1, 8 5 of 11 Appl. Syst. Innov. 2018, 1, x FOR PEER REVIEW 5 of 11

Appl. Syst. Innov. 2018, 1, x FOR PEER REVIEW 5 of 11

FigureFigure 3. Average 3. Average power power consumption consumption with confidence with confidence intervals intervals for the 18for testedthe 18 Android tested smartphones Android in foursmartphonesFigure different 3. Average modes in four ofdifferent power operation. consumption modes of operation with . confidence intervals for the 18 tested Android smartphones in four different modes of operation.

Figure 4. Expected battery life of the fully charged smartphones in audio recording only mode and “AlgorithmFigure 4. Expected 3” mode battery. life of the fully charged smartphones in audio recording only mode and Figure 4. Expected battery life of the fully charged smartphones in audio recording only mode and “Algorithm 3” mode. “Algorithm 3” mode.

Appl. Syst. Innov. 2018, 1, 8 6 of 11 Appl. Syst. Innov. 2018, 1, x FOR PEER REVIEW 6 of 11

3.2.3.2. ImpactImpact ofof AudioAudio SamplingSampling RateRate TheThe results results presented presented in in the the previous previous subsection subsection were were obtained obtained when when the the audio audio signal signal was was sampledsampled atat 44.144.1 kHzkHz rate.rate. ToTo evaluateevaluate howhow thethe audioaudio samplingsampling raterate affectsaffects thethe powerpower consumption,consumption, wewe performedperformed aa seriesseries ofof experimentsexperiments atat otherother samplingsampling rates,rates, namelynamely 88 kHz,kHz, 22.05 kHz,kHz, and 48 kHz, usingusing aa subset subset of of our our test test devices. devices. For For fair fair comparison, comparison, we onlywe only tested tested the audio the audio recording recording mode. mode. Based onBased the results on the of results these experiments, of these experiments, we found nowe statistically found no statisticallysignificant evidence significant that evidence smartphone that powersmartphone consumption power consumption depends on audio depends sampling on audio rate. sampling rate.

3.3.3.3. PowerPower ConsumptionConsumption inin WakelockWakelock ModeMode vs.vs. AudioAudio RecordingRecording ModeMode TheThe Android Android platform platform relies relies on on several several techniques techniques to to reduce reduce overall overall mobile mobile device device power power consumption.consumption. However,However, these these techniques techniques may may cause cause undesirable undesirable side side effects effects such such as slowing as slowing down down data processingdata processing or disabling or disabling certain certain hardware hardware peripherals. peripherals. To avoid To these avoid undesirable these undesirable effects, the effects, Android the OSAndroid has a specialOS has a software special software mechanism mechanism called wakelock called wakelock, which, prevents which prevents the device the fromdevice going from intogoing a power-savinginto a power-saving mode [mode27]. In [27 fact,]. In misuse fact, misuse of the of wakelock the wakelock mechanism mechanism is often is regardedoften regarded as the as most the commonmost common reason reason for the for abnormal the abnormal battery battery drain causeddrain caused by mobile by mobile applications applications [28]. [28]. WeWe usedused thethe samesame methodologymethodology describeddescribed inin SectionSection2 2 to to measure measure the the power power consumption consumption of of ourour testtest devicesdevices inin partialpartial wakelockwakelock modemode (CPU(CPU isis active,active, butbut thethe screen andand thethe keyboardkeyboard areare turnedturned offoff [[2727]),]), andand comparedcompared itit withwith backgroundbackground audioaudio recordingrecording powerpower consumption.consumption. TheThe measurementmeasurement resultsresults for for a a few few selected selected devices devices are are illustrated illustrated in Figure in Figure5. As 5. one As canone see, can the see, audio the recording audio recording mode consumesmode consumes up to 2 up×–6 to× 2times×–6× times more more power power than thethan partial the partial wakelock wakelock mode. mode.

FigureFigure 5.5. AverageAverage powerpower consumptionconsumption withwith confidenceconfidence intervalsintervals forfor aa subsetsubset ofof thethe testedtested AndroidAndroid smartphonessmartphones (wakelock(wakelock modemode vs.vs. audioaudio recordingrecording andand digitaldigital signalsignal processingprocessing modes).modes).

3.4. Power Consumption vs. Release Year and the OS Version Since we discovered that the power consumption for different smartphone models may vary significantly from model to model (see Figure 1), we were interested to find out which hardware or software features may influence power consumption. Somewhat surprisingly, our results did not

Appl. Syst. Innov. 2018, 1, 8 7 of 11

3.4. Power Consumption vs. Release Year and the OS Version Since we discovered that the power consumption for different smartphone models may vary significantly from model to model (see Figure1), we were interested to find out which hardware or Appl.Appl. Syst. Syst. Innov. Innov. 2018 2018, ,1 1, ,x x FOR FOR PEER PEER REVIEW REVIEW 77 of of 11 11 software features may influence power consumption. Somewhat surprisingly, our results did not show any obvious correlation between the power consumption in background audio recording mode and showshow anyany obviousobvious correlationcorrelation betweenbetween thethe powerpower consumptionconsumption inin backgroundbackground audioaudio recordingrecording hardware and software features such as the Android OS version, CPU and chipset model, the size modemode and and hardware hardware and and software software features features such such as as the the Android Android OS OS version, version, CPU CPU and and chipset chipset model, model, of RAM and built-in memory, or the smartphone release date. For example, in Figure6 we plot thethe size size of of RAM RAM and and built built‐‐inin memory, memory, or or the the smartphone smartphone release release date. date. For For example, example, in in Figure Figure 6 6 we we the measured consumption data vs. Android OS version number and the smartphone release date. plotplot thethe measuredmeasured consumptionconsumption datadata vs.vs. AndroidAndroid OSOS versionversion numbernumber andand thethe smartphonesmartphone releaserelease One might expect that the newer smartphones would be more power efficient in audio recording date.date. OneOne mightmight expectexpect thatthat thethe newernewer smartphonessmartphones wouldwould bebe moremore powerpower efficientefficient inin audioaudio mode, yet this is not the case. There is no statistically significant difference (at least, for our sample recordingrecording mode, mode, yet yet this this is is not not the the case. case. There There is is no no statistically statistically significant significant difference difference (at (at least, least, for for our our size) between power consumption of the smartphones released in 2011–2014 and the smartphones samplesample size)size) betweenbetween powerpower consumptionconsumption ofof thethe smartphonessmartphones releasedreleased inin 2011–20142011–2014 andand thethe released in 2015–2017. On the other hand, if we consider the expected battery life in background audio smartphonessmartphones releasedreleased inin 2015–2017.2015–2017. OnOn thethe otherother hand,hand, ifif wewe considerconsider thethe expectedexpected batterybattery lifelife inin recordingbackgroundbackground mode audioaudio vs. the recordingrecording smartphone modemode release vs.vs. thethe date, smartphonesmartphone there is a release clearrelease upward date,date, there trendthere is (seeis aa clear Figureclear upwardupward7). However, trendtrend this(see(see isFigure Figure easily 7). 7). explained However, However, by this this the is factis easily easily that explained explained the newer by by smartphones the the fact fact that that tend the the newer tonewer have smartphones smartphones larger capacity tend tend batteries to to have have thanlargerlarger their capacity capacity older batteries counterparts.batteries than than their their older older counterparts. counterparts.

700 700 700 700 Power consumption measurements (algorithm #2) Power consumption measurements (algorithm #2) Power consumption measurements (algorithm #2) Linear regression fit Power consumption measurements (algorithm #2) Linear regression fit Linear regression fit 600 600 Linear regression fit 600 600

500 500 500 500

400 400 400 400

300 300 300 300

200 Power consumption (mW) consumption Power 200 200 (mW) consumption Power Power consumption (mW) consumption Power 200 Power consumption (mW) consumption Power

100 100 100 100

0 0 0 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 02011 2012 2013 2014 2015 2016 2017 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 2011 2012 2013 2014 2015 2016 2017 Android OS version Release year Android OS version Release year ((aa)) ((bb))

FigureFigureFigure 6. 6.6. (a(a) ) PowerPower consumptionconsumption vs.vs. Android AndroidAndroid OS OSOS version versionversion and andand ( (b(b)) ) the the smartphonesmartphone releaserelease year:year: measuredmeasuredmeasured datadata data andand and thethe the linearlinear linear regressionregression regression fit. fit. fit.

110 110 110 110 Estimates based on measured data (Algorithm #2) Estimates based on measured data (Algorithm #2) 100 Estimates based on measured data (Algorithm #2) 100 Estimates based on measured data (Algorithm #2) Linear regression fit 100 Linear regression fit 100 Linear regression fit Linear regression fit 90 90 90 90 80 80 80 80 70 70 70 70 60 60 60 60 50 50 50 50 40 40 40 40 Expected battery life (hours) Expected battery Expected battery life (hours) Expected battery 30 30 30 30 20 20 20 20 10 10 10 10 22.533.544.555.566.57 2011 2012 2013 2014 2015 2016 2017 22.533.544.555.566.57 2011 2012 2013 2014 2015 2016 2017 Android OS version Release year Android OS version Release year ((aa)) ((bb)) Figure 7. (a) Expected battery life vs. Android OS version and (b) the smartphone release year: FigureFigure 7.7. (a) Expected battery life vs. Android Android OS OS version and ( b) the smartphone release year: measured data and the linear regression fit. measuredmeasured datadata andand thethe linearlinear regressionregression fit. fit.

4.4. Power Power Optimization Optimization Techniques Techniques OurOur experimentalexperimental resultsresults showshow thatthat inin backgroundbackground audioaudio monitoringmonitoring applications,applications, thethe majormajor impactimpact onon smartphonesmartphone powerpower consumptionconsumption isis causedcaused byby thethe corecore audioaudio recordingrecording functionality.functionality. Therefore,Therefore, inin applicationsapplications thatthat performperform continuouscontinuous microphonemicrophone sensing,sensing, optimizationoptimization ofof digitaldigital audioaudio signal signal processing processing algorithms algorithms often often does does not not provide provide any any noticeable noticeable battery battery‐‐lifelife savings. savings. TheThe power power‐‐savingsaving strategies strategies that that can can be be used used in in such such scenarios scenarios are are application application specific. specific. In In most most cases,cases, thethe onlyonly viableviable powerpower‐‐savingsaving approachapproach isis toto performperform thethe soundsound capturecapture atat certaincertain momentsmoments

Appl. Syst. Innov. 2018, 1, 8 8 of 11

4. Power Optimization Techniques Our experimental results show that in background audio monitoring applications, the major impact on smartphone power consumption is caused by the core audio recording functionality. Therefore, in applications that perform continuous microphone sensing, optimization of digital audio signal processing algorithms often does not provide any noticeable battery-life savings. The power-saving strategies that can be used in such scenarios are application specific. In most Appl. Syst. Innov. 2018, 1, x FOR PEER REVIEW 8 of 11 cases, the only viable power-saving approach is to perform the sound capture at certain moments (i.e.,(i.e., relyrely on non-continuousnon‐continuous audio audio recording). recording). For For example, example, such such an an approach approach has has been been explored explored in in[19], [19 where], where the the sound sound capture capture was was triggered triggered by by events events initially initially recognized recognized by by the the accelerometer. accelerometer. OnOn thethe other other hand, hand, in in TV TV audience audience measurement measurement applications applications (see, (see, for example, for example, [9,10]), [9,10]), the audio the recordingaudio recording can be can performed be performed periodically periodically at short at time short intervals time intervals (e.g., 10–20 (e.g., s) 10–20 followed s) followed by longer by intervalslonger intervals of microphone of microphone inactivity inactivity (e.g., 20–90 (e.g., s). 20–90 The interval s). The interval of inactivity of inactivity can be adaptively can be adaptively selected toselected match to the match TV watching the TV profilewatching of the profile individual of the user; individual this concept user; isthis schematically concept is schematically illustrated in Figureillustrated8. Our in experimentsFigure 8. Our indicate experiments that the indicate TV audience that the measurement TV audience applications, measurement which applications, rely on suchwhich an rely adaptive on such mechanism, an adaptive may mechanism, reduce the may average reduce power the average consumption power by consumption a factor of 2–3 by without a factor significantof 2–3 without impact significant on the accuracy impact on of the accuracy measurement of the results. measurement results.

1

0.8

0.6

0.4

0.2

0 05:00 09:00 13:00 17:00 21:00 01:00 04:59

100

80

60

40

20

0 05:00 09:00 13:00 17:00 21:00 01:00 04:59 Time of the day (HH:MM)

FigureFigure 8.8. Adaptation of intervals between audio capturing events to the TV viewing profileprofile ofof aa particularparticular useruser inin thethe TVTV audienceaudience measurementmeasurement application application (real-world (real‐world example). example).

TheThe intervalinterval ofof inactivityinactivity maymay alsoalso bebe variedvaried adaptivelyadaptively basedbased onon thethe audioaudio featuresfeatures extractedextracted duringduring previousprevious microphonemicrophone sensingsensing periods.periods. For For example, in in noise exposureexposure monitoringmonitoring applicationsapplications [1[1,3–5],,3–5], the the interval interval of of microphone microphone inactivity inactivity could could be inversely be inversely proportional proportional to the to mean the andmean variance and variance of sound of pressuresound pressure level estimates level estimates obtained obtained during previous during previous sound capturing sound capturing intervals. Nonetheless,intervals. Nonetheless, it should be it notedshould that be in noted some applications,that in some such applications, as healthcare such applications as healthcare [6–8], itapplications[6–8], is vital to perform it is continuousvital to perform audio continuous recording audio and signal recording processing; and signal in this processing; case, the in only this practicalcase, the solution only practical is to use solution smartphone is to models use smartphone with low or models moderate with power low consumption or moderate in power audio recordingconsumption mode. in audio recording mode.

5. Limitations of the Study The most obvious limitation of the study is its relatively small sample size: we analyzed the power consumption of only 18 Android devices. Although the selected subset of smartphones represents devices from different manufacturers and includes various types of Android OSs, it is nonetheless very small in comparison to the number of Android smartphone models available on the market (as of October 2017, the Play database of supported Android devices contained more than 15,000 models). Thus, some conclusions, especially those reached in Section 3.4, should be used with caution. In addition, we focused mainly on devices in the low‐end and mid‐range

Appl. Syst. Innov. 2018, 1, 8 9 of 11

5. Limitations of the Study The most obvious limitation of the study is its relatively small sample size: we analyzed the power consumption of only 18 Android devices. Although the selected subset of smartphones represents devices from different manufacturers and includes various types of Android OSs, it is nonetheless very small in comparison to the number of Android smartphone models available on the market (as of October 2017, the Google Play database of supported Android devices contained more than 15,000 models). Thus, some conclusions, especially those reached in Section 3.4, should be used with caution. In addition, we focused mainly on devices in the low-end and mid-range categories. Future research on the topic should include a wider selection of test devices, and should evaluate more high-end smartphone models.

6. Conclusions Our analysis provides ample evidence that the major impact on smartphone power consumption of background audio monitoring applications is caused by the core audio recording functionality, whereas moderately complex audio processing algorithms (such as sound pressure level estimation, acoustic feature extraction, audio fingerprinting, etc.) that run simultaneously with background audio recording do not significantly impact overall smartphone power consumption and battery life. Therefore, in the majority of cases, the optimization of real-time digital audio signal processing algorithms may not provide any noticeable battery life savings if the mobile application runs in the background and performs continuous microphone sensing. The power consumption caused by background audio recording varies significantly from model to model, and the difference between the best and worst smartphone may be significant. In most cases, the power consumption with audio recording enabled is much higher than the power consumption in wakelock mode. Power consumption is likely influenced by multiple factors (both hardware-related and software-related), and we found no obvious correlation between power consumption in background audio recording mode and factors such as year of release, the OS version, and the CPU, processor, or system-on-chip model. However, batteries in newer smartphone models tend to last longer than those in older models, mostly because newer smartphones use larger-capacity batteries. We believe that our results may be useful to developers of mobile applications that rely on background audio recording and real-time digital audio signal processing. The results may also be interesting to mobile device manufacturers.

Acknowledgments: This work was funded by Cifrasoft Ltd. Author Contributions: Sergey Zhidkov designed the research, analyzed the data, and wrote the paper; Andrey Sychev co-designed the experiment, developed the test application, and performed the experiments; Alexander Zhidkov co-designed the experiment, developed the signal processing code, and prepared the test equipment; and Alexander Petrov performed the algorithm complexity measurements. Conflicts of Interest: The authors declare no conflict of interest.

References

1. Roberts, B.; Kardous, C.; Neitzel, R. Improving the accuracy of smart devices to measure noise exposure. J. Occup. Environ. Hyg. 2016, 13, 840–846. [CrossRef][PubMed] 2. Kardous, C.A.; Shaw, P.B. Evaluation of smartphone sound measurement applications. J. Acoust. Soc. Am. 2014, 135, EL186. [CrossRef][PubMed] 3. Zamora, W.; Calafate, C.T.; Cano, J.C.; Manzoni, P. Accurate Ambient Noise Assessment Using Smartphones. Sensors 2017, 17, 917. [CrossRef][PubMed] 4. Ibekwe, T.S.; Folorunsho, D.O.; Dahilo, E.A.; Gbujie, I.O.; Nwegbu, M.M.; Nwaorgu, O.G. Evaluation of mobile smartphones app as a screening tool for environmental noise monitoring. J. Occup. Environ. Hyg. 2016, 13, D31–D36. [CrossRef][PubMed] Appl. Syst. Innov. 2018, 1, 8 10 of 11

5. Aumond, P.; Lavandier, C.; Ribeiro, C.; Boix, E.G.; Kambona, K.; D’Hondt, E.; Delaitre, P. A study of the accuracy of mobile technology for measuring urban noise pollution in large scale participatory sensing campaigns. Appl. Acoust. 2017, 117, 219–226. [CrossRef] 6. Ong, A.A.; Gillespie, M.B. Overview of smartphone applications for sleep analysis. World J. Otorhinolaryngol.- Head Neck Surg. 2016, 2, 45–49. [CrossRef][PubMed] 7. Nam, Y.; Reyes, B.A.; Chon, K.H. Estimation of Respiratory Rates Using the Built-in Microphone of a Smartphone or Headset. IEEE J. Biomed. Health Inform. 2016, 20, 1493–1501. [CrossRef][PubMed] 8. Al-Mardini, M.; Aloul, F.; Sagahyroon, A.; Al-Husseini, L. Classifying obstructive sleep apnea using smartphones. J. Biomed. Inform. 2014, 52, 251–259. [CrossRef][PubMed] 9. Bisio, I.; Delfino, A.; Luzzati, G.; Lavagetto, F.; Marchese, M.; Fra, C.; Valla, M. Opportunistic estimation of television audience through smartphones. In Proceedings of the 2012 International Symposium on Performance Evaluation of Computer & Telecommunication Systems (SPECTS), Genoa, Italy, 8–11 July 2012; pp. 1–5. 10. Ibrahim, M.; Gruteser, M.; Harras, K.A.; Youssef, M. Over-The-Air TV Detection Using Mobile Devices. In Proceedings of the 26th International Conference on Computer Communication and Networks (ICCCN), Vancouver, BC, Canada, 31 July–3 August 2017; pp. 1–9. 11. Liu, K.; Liu, X.; Li, X. Guoguo: Enabling Fine-Grained Smartphone Localization via Acoustic Anchors. IEEE Trans. Mobile Comput. 2016, 15, 1144–1156. [CrossRef] 12. Aguilera, T.; Paredes, J.A.; Álvarez, F.J.; Suárez, J.I.; Hernandez, A. Acoustic local positioning system using an iOS device. In Proceedings of the International Conference on Indoor Positioning and Indoor Navigation, Montbeliard-Belfort, France, 28–31 October 2013; pp. 1–8. 13. Greenemeier, L. People Love Their Smartphones but Hate the Batteries [Survey Results]. Scientific American, 28 November 2014. Available online: https://www.scientificamerican.com/article/people-love-their- smartphones-but-hate-the-batteries-survey-results/ (accessed on 7 March 2018). 14. Chen, X.; Nixon, K.W.; Chen, Y. Practical power consumption analysis with current smartphones. In Proceedings of the 29th IEEE International System-on-Chip Conference (SOCC), Seattle, WA, USA, 6–9 September 2016; pp. 333–337. 15. Bai, G.; Mou, H.; Hou, Y.; Lyu, Y.; Yang, W. Android Power Management and Analyses of Power Consumption in an Android Smartphone. In Proceedings of the IEEE 10th International Conference on High Performance Computing and Communications & IEEE International Conference on Embedded and Ubiquitous Computing, Zhangjiajie, China, 13–15 November 2013; pp. 2347–2353. 16. Datta, S.K.; Bonnet, C.; Nikaein, N. Android power management: Current and future trends. In Proceedings of the First IEEE Workshop on Enabling Technologies for Smartphone and Internet of Things (ETSIoT), Seoul, Korea, 18 June 2012; pp. 48–53. 17. Zhang, L.; Tiwana, B.; Qian, Z.; Wang, Z.; Dick, R.P.; Mao, Z.M.; Yang, L. Accurate online power estimation and automatic battery behavior based power model generation for smartphones. In Proceedings of the Eighth IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis, Newport Beach, CA, USA, 1–3 October 2010; ACM: New York, NY, USA, 2010; pp. 105–114. 18. Chen, X.; Chen, Y.; Ma, Z.; Fernandes, F.C. How is energy consumed in smartphone display applications? In Proceedings of the 14th Workshop on Mobile Computing Systems and Applications, Jekyll Island, Georgia, 26–27 February 2013; ACM: New York, NY, USA, 2013; p. 3. 19. Lee, S.; Lee, J.; Lee, K. VehicleSense: A reliable sound-based transportation mode recognition system for smartphones. In Proceedings of the IEEE 18th International Symposium on A World of Wireless, Mobile and Multimedia Networks (WoWMoM), Macao, China, 12–15 June 2017; pp. 1–9. 20. Rigol DP832A Digital Programmable Linear DC Power Supply Datasheet and Specifications. Available online: https://www.rigolna.com/products/dc-power-loads/dp800/ (accessed on 17 December 2017). 21. Android Developers Portal: android.media.AudioRecord Class Documentation. Available online: https: //developer.android.com/reference/android/media/AudioRecord.html (accessed on 17 December 2017). 22. Android Developers Portal: Android Native Development Kit (NDK) Documentation. Available online: https://developer.android.com/ndk/index.html (accessed on 17 December 2017). 23. Lu, L.; Zhang, H.J.; Jiang, H. Content analysis for audio classification and segmentation. IEEE Trans. Speech Audio Process. 2002, 10, 504–516. [CrossRef] Appl. Syst. Innov. 2018, 1, 8 11 of 11

24. Haitsma, J.; Kalker, T. A Highly Robust Audio Fingerprinting System with an Efficient Search Strategy. J. New Music Res. 2003, 32, 211–221. [CrossRef] 25. TMS320C6748 Fixed- and Floating-Point DSP Datasheet. Available online: http://www.ti.com/product/ TMS320C6748 (accessed on 17 January 2018). 26. Xu, B.; Oudalov, A.; Ulbig, A.; Andersson, G.; Kirschen, D. Modeling of Lithium-Ion Battery Degradation for Cell Life Assessment. IEEE Trans. Smart Grid 2018, 9, 1131–1140. [CrossRef] 27. Android Developers Portal: PowerManager Class Documentation. Available online: https://developer. android.com/reference/android/os/PowerManager.html (accessed on 17 December 2017). 28. Pathak, A.; Jindal, A.; Hu, Y.C.; Midkiff, S.P. What is keeping my phone awake? characterizing and detecting no-sleep energy bugs in smartphone apps. In Proceedings of the 10th International Conference on Mobile Systems, Applications, and Services (MobiSys’12), Windermere, UK, 25–29 June 2012; ACM: New York, NY, USA, 2012; pp. 267–280.

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).