new acurain: a rainfall audio spectrum analyzer for android...

9
AcuRain: A Rainfall Audio Spectrum Analyzer for Android Powered Mobile Phones Efrin Gonzalez IT-University of Copenhagen Rued Langgaards Vej 7 2300 Copenhagen S [email protected] Rasmus Kreiner IT-University of Copenhagen Rued Langgaards Vej 7 2300 Copenhagen S [email protected] ABSTRACT Rainfall measuring is a very important task that impacts sev- eral scientific disciplines, e.g. agriculture, horticulture, hy- drological catchments modelling and atmospheric analysis to design structures for run-off control of climate phenomena, including storms and floods. Due the high importance, there is an unmet need to build or improve the rainfall measuring tools. With those tools it is possible to collect relevant rainfall data that subsequently can be analyzed to proactively make decisions. There has been considerable progress in audio recognition via mobile phone apps, as demonstrated by applications like SoundHound, Shazam and Tunatic. At the same time, in the scientific community of climate and environmental research, there is an unmet need for more cost-effective technologies for weather stations, more specifically for rain gauges. In this paper, we present the initial steps in finding a method that based on acoustical input can measure the rainfall audio spectrum analysis with Android-powered phones and Piezo microphones. We evaluate the collected rainfall data persisted on the Google App Engine to determine the amount of rainfall in a defined area at a defined point in time. Author Keywords FFT; Android; Piezo Microphone; Rain gauges; Cloud; Data Persistence System. INTRODUCTION Equipment to measure the rainfall is either expensive or not suitable for outdoor environments. The potential of audio recognition as a cheap and well-suited tool for measuring rainfall is intriguing, especially considering the recent ad- vances within the field. Previous research into rainfall mea- suring has included investigation of under-water microphones used to identify rainfall by excluding other ambient and envi- ronmental sounds as well as studies that aimed to improving the understanding of the African environment by installing of low-cost distrometers in several parts of that continent. Crowdsourced weather data are an important source for mul- tiple stakeholders. This is noticeable when we look at the existing knowledge about the climate in Africa. The state of the art idea comes from The TAHMO project that aims to use a computational network, models and satellites to observe cli- mate conditions in Africa (see Related Work). Currently, the amount of collected data is modest and does not produce a clear image of how the population can best exploit the vast re- sources of land. This is one reason why it is important that all collected non-proprietary data are be stored in the cloud avail- able to the public, because doing so will construct a database of the results that is accessible and usable by other scientists as well as other interested parts. In this paper, we introduce an Android-based method that uses Fast Fourier Transformation (FTT) algorithms to analyze data sourced from a Piezo Sensor plugged to a Android mo- bile phone. Together, these two pieces of hardware produce the input to be processed. A piezo collect vibration from the surface it is attached to. The vibration is caused by an impact; rainfall is an example of an impact that will cause a surface to vibrate. Our objectives were: a) acquire input from the piezo sensor, b) make the FFT calculation, c) elucidate if these FFT calcu- lations can be used to predict rainfall and d) persist the data in the cloud. All these in real time. Finally, we aimed to estimate if meeting these objectives can be extrapolated to determine if our method produces a more cost effective technology than currently available. First, we review the identified related work. Subsequently, we provide a comprehensive explanation of the details of our design and we discuss the challenges associated with analyz- ing the data. Next, we present the final results, which are then discussed and concluded upon. RELATED WORK Today, there are different methods to measure rainfall us- ing a point source; for clarity, these methods can be divided into two groups. In the first group, we find the traditional cylindrical tipping bucket that provided a measurement that is accumulated over a time interval. In the other group, we find approaches to capturing rain that provide instant infor- mation about the current down pour. Such devices include

Upload: others

Post on 09-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

AcuRain: A Rainfall Audio Spectrum Analyzer for AndroidPowered Mobile Phones

Efrin Gonzalez

IT-University of CopenhagenRued Langgaards Vej 7

2300 Copenhagen [email protected]

Rasmus Kreiner

IT-University of CopenhagenRued Langgaards Vej 7

2300 Copenhagen [email protected]

ABSTRACTRainfall measuring is a very important task that impacts sev-eral scientific disciplines, e.g. agriculture, horticulture, hy-drological catchments modelling and atmospheric analysis todesign structures for run-off control of climate phenomena,including storms and floods. Due the high importance, thereis an unmet need to build or improve the rainfall measuringtools. With those tools it is possible to collect relevant rainfalldata that subsequently can be analyzed to proactively makedecisions.

