<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>EarSaver: A device to detect dangerous audio noises</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Lorenzo De Lauretis</string-name>
          <email>lorenzo.delauretis@graduate.univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tiziano Lombardi</string-name>
          <email>tiziano.lombardi@graduate.univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Information Engineering</institution>
          ,
          <addr-line>Computer Science and Mathematics</addr-line>
          ,
          <institution>University of L'Aquila</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>The issue of noise pollution is becoming more and more relevant in our today's way of life. Studies have shown that some noise waves are especially damaging, triggering continuous harm to the nervous scheme with the resulting failure of listening capacity in some instances. Thanks to the latest technological findings, noises can be sampled and analyzed even on very tiny appliances that can possibly be carried anywhere. By testing the noise via a condenser microphone and evaluating the outcome of applying the Fast Fourier Transform to the sampled samples, we can identify the existence of frequencies that are considered detrimental to the auditory system, warning a person in real-time about the prospective risk to which (s)he is facing.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>
        Living in our culture today implies being continually surrounded by
the voices and vibrations generated by the most disparate causes like
smartphones, vehicles, automobiles, aerial transport, etc. Due to
population growth and urbanization, this “noise pollution” will increase
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Noises should not be hazardous to the human ear in small doses
and low volume, but they can be hazardous if they increase in
volume and density. According to recent research, with long-lasting
exposition to certain sound thresholds, there are specific sounds that
can trigger serious hearing loss in rats for several days; these sounds
have a frequency of 16kHz and stress of 115dB. There are also worst
noises, with a frequency of 4kHz with a pressure of 125 dB, that
cause permanent damage to the hearing of rats in both the low- and
high-frequency range [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Sounds at so high pressure can be
dangerous for the human ear too [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        To advice the user of the occurrence of these dangerous noises, we
built a very small device, called EarSaver. It samples sounds through
a condenser microphone and analyzes the result of the application
of the Fast Fourier Transform (FFT) to the sampled signals, thus
detecting dangerous noises. When dangerous noises are detected, a led
installed on EarSaver starts blinking, so as to warn the user of the
potentially harmful noise. We tested the device with different noises
at different frequencies/pressures, obtaining satisfactory results. This
work is part of the eHealth project [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>The paper is structured as follows. In Section 2 there is an
excursus about similar works related to this topic. Section 3 presents
background knowledge needed to better understand the work we have
done. Section 4 describes our prototype, explaining the architecture,</p>
    </sec>
    <sec id="sec-2">
      <title>RELATED WORK</title>
      <p>
        In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], Rajagukguk et al. sampled the sound using a condenser
microphone, analyzing the data using an Arduino Uno. They used an LCD
display, a buzzer and LEDs to display the information about the
danger level of the analyzed sound. Their device warns the user when
the sound reaches the pressure of 75dB, considered by them harmful
for the human ear. Our device is more precise, because it does not
keep track only of the sound level, but also of the sound frequencies.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], Bianchi et. al. explored the use of the Arduino platform,
that can be a versatile audio processor. They treated the real-time
signal processing, with particular emphasis on the FFT, realizing a
sort of benchmark to discover the maximum length of an FFT that
can be computed in real-time inside an Arduino. Their work is more
about the operations that Arduino can make on audio, with the related
benchmarks, while we focus more on the practical application of the
results of FFT computation to prevent hearing loss.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], Silva et. al. made a study on digital sound processing using
Arduino and Matlab2, using two different approaches: in the first one,
all the computation is done on the Arduino, in the second one the
sound samples are instead sent to a laptop where Matlab software
performs the computations, before sending back to playback on the
Arduino. Their work, differently from ours, is partly implemented
on the Arduino and partly on a PC with complex sound analysis.
Instead, we focus only on the Arduino without the need of the PC,
thus devising a fully portable device.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>BACKGROUND</title>
      <p>This section discusses some heritage notions about Arduino and Fast
Fourier Transform approach.
3.1</p>
    </sec>
    <sec id="sec-4">
      <title>INTERNET OF MEDICAL THINGS</title>
      <p>The Internet of Medical Things (also called the internet of health
things) is an extension of the Internet of things (IoT)3. It is the
specific field of application for medical and health purposes, such as
data collection and analysis for research and monitoring. This ‘Smart
Healthcare’ infrastructure facilitates the creation of digitized
healthcare systems, connecting available medical resources and healthcare
services. IoT healthcare systems manage chronic diseases and their
prevention and control. The connectivity for remote monitoring
enables health practitioners to capture data of the patients and applying
complex algorithms in health data analysis.</p>
      <sec id="sec-4-1">
        <title>2 https://it.mathworks.com/products/matlab.html 3 https://en.wikipedia.org/wiki/Internet of things</title>
        <p>3.2