There has been considerable progress in audio recognitionvia mobile phone apps, as demonstrated by applications likeSoundHound, Shazam and Tunatic. At the same time, in thescientific community of climate and environmental research,there is an unmet need for more cost-effective technologiesfor weather stations, more specifically for rain gauges. Inthis paper, we present the initial steps in finding a methodthat based on acoustical input can measure the rainfall audiospectrum analysis with Android-powered phones and Piezomicrophones.

We evaluate the collected rainfall data persisted on the GoogleApp Engine to determine the amount of rainfall in a definedarea at a defined point in time.

Author KeywordsFFT; Android; Piezo Microphone; Rain gauges; Cloud; DataPersistence System.

INTRODUCTIONEquipment to measure the rainfall is either expensive or notsuitable for outdoor environments. The potential of audiorecognition as a cheap and well-suited tool for measuringrainfall is intriguing, especially considering the recent ad-vances within the field. Previous research into rainfall mea-suring has included investigation of under-water microphonesused to identify rainfall by excluding other ambient and envi-ronmental sounds as well as studies that aimed to improving

the understanding of the African environment by installing oflow-cost distrometers in several parts of that continent.

Crowdsourced weather data are an important source for mul-tiple stakeholders. This is noticeable when we look at theexisting knowledge about the climate in Africa. The state ofthe art idea comes from The TAHMO project that aims to usea computational network, models and satellites to observe cli-mate conditions in Africa (see Related Work). Currently, theamount of collected data is modest and does not produce aclear image of how the population can best exploit the vast re-sources of land. This is one reason why it is important that allcollected non-proprietary data are be stored in the cloud avail-able to the public, because doing so will construct a databaseof the results that is accessible and usable by other scientistsas well as other interested parts.

In this paper, we introduce an Android-based method thatuses Fast Fourier Transformation (FTT) algorithms to analyzedata sourced from a Piezo Sensor plugged to a Android mo-bile phone. Together, these two pieces of hardware producethe input to be processed. A piezo collect vibration from thesurface it is attached to. The vibration is caused by an impact;rainfall is an example of an impact that will cause a surfaceto vibrate.

Our objectives were: a) acquire input from the piezo sensor,b) make the FFT calculation, c) elucidate if these FFT calcu-lations can be used to predict rainfall and d) persist the data inthe cloud. All these in real time. Finally, we aimed to estimateif meeting these objectives can be extrapolated to determineif our method produces a more cost effective technology thancurrently available.

First, we review the identified related work. Subsequently,we provide a comprehensive explanation of the details of ourdesign and we discuss the challenges associated with analyz-ing the data. Next, we present the final results, which are thendiscussed and concluded upon.

RELATED WORKToday, there are different methods to measure rainfall us-ing a point source; for clarity, these methods can be dividedinto two groups. In the first group, we find the traditionalcylindrical tipping bucket that provided a measurement thatis accumulated over a time interval. In the other group, wefind approaches to capturing rain that provide instant infor-mation about the current down pour. Such devices include

Page 2: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

rain gauges that are based on optical sensing of the shadowsproduced by a raindrop in rectangular frame, distrometersthat are designed to measure the actual drop size distributionwithin rain by converting the momentum of individual rain-drops striking the sensor head into an electronic signal pro-portional to drop size, and finally devices that use acousticalinputs produced by rain. There have been numerous attemptsto design such an acoustical device; all attempts apply differ-ent approaches and vary in the way they are supposed to dothe measuring, as briefly reviewed in the next three sections.

Low Cost DistrometerA low-cost audio-based distrometer design by Coen Degenwas later refined in a Masters thesis by Stian de Jung [1].Specifically, the authors developed a contact microphone us-ing a PVC case that had a built-in piezo disc. This disc trans-formed rain hitting the case in to voltage, and by the meansof a datalogger they tried to analyze the drop size of eachrain drop, exploiting a near-linear relationship between therain drop size, the signal size and the produced voltage. Thestudy showed great potential but had some shortcomings; es-pecially, the datalogger had troubles determining the amountof rain drops at a high rain rate.