Arduino4 is an open-source hardware and software company that
designs and manufactures single-board microcontrollers and
microcontroller kits. They are used for building or prototyping digital devices
and interactive objects, which make use of various sensors and
actuators. Boards are equipped with sets of digital and analog input/output
(I/O) pins that may be interfaced to various hardware components.</p>
        <p>Arduino boards can be easily programmed using an Integrated
Development Environment (IDE)5 and a USB cable. A typical Arduino
program is composed of two main functions:
setup: it is the initialization phase of the board
loop: it is a portion of code executed repeatedly.
3.3</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>FAST FOURIER TRANSFORM</title>
      <p>The Fast Fourier transform (FFT6) algorithm is a method for
computing the Finite Fourier transform of a series of N (complex) data
points in approximately N log 2N operations.</p>
      <p>
        The Fast Fourier Transform can be useful in many fields, among
which the one of our interest: sound analysis. In fact, it can be used
to detect Speech Spectrogram [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] from the original waveform signal.
Another use case is the Automatic Indexing of Musical Sounds [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
through their timbre recognition.
4
4.1
      </p>
    </sec>
    <sec id="sec-6">
      <title>ARCHITECTURE AND FIRMWARE</title>
    </sec>
    <sec id="sec-7">
      <title>SYSTEM STRUCTURE</title>
      <p>This section discusses the architecture of the system using an
UML Diagram Component in order to show relations among
different stages composing our system. As shown in Figure 1, EarSaver is
composed of five macro-components:</p>
      <p>Controller: the “brain” of EarSaver, it has the Firmware core
inside. It receives input data from the Microphone Sensor and, when
dangerous noises are revealed, it triggers the Alert LED.
Health rule checker: it contains all the mathematical rules applied
to collected microphone data in order to reveal dangerous
situations.</p>
      <sec id="sec-7-1">
        <title>4 https://en.wikipedia.org/wiki/Arduino 5 https://www.arduino.cc/en/Main/Software 6 https://en.wikipedia.org/wiki/Fast Fourier transform</title>
        <p>LED actuator: it is the component designed to drive an alert LED;
when triggered it changes its state, from on to off and vice-versa.
Mic sensor: is a sound sensor, which detects audio from the
ambient and transmits data samples to the Controller component.
The presented Component architecture is designed to be Hardware
independent, in the sense that the same designed system can be
implemented also in different platform apart from the chosen Arduino
framework; which means, it could be used also in other critical
applications, such as the detection of ultrasonic-frequencies in a medical
environment or very low frequencies in sonar applications (i.e.
resonant testing of buildings).</p>
        <p>When entering a state, the system properly sets its actuators to
inform the user about environmental changes. Specific conditions
allow the system to change state in a scale of danger; moreover, the
system can return in a normal state if a critical situations end.</p>
        <p>In this first prototype, the state machine in Figure 3 realizes the
Arduino Firmware, which allows EarSaver to be reliable and
functional. It relies on the usage of the FFT algorithm, which is a
polynomial approximation of the Fourier Transformation method. This
method is parametrized on two parameters: the sampling maximum
frequency, which determines the maximum detectable frequency; the
number of samples to be stored and then analyzed, which describes
our implementation is shown in Algorithm 1.</p>
        <p>At the beginning of the code, it is possible to see the declaration
of the two parameters cited above.</p>
        <p>Sampling maximum frequency: it is chosen high enough to catch
all wanted frequencies with respect to hardware capabilities.
The number of samples: it is chosen large enough to have a certain
number of samples which can emphasize the characteristic of the
audio signal, accordingly with hardware capabilities.</p>
        <p>After the declaration of the two parameters described above, there is
the declaration of global variables to describe the samples’ list of data
and the initialization of our algorithm variables. In the Loop method,
there is the cyclic core of the algorithm. First of all, it collects the
chosen number of samples, storing them in dedicated memory
locations. Then Fast Fourier Transform is applied on the set of data,
identifying the spectrum characteristic of the detected audio signal,
which can be compared with the target to possibly trigger an alert,
which turns on/off the output LED of the circuit. This algorithm is
iterated every second in order to have real-time continuous monitoring
of the environment.
5</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>DETECTING MALICIOUS FREQUENCIES</title>
      <p>The main objective of our device is to warn the user of potentially
harmful noises that are in her/his surrounding, helping them to
prevent hearing loss. To do that, we first have to understand which are
the harmful noises, and what they can cause to the auditory system
during short and long period expositions.</p>
      <p>
        As discussed in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], there are two main kinds of sound that are
very dangerous for the auditory system of the rat: one is 16kHz at
115dB and one is 4kHz at 125dB. The exposition to the noise with
16kHz and 115dB can cause severe hearing loss for several days,
while the exposition to the noise with 4kHz at 125dB can cause
permanent damage to the auditory system of the rat. Also, as argued in
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], sounds at so high pressure are dangerous for the human auditory
system too, and they should be avoided.
      </p>
      <p>The noises at 115dB and 125dB are at very high pressure, so they
can be identified by the human ear; the frequency recognition,
instead, can be more difficult for the human ear, so we need a device
that helps the user in recognizing also these potentially harmful
frequencies. As the first step, we built our prototype with with Arduino
as the microcontroller, as shown in the previous section. The
resulting device can be used for audio sampling and analysis. The device is
very small and is battery powered, so it is perfect to be carried around
potentially everywhere.</p>
      <p>As next step, we wrote the code that permits to the Arduino to
work, written entirely in C++7: through this code, we were able to
sample and analyze the audio surrounding our device and to make a
led blink.</p>
      <p>Our device helps the user in the recognition of frequency and
pressure, blinking a led to alert the user when one of the following
conditions are met:</p>
      <p>Analyzed sound is at a frequency of 4kHz or 16kHz and the
pressure is greater equal 75dB.</p>
      <p>Analyzed sound has a pressure greater equal 100dB.</p>
      <p>The led blinking frequency is proportional to the pressure of the
analyzed noises. When the sound pressure is lower than 75dB, the led
is switched off, when the sound pressure is greater equal 75dB it
blinks at a 2Hz frequency, when the sound pressure increases even
more, the led blinks with an increasing frequency, until it reaches the
100Hz blinking frequency, at the 125dB.</p>
      <p>The device was tested using a wave generator, an object that is able
to produce sounds at particular frequencies and pressures. We
performed forty noises tests, with four different pressure levels: 60dB,
80dB, 90dB and 105dB, varying the frequency from 2kHz to 20kHz.
The results of our tests are shown in Table 1: if the led blinks at the
corresponding frequency and pressure, in the table is reported “Yes”,
“No” otherwise. We tested our device in a silent room, without
external sounds, to prevent interferences given from them.
2KHz
3KHz
4KHz
5KHz
6KHz
10KHz
14KHz
16KHz
18KHz
20KHz
6</p>
    </sec>
    <sec id="sec-9">
      <title>DISCUSSION</title>
      <p>This paper started with an introduction to Arduino and why it is so
useful to cope with problems that are always more relevant
nowadays. We choose Arduino for our project for a number of reasons: it
is open-source, it is cheap, it is all-in-one and can be programmed
using C++. Via the combination of all these features, we got a
dedicated microcontroller that is easily expandable. The sensors and
actuators are relatively cheap, permitting, with a very low budget, to
build one’s own devices. There are a lot of Arduino libraries available
online, that permit rapid development of code for any device.
Without Arduino and all its features, a work such as the one described in
this paper would have been more complicated and, in some cases, it
would have not been possible.</p>
      <p>Within the data obtained from the testing, it is possible to verify
that the devices works well, correctly identifying the potentially
dangerous frequencies/pressures. When the noises produced from our
wave generator had a pressure of 60dB, the led on our device had
not blinked, because the analyzed sound was not potentially harmful.
When we tested the device with noises with the pressure set at 80dB,
the led blinked when the noises reached 4kHz and 16kHz
frequencies, correctly advising the user of the analyzed harmful frequencies.
When the noises produced from our wave generator had a pressure
of 90dB, the led blinked when the noises reached 4kHz and 16kHz
frequencies, correctly warning the user of the potential danger for
his ears. When the noises had a pressure of 105dB, the led blinked
within all the frequencies reached from our wave generator, because
we consider dangerous noises at so high pressure. The led blinking
frequency is proportional to the pressure of the analyzed noises.</p>
      <p>A problem that is possible to identify in our system is the
microphone sensibility, that, in some cases, cannot be enough to sample
very high sound pressures: the microphone we used for testing is a
consumer one, that can be bought from everybody to build own
devices, and not a professional one; so, the precision is not so high for
professional use; it may lead to a loss of precision during
measurements. From the testing results, we can ensure that our device works
correctly with respect to the workflow, properly identifying the
potentially dangerous frequencies/pressures.
7</p>
    </sec>
    <sec id="sec-10">
      <title>CONCLUSIONS AND FUTURE WORK</title>
      <p>In this work, we created a tool that warns the user when potentially