Stian de Jungs thesis is part of THAMO: the goal of TAHMOis to better understand the African environment through par-ticipatory sensing, modeling and education. By using a bigcomputational network, models and satellite observations, itmay be possible to obtain substantial insights into the waterdistribution and energy stucks and fluxes within Africa. Thisis a key point for the study presented in this paper, becausewe can apply some of the criteria presented in the THAMOproject, specifically the parts related to low cost work stationand the materials used.

Rainfall Monitoring Using Acoustic SensorsAnother attempt was done by a research team in the Philip-pines. In this project [10], a standard microphone of an An-droid phone was used to capture the amplitude of the rain.These data were sampled over time periods of 5 seconds; eachof these where stored in a CSV-file, and the data were sent toa server at 10 minutes intervals for crowdsourcing use. Theresults showed correspondence between the amplitude of theaudio signal and a simultaneous measurement done with atipping bucket system.

Acoustic Rain GaugeOne of the most thorough attempts has been the AcousticRain Gauge (ARG) [7], which has been developed to recordrainfall over the sea. This is done by using a hydrophone [13]that was lowered to 50 meters under the sea level and a com-puter that was able to analyze and detect rainfall. The depthof the microphone and the ability of water to transmit soundmade it possible for one microphone to cover a surface areaof 7,069 m2. One main discovery was that when rain hit thewater surface, it had a certain spectral profile that was uniqueto all the other sound sources that are normally present in theocean. By applying the FFT-algorithm [12] to their record-ings, the ARG developers were able to filter out precisely the

dominant frequency produced by rain, and to use these datato calculate the rain fall above water.

DESIGNWe aim at constructing a system that has the advantage thatit can be installed and run a varied range of mobile devices.With the miniaturisation of the devices, more and more use-ful applications can be built to do daily tasks at one end ofthe spectrum and tasks impossible to perform for human be-ings at the other end. An example of such an impossible taskis the collecting of data on certain natural phenomena in ex-treme weather conditions. Even though the mobile systemsprovide the opportunity to create robust applications to solvesuch problems, there are several factors to take into account:Mobile devices are portable and can be placed and movedeasily from one place to another; however, they might facelow performance, lack of connectivity, low battery life or canbe in a volatile environment.

One of the main trade-offs we are facing here, is how touse the Android mobile phone and a Piezo microphone torecord rainfall data, without damaging or disturbing the mo-bile phone by the climate conditions and, simultaneously pro-ducing recording data of adequate quality.

In a simplified cost-benefit analysis, we aim at the best andcheapest solution, while also taking the above-mentionedoverall performance elements into consideration. The An-droid operating system was selected, because it is OpenSource and because the price of the devices are cheaper thanthe ones using e.g. iOS [8]. Moreover, a recent study haveshown that smartphones in general are suitable for doingsound measurements [6].

Compared to previous approaches, our system design is dif-ferent. In itself, it is not a ground-breaking discovery, but weare trying to develop a new overground method to record andevaluate rainfall by introducing a combination of the best as-pects of the three above-mentioned cases and hopefully pro-duce accurate results.

Design of the acoustical sensorOne of the main goals of this project was to produce an acous-tical sensor at as low a cost as possible. This is one of thereasons why we chose to go with PVC casing, which showedgreat results in the low-cost distrometer [1].

To design our prototype we used a standard kitchen PVCcase. Although, this has proven successful earlier and provedto have many of the desired properties, there were some is-sues that needs to be taken into consideration. First, raindrops falling from the sky are not distributed evenly; there-fore, it is hard to determine the actual rainfall by just look-ing at a very small area. But by making the case bigger tobroaden the actual recording surface, the placement of themicrophone needs to be taken into consideration as well. Inour design, the piezo has been placed in the middle of the topsurface. We will discuss there considerations in the Resultand the Discussion sections.

There are different ways of capturing sound. The ones wenormally see in our everyday life are microphones that sense

Page 3: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

pressure variations over the atmospheric pressure and convertthis movement into an electrical signal. This is the type of mi-crophone that was used in the Philippines study [10]. Anothertype of microphone is of a type called piezoelectric. Piezo-electricity is electricity that is produced when some materialsare subjected to pressure. This means that a piezo microphonecan produce an audio signal from the vibrations of whateversurface it is attached to and not so much of the aerial sounds.

In order to try and bring down the background noise (soundsnot produced by rain), we decide to use a piezo disc as oursensor.