harmful noises are detected in its near surroundings. It is very small,
meaning that it can be carried potentially everywhere. It is cheap and
is easy to build, meaning that it can be constructed potentially by
everybody. It is functional because it is able to sample and analyze
the noises coming from the near surroundings, warning the user with
the blink of a led if the analyzed noises are potentially harmful to
them. In the near future, we will build another version of our system,
with a better professional microphone, that will be able to sample the
sounds with better precision, even at higher sound pressures. Using
the design guidelines illustrated here, everybody can build its own
system with a very low budget, safeguarding their own auditory
system and protecting their ears from auditory diseases.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Andre´ J. Bianchi</surname>
          </string-name>
          , '
          <article-title>Real time digital audio processing using arduino', (</article-title>
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Lorenzo</given-names>
            <surname>De Lauretis</surname>
          </string-name>
          , Stefania Costantini, and Ivan Letteri, '
          <article-title>An ontology to improve the first aid service quality'</article-title>
          ,
          <source>in 2019 IEEE International Conference on Systems, Man and Cybernetics</source>
          (SMC), pp.
          <fpage>1479</fpage>
          -
          <lpage>1483</lpage>
          . IEEE, (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Lisa</given-names>
            <surname>Goines</surname>
          </string-name>
          and Louis Hagler, '
          <article-title>Noise pollution: A modern plague'</article-title>
          ,
          <source>Southern Medical Journal</source>
          ,
          <volume>100</volume>
          (
          <issue>3</issue>
          ), (
          <year>2007</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Maassen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Babisch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Bachmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Ising</surname>
          </string-name>
          , G. Lehnert,
          <string-name>
            <given-names>P.</given-names>
            <surname>Plath</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Plinkert</surname>
          </string-name>
          , E. Rebentisch, G. Schuschke,
          <string-name>
            <given-names>M.</given-names>
            <surname>Spreng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Stange</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Struwe</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Zenner</surname>
          </string-name>
          , '
          <article-title>Ear damage caused by leisure noise'</article-title>
          ,
          <source>Noise and Health</source>
          ,
          <volume>4</volume>
          (
          <issue>13</issue>
          ),
          <fpage>1</fpage>
          -
          <lpage>16</lpage>
          , (
          <year>2001</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A. V.</given-names>
            <surname>Oppenheim</surname>
          </string-name>
          , '
          <article-title>Speech spectrograms using the fast fourier transform'</article-title>
          ,
          <source>IEEE Spectrum</source>
          ,
          <volume>7</volume>
          (
          <issue>8</issue>
          ),
          <fpage>57</fpage>
          -
          <lpage>62</lpage>
          , (
          <year>Aug 1970</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Juniastel</given-names>
            <surname>Rajagukguk</surname>
          </string-name>
          and Nurdieni Eka Sari, '
          <article-title>Detection system of sound noise level (snl) based on condenser microphone sensor'</article-title>
          ,
          <source>Journal of Physics: Conference Series</source>
          ,
          <volume>970</volume>
          (
          <issue>1</issue>
          ),
          <fpage>012025</fpage>
          , (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Amanda</surname>
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Reed</surname>
          </string-name>
          ,
          <string-name>
            <surname>Tracy M. Centanni</surname>
            , Michael S. Borland,
            <given-names>Chanel J.</given-names>
          </string-name>
          <string-name>
            <surname>Matney</surname>
            , Crystal T. Engineer, and
            <given-names>Michael P.</given-names>
          </string-name>
          <string-name>
            <surname>Kilgard</surname>
          </string-name>
          , '
          <article-title>Behavioral and neural discrimination of speech sounds after moderate or intense noise exposure in rats'</article-title>
          ,
          <source>Ear Hear</source>
          ,
          <volume>35</volume>
          (
          <issue>6</issue>
          ),
          <fpage>e248</fpage>
          -
          <lpage>e261</lpage>
          , (
          <year>2014</year>
          ).
          <volume>25072238</volume>
          [pmid].
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Sergio</given-names>
            <surname>Silva</surname>
          </string-name>
          , Salviano Soares, and Antonio Valente, '
          <article-title>Digital sound processing using arduino and matlab', (11</article-title>
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhang</surname>
          </string-name>
          and
          <string-name>
            <given-names>W. R.</given-names>
            <surname>Zbigniew</surname>
          </string-name>
          , '
          <article-title>Analysis of sound features for music timbre recognition'</article-title>
          ,
          <source>in 2007 International Conference on Multimedia and Ubiquitous Engineering (MUE'07)</source>
          , pp.
          <fpage>3</fpage>
          -
          <lpage>8</lpage>
          , (April
          <year>2007</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>