FFT AnalysisAn audio signal is voltage variation over time. Representedgraphically, a sound wave consists of multiple voltage vari-ations at different frequencies mixed with each other. TheFFT algorithm converts a voltage signal over time into dataon the voltages present at a defined time frame (and at whatfrequency). An electrical audio signal can be seen as voltagevariation over time. Normally, a sound consists of many dif-ferent frequencies at different levels. Our aim is, by using theFFT Algorithm, to see if we can find a dominant frequencyfor rain drops and use the amplitude of this to determine thecurrent amount of downpour. The rest of the frequency spec-trum is considered noise from various sources, e.g. wind andleaves. [7]

The test setupWe have established various test setups that have been usedto get a clear view on what spectral range we should operatewith. An early test setup using a mobile audio recorder - aZoom H4n - was done. This had a high impedance input thatis somewhat similar to the characteristics of the impedancematch, we ended up using.

After this initial analysis we went on by testing the acousticalproperties of our sensor. We have done experiments usingthe audio recorder and a contact speaker. We have measuredthree points on the case: One directly on top of the piezo disc,one at the edge of the PVC case and a point in the middle ofthese two. Playing pink noise (a test sound source that has thesame energy per spectral octave [15]), was transduced ontothe surface using the contact speaker. Using this test, we wereable to determine both spectral differences and level changesfrom sound played onto different parts on the case. To seeif temperature changes affects the acoustical properties, thetest was completed twice at both room temperature and byleaving the box in a standard kitchen freezer for one hour.

We have tried to create test methods for us to be able torecreate rainfall in a controlled environment, and get usefulmeasurements recorded. However, finding the right methodfor reproducing rain in a consistent way has led to variousdead ends; therefore, the calibration of the prototype provedmore difficult than expected. Ultimately, we ended up usinga shower to produce the water impact. We used three differ-ent intensities of the water amount. Little, medium and highoutput. The amount was based on estimations because of thenature of the faucet.

ACURAINIn this next section we will speak about the different elementswe have used in our design. We will also elaborate a bit onewhy we chose such elements. In the results section we willpresent some of the data we have gotten from our differentmeasurements. And finally we will try to evaluate the suc-cess of our work, and also try to give the reader a good un-derstanding of what we have found and how we can moveforward using some of the data collected.

The Hardware PrototypeIn attempt to produce a cheap and waterproof casing, a stan-dard PVC case for storing food was used for the prototype.

The piezo disc was attached to the lid of the PVC case usingPVC tape, and this then connected to the microphone jack ofour mobile phone.

The connection between the phone and the piezo disc couldnot be done by simply soldering the disc onto a suitable con-nector, because the impedance of the piezo microphone isnormally around 5-10 Mohm (ours messured to 4,9 Mohm)and a microphone input is typically less than 2 kohm. There-fore, an impedance match circuit was used to be able to pro-duce a valid audio signal. Initially we used a preamp run-ning of 9v battery, but because of some troubles in gettingthe preamp to function well and also for the sake of powerconsumption, it was decided to buy an off the shelve pas-sive impedance matching circuits that already exist. The oneswe bought is normally used to plug in guitars or other highimpedance musical instruments to the microphone jack of amobile phone and did cost aprox. 9 Euros.

SoftwareFor the sake of keeping down the cost of our measuring de-vice, we choose to not use the newest available phones onthe market, but rather go with an older device that wouldbe cheaper to acquire and, still have enough computationalpower to perform the requiered tasks. The test phone for thisproject is a HTC Evo 4G phone, which is top of line smartphone from 2010. A small software was developed on it, withthe ability to do computational sound analysis in order to pre-dict the rain amount. This evaluation is then sent to a webserver which is currently running on a Google App Engine.

Android app

The program interface itself is quite basic, as we consideredthe phone not to be visible, and contained within a box. Asyou can see on figure 1, it only holds on a button which acti-vates the sound analysis task: An easy and desired action tostart recording of the rainfall.

The last iteration of Android app contains five differentclasses:

• An interface that its only function is to instantiate and,when activated by a button push, start the audio analysisclass.

• An audio analysis class which is responsible for reading theaudio input and then computing an RMS averaged value

Page 4: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

Figure 1. The simple main screen of the android application

[16] of 8 sequential recordings on all frequencies derivedfrom an FFT computation.

• A class for the prediction of rain. This is done by using alinear regression, implemented using Weka[5]. The Wekamodel is trained with a data set containing 10 differentrecordings for every three shower intensities. This classwas introduced in our second prototype.

• A communication class that time stamps and sends the val-ues from the prediction class to a server.

• Although not implemented to a working condition, a classresponsible for getting the geo location of the recording.

Google app engine

In order the keep the collection of data, a server running onGoogle’s App Engine was chosen.[3] The main responsibilityof the server is for persisting the data collected from the an-droid app and, provide methods for getting the information invarious ways. The data was made available displaying graphsof the recorded rainfall using the Google Chart implementa-tion, and also for retrieval of raw data using csv data files[11].The app engine was chosen because it has a good scalabilityand ease of use.

RESULTSIn this next section we will show some of our findings andsimultaneously evaluate on these. Due to the fact that grab-bing trustworthy data is non trivial, this section will containsome assumptions based on observations. This section willalso produce a time line of the different approaches that wehave had and also give an explanation as to why we soughtalternatives to our initial prototypes.

Background NoiseOne of the assumptions to use a piezo disc was to eliminate asmuch background noise as possible, because this disc is notinfluenced by airborne sounds apart from those sounds thatwould couple to the case itself. A quick test done outdoors

Figure 2. FFT-Analysis of actual light rain with a fair amount of back-

ground noise from a construction site

Figure 3. FFT-Analysis of same background noise, but without Rain

near a construction site showed that: there are 32dB differ-ence between the sounds produced by the rain falling ontothe case and the sounds produced by the construction not faraway.

Frequency responseTesting various acoustical differences gave us some indica-tions, that there is a significant difference in both frequencyresponse and overall sound level, as a consequence of wherethe audio is generated on the case. As seen in the figure 4-6there are both variation in the frequency response as well inthe sound pressure level(SPL).

The overall sound level does not change from the medium po-sition (figure 5) to the edge of the case (figure 4), in both thereare a noticeable difference in the frequency response. Look-ing at figure 6 we see that the difference in the SPL is 5 dBlouder than the other two recordings as well as the frequencyresponse seems to have a much broader spectrum activity.

A second test has been done, to see if the acoustical proper-ties of our PVC case would change due to variations in thetemperature. These measurements can be seen in figure 7-9.

Page 5: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

Figure 4. Frequency response of Pink Noise transduced at the egde of

the box

Figure 5. Frequency response of Pink Noise transduced at medium dis-

tance to the piezo disc

Figure 6. Frequency response of Pink Noise transduced directly on top

of piezo disc

Figure 7. Frequency response of Pink Noise transduced at the egde of the

box. Box has been in the freezer for an hour at the time of the recording.

These reading gave us various indication that the frequencyresponse does change with temperature of the box. Although,there are some variations, there are still similarities in bothlooking at which frequencies are produced and also the soundlevel. We were able to conclude from these testings that: in allreadings, apart from figure 9 and 6, the box decline in its abil-ity to produce frequencies above 4000 hz, unless the soundswhere played directly on top the piezo disc. This would in-dicate that the box absorbs material within that range betterthan the frequencies below this threshold. This was a usablefinding because it helped us to determine a good samplingrate for our Android app. Using the Nyquist frequency [14]we ended up using 8000hz as the sampling rate for our Au-dioRecorder class, because this produces audio signals up to4000 hz, and also fits well with known sample rate standards.[17].

At this time, it has been hard for us to evaluate about the find-ings of different frequency responses as well as temperaturechanges. It may well be an issue that needs to be handledin outdoor deployment, but as you will read in the next sec-tion we ended up doing all our testing indoors due to variousfactors.

First prototypeThe attempt to build the first prototype of our system wasdone with inspiration to the ARG[7]. In this we tried to de-termine if there was only one frequency in our spectrum thatwas produced by only rain. The main reason to look at a sin-gle frequency was to be able to filter all the other frequenciesaway, and consider these as noise.

The testing of this prototype was initially meant to be con-ducted outdoor in November 2014. This month is normally- at least in Denmark - a month with a lot of rain, but thisNovember it did not rain as much as normal[2]. Therefore, wespent efforts on trying to produce methods that would allowus to make indoor measurements, that would have a similarityto real rainfall.

As we spoke about earlier in the design section, it was hard to

Page 6: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

Figure 8. Frequency response of Pink Noise transduced at medium dis-

tance to the piezo disc. Box has been in the freezer for an hour at the

time of the recording.

Figure 9. Frequency response of Pink Noise transduced directly on top

of piezo disc. Box has been in the freezer for an hour at the time of the

recording.

reproduce the same output from our different test setups and,in all measurements, we found that the dominant frequencyproduced by our artificial rain did not give a clear indicationof a single frequency that could be seen as sound from rainimpact. Furthermore, if we had luck in determining the rightfrequency, we did not have access to calibration equipmentnecessary to do reference measurement along with this test.

One aspect in common in the three test setups was that, no fre-quencies under 250hz were produced. The dominant frequen-cies we found were mainly in the range of 250hz-3937hz.Figure 10 shows the spectral distribution of dominant fre-quency recorded at every measurement.

This is the most useful finding from this prototype. Apartfrom that, it was really hard to interpret anything else from thedata and, we were not able to determine a single frequencythat would be rain. Due to that, we tried a new approachwhich became our second prototype.

Moreover, because of the difficulty in creating a test sce-nario that was somewhat repeatable, we shifted directions andstarted to use rainfall produced by a shower.

Second prototypeThe dead end in the last attempt made us shift course, fromnot only the way we reproduced rain, but also how we weregoing to estimate the rainfall using our sensor. We took anew approach to see if we were able to create a relative scaleindicating rain intensity, which could then be predicted usinglinear regression.

Keeping in mind that our shower does not have steps to con-trol the water flow, this is also a measurement that is relativein its accuracy. That said, we found some quite encouragingresults using this approach. Figure 11 show the results of 10readings from the three different intensity of shower outputtested.

The prediction seems to be quite accurate in determining thecorrect outfall in the intensity step 1 and 5, but has troublesin determining the highest output.

Looking at the training data for our regression model gave usthe reason as to why the model got confused in determiningthe highest intensity. In figure 12 we examined the trainingset and looked at the difference of the audio intensity in dBspread across the spectrum. One surprise in this representa-tion of the data is that there are negative values. This is thesame as saying that there was produced less sound when out-putting more water.

Obviously, this was not a discovery to be expected, an surelythe reason why the linear regression model gets confusedfrom intensity 5-10. If we were to find a spectrum that wouldbe suitable for measuring shower intensity we would be bestof finding one where all difference values are positive. Thatspectrum is from this graph found in the region 3000hz-3500hz. This would have been great starting point a new pro-totype, but due to time constraints we were not able to createa new version.

Page 7: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

Figure 10. Dominant frequency of 3 different test setups. The dominant

frequency is derived from the FFT analysis.

Figure 11. This displays the results of our prediction of rainfall using

linear regression. The graphs shows the average of all ten measurements

and also the difference between the actual and the expected output.

Page 8: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

Figure 12. These graphs displays audio intensity and the difference be-

tween them in the audio spectrum derived from the FFT-analysis. The

numbers used are an average of the 10 different recordings used in the

training data set.

Other observationsOne aspect that is worth mentioning is that, many mobilephones tend to introduce a feature that is called AutomaticGain Control (AGC) [4]. This basically adjusts the amplitudeof the microphone up and down to compensate for a giveninput. Essentially, this is good for improving speech intelligi-bility during a phone call, but for measuring rain, where thedynamic range of a frequency is of the highest importance, itis not a desired quality. At this moment there is no way toeither know for sure or a way remove this function [9].

DISCUSSIONThe prototypes built in this paper can be seen as a feasibilitystudy, which shows that there are many observations that can

Figure 13. This graph displays 10 minutes of recording instances of

375hz from artificially created rain. The red line is drawn to illustrate

pattern that we speculate as a automatic gain correction of the micro-

phone output

be done by using audio in combination with FFT analysis todetermine patterns in impacts on a piezo sensor. However,there has been many issues in trying to create trustworthydata, and before the prototype is ready for actual deploymentoutdoors, multiple test has to be conducted.

We believe that the gathering of a trustworthy training set willmake a linear regression approach a reliable method. Usingthis in combination with FFT-analysis we would most likelyalso be able to detect different types of rain. In the ARG [7]paper, they show that there are connection between the sizeof the rain drop and the frequency range and audio level. Thetraining data we have from the shower recordings also showsvariations in frequency spectrum.

We are not certain that the training set for the highest showerintensity is correct. There are multiple ways as to why thiscould have gone wrong. The most obvious that comes to ourmind is, when gathering the measurements, the output fromthe shower head where spread more evenly on itself and there-fore hit a larger surface on our case. As we showed in the fig-ure 4-6 there are quite some difference in both the frequencyand amplitude response as to where the sound is transducedonto the case. This could be one of the reasons why the train-ing set has an outcome far from what we expected.

Although there have been bumps on the road, in terms of get-ting to a right estimate in predicting the rainfall using ourtechnique, we are confident that it is possible to iron out ofthese. We believe that the key to success is in the productionof a correct training data set and, also produce a sensor thathas a more even response will lead to the ability to produce avalid and operational rain measuring device, costing far lessthan what we see on the market today.

CONCLUSIONIn this paper we have tried to build a rain measuring device,that was able to detected the rainfall using audio as the mea-suring device. Although we did not succeeded in producing aprototype that actually does that with precision, we have beenable to document some useful findings that, which might holdvalue to other persons that would want to proceed within thisarea in the future. In our different test scenarios we foundthat:

• Temperature does change the frequency response of thecase it self.

• There is an amplitude and spectral difference as to wherethe sound is transduced on the case.

• By using linear regression we were able to detect showerrates ranging from low to medium.

In order to build and test the different prototypes, we have puta lot effort into creating a test scenario and evaluating the testdata we acquired.

REFERENCES1. de Jong, S. Master thesis report: Low cost disdrometer:

Improved design and testing in an urban environment.Delft University of Technology (December 2010).

Page 9: New AcuRain: A Rainfall Audio Spectrum Analyzer for Android …tped/teaching/pervasive/SPCL-E2014/final/07... · 2014. 12. 18. · AcuRain: A Rainfall Audio Spectrum Analyzer for

2. DMI. Vejret i danmark - november 2014, 2014.

3. Google App Engine.https://cloud.google.com/appengine/.

4. Griffith, B., and Tom, J. Audio automatic volumecontrol circuit. In Solid-State Circuits Conference.Digest of Technical Papers. 1956 IEEE International(Feb 1956), 3–3.

5. Hall, M., Frank, E., Holmes, G., Pfahringer, B.,Reutemann, P., and Witten, I. H. The weka data miningsoftware: An update. SIGKDD Explor. Newsl. 11, 1(Nov. 2009), 10–18.

6. Kardous, C. A., and Shaw, P. B. Evaluation ofsmartphone sound measurement applicationsa). TheJournal of the Acoustical Society of America 135, 4(2014).

7. MA, B. B., and NYSTUEN, J. A. Passive AcousticDetection and Measurement of Rainfall at Sea.University of Washington, Seattle, Washington(AUGUST 2005).

8. The Price Gap Between iOS and Android Is Widening.http://www.statista.com/chart/1903/

average-selling-price-of-android-and-ios-smartphones/.

9. Stackoverflow. How avoid automatic gain control withaudiorecord?, 2014.

10. Trono, E., Guico, M., Libatique, N., Tangonan, G.,Baluyot, D., Cordero, T., Geronimo, F., and Parrenas, A.Rainfall monitoring using acoustic sensors. In TENCON2012 - 2012 IEEE Region 10 Conference (Nov 2012),1–6.

11. Wikipedia. Comma-separated values — wikipedia, thefree encyclopedia, 2014. [Online; accessed12-December-2014].

12. Wikipedia. Fast fourier transform — wikipedia, the freeencyclopedia, 2014. [Online; accessed12-December-2014].

13. Wikipedia. Hydrophone — wikipedia, the freeencyclopedia, 2014. [Online; accessed12-December-2014].

14. Wikipedia. Nyquist frequency — wikipedia, the freeencyclopedia, 2014. [Online; accessed14-December-2014].

15. Wikipedia. Pink noise — wikipedia, the freeencyclopedia, 2014. [Online; accessed12-December-2014].

16. Wikipedia. Root mean square — wikipedia, the freeencyclopedia, 2014. [Online; accessed12-December-2014].

17. Wikipedia. Sampling (signal processing) — wikipedia,the free encyclopedia, 2014. [Online; accessed14-December-2014].