=Paper=
{{Paper
|id=Vol-2820/paper1
|storemode=property
|title=EarSaver: A Device to Detect Dangerous Audio Noises
|pdfUrl=https://ceur-ws.org/Vol-2820/AAI4H-1.pdf
|volume=Vol-2820
|authors=Lorenzo De Lauretis,Tiziano Lombardi,Stefania Costantini
|dblpUrl=https://dblp.org/rec/conf/ecai/LauretisLC20
}}
==EarSaver: A Device to Detect Dangerous Audio Noises==
EarSaver: A device to detect dangerous audio noises
Lorenzo De Lauretis, Tiziano Lombardi and Stefania Costantini 1
Abstract. The issue of noise pollution is becoming more and more the firmware and their functionalities. Sections 5 and 6 discuss the
relevant in our today’s way of life. Studies have shown that some testing phase and the achieved results. Then, Section 7 reports our
noise waves are especially damaging, triggering continuous harm to conclusions based on data obtained using our prototype.
the nervous scheme with the resulting failure of listening capacity in
some instances. Thanks to the latest technological findings, noises 2 RELATED WORK
can be sampled and analyzed even on very tiny appliances that can
possibly be carried anywhere. By testing the noise via a condenser In [6], Rajagukguk et al. sampled the sound using a condenser micro-
microphone and evaluating the outcome of applying the Fast Fourier phone, analyzing the data using an Arduino Uno. They used an LCD
Transform to the sampled samples, we can identify the existence of display, a buzzer and LEDs to display the information about the dan-
frequencies that are considered detrimental to the auditory system, ger level of the analyzed sound. Their device warns the user when
warning a person in real-time about the prospective risk to which the sound reaches the pressure of 75dB, considered by them harmful
(s)he is facing. 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.
In [1], Bianchi et. al. explored the use of the Arduino platform,
1 INTRODUCTION that can be a versatile audio processor. They treated the real-time
signal processing, with particular emphasis on the FFT, realizing a
Living in our culture today implies being continually surrounded by
sort of benchmark to discover the maximum length of an FFT that
the voices and vibrations generated by the most disparate causes like
can be computed in real-time inside an Arduino. Their work is more
smartphones, vehicles, automobiles, aerial transport, etc. Due to pop-
about the operations that Arduino can make on audio, with the related
ulation growth and urbanization, this “noise pollution” will increase
benchmarks, while we focus more on the practical application of the
[3]. Noises should not be hazardous to the human ear in small doses
results of FFT computation to prevent hearing loss.
and low volume, but they can be hazardous if they increase in vol-
In [8], Silva et. al. made a study on digital sound processing using
ume and density. According to recent research, with long-lasting ex-
Arduino and Matlab2 , using two different approaches: in the first one,
position to certain sound thresholds, there are specific sounds that
all the computation is done on the Arduino, in the second one the
can trigger serious hearing loss in rats for several days; these sounds
sound samples are instead sent to a laptop where Matlab software
have a frequency of 16kHz and stress of 115dB. There are also worst
performs the computations, before sending back to playback on the
noises, with a frequency of 4kHz with a pressure of 125 dB, that
Arduino. Their work, differently from ours, is partly implemented
cause permanent damage to the hearing of rats in both the low- and
on the Arduino and partly on a PC with complex sound analysis.
high-frequency range [7]. Sounds at so high pressure can be danger-
Instead, we focus only on the Arduino without the need of the PC,
ous for the human ear too [4].
thus devising a fully portable device.
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 3 BACKGROUND
of the Fast Fourier Transform (FFT) to the sampled signals, thus de- This section discusses some heritage notions about Arduino and Fast
tecting dangerous noises. When dangerous noises are detected, a led Fourier Transform approach.
installed on EarSaver starts blinking, so as to warn the user of the
potentially harmful noise. We tested the device with different noises
3.1 INTERNET OF MEDICAL THINGS
at different frequencies/pressures, obtaining satisfactory results. This
work is part of the eHealth project [2]. The Internet of Medical Things (also called the internet of health
The paper is structured as follows. In Section 2 there is an excur- things) is an extension of the Internet of things (IoT)3 . It is the spe-
sus about similar works related to this topic. Section 3 presents back- cific field of application for medical and health purposes, such as
ground knowledge needed to better understand the work we have data collection and analysis for research and monitoring. This ‘Smart
done. Section 4 describes our prototype, explaining the architecture, Healthcare’ infrastructure facilitates the creation of digitized health-
care systems, connecting available medical resources and healthcare
1 Department of Information Engineering, Computer services. IoT healthcare systems manage chronic diseases and their
Science and Mathematics, University of L’Aquila,
Italy, Email: lorenzo.delauretis@graduate.univaq.it, prevention and control. The connectivity for remote monitoring en-
tiziano.lombardi@graduate.univaq.it, stefania.costantini@univaq.it ables health practitioners to capture data of the patients and applying
Copyright © 2020 for this paper by its authors. Use permitted under Cre- complex algorithms in health data analysis.
ative Commons License Attribution 4.0 International (CC BY 4.0). This
2 https://it.mathworks.com/products/matlab.html
volume is published and copyrighted by its editors. Advances in Artificial
Intelligence for Healthcare, September 4, 2020, Virtual Workshop. 3 https://en.wikipedia.org/wiki/Internet of things
3.2 ARDUINO • 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.
Arduino4 is an open-source hardware and software company that de- • Mic sensor: is a sound sensor, which detects audio from the ambi-
signs and manufactures single-board microcontrollers and microcon- ent and transmits data samples to the Controller component.
troller kits. They are used for building or prototyping digital devices
and interactive objects, which make use of various sensors and actua- The presented Component architecture is designed to be Hardware
tors. Boards are equipped with sets of digital and analog input/output independent, in the sense that the same designed system can be im-
(I/O) pins that may be interfaced to various hardware components. plemented also in different platform apart from the chosen Arduino
Arduino boards can be easily programmed using an Integrated De- framework; which means, it could be used also in other critical appli-
velopment Environment (IDE)5 and a USB cable. A typical Arduino cations, such as the detection of ultrasonic-frequencies in a medical
program is composed of two main functions: environment or very low frequencies in sonar applications (i.e. reso-
nant testing of buildings).
• setup: it is the initialization phase of the board
• loop: it is a portion of code executed repeatedly.
3.3 FAST FOURIER TRANSFORM
The Fast Fourier transform (FFT6 ) algorithm is a method for com-
puting the Finite Fourier transform of a series of N (complex) data
points in approximately N log 2 N operations.
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 [5] from the original waveform signal.
Another use case is the Automatic Indexing of Musical Sounds [9]
through their timbre recognition.
4 ARCHITECTURE AND FIRMWARE
4.1 SYSTEM STRUCTURE
Figure 2. EarSaver Hardware Deployment
Figure 2 shows an example of the deployment of the system,
putting in evidence the hardware structure and communication. In
our Arduino example, we can see three hardware boards wired to-
gether. In particular:
• Arduino Board: the core board with the main controller installed
into it. Here is where the main firmware runs.
• Sensor Shield: input peripheral board where sensors are installed
(microphone in our case). This board collects data from the envi-
ronment and sends them to the main controller.
• Actuator Shield output peripheral board, where actuators are in-
stalled (the LED in our case). This board is interfaced to the user.
Figure 1. EarSaver architecture 4.2 SYSTEM BEHAVIOR
This system is characterized by three running states during its execu-
This section discusses the architecture of the system using an
tion, related to the danger index.
UML Diagram Component in order to show relations among differ-
ent stages composing our system. As shown in Figure 1, EarSaver is • Normal: is the idle state in which the environment is in a safe state
composed of five macro-components: and nothing is prompted to the user.
• Danger: the environment is exiting the safe state for the presence
• Controller: the “brain” of EarSaver, it has the Firmware core in-
of some dangerous frequency. The user is softly prompted of that.
side. It receives input data from the Microphone Sensor and, when
• Critical: the environment is totally unsafe for the presence of dan-
dangerous noises are revealed, it triggers the Alert LED.
gerous frequencies at a high-pressure level. The user is strongly
• Health rule checker: it contains all the mathematical rules applied
alerted.
to collected microphone data in order to reveal dangerous situa-
tions. When entering a state, the system properly sets its actuators to
4 https://en.wikipedia.org/wiki/Arduino inform the user about environmental changes. Specific conditions al-
5 https://www.arduino.cc/en/Main/Software low the system to change state in a scale of danger; moreover, the
6 https://en.wikipedia.org/wiki/Fast Fourier transform
system can return in a normal state if a critical situations end.
Figure 3. EarSaver Behavior evolution
Algorithm 1 FFT Implemented on Arduino all wanted frequencies with respect to hardware capabilities.
• The number of samples: it is chosen large enough to have a certain
set sampling max frequency number of samples which can emphasize the characteristic of the
s e t number of samples audio signal, accordingly with hardware capabilities.
set dangerous frequencies array
s e t dangerous common SPL After the declaration of the two parameters described above, there is
s e t dangerous SPL the declaration of global variables to describe the samples’ list of data
and the initialization of our algorithm variables. In the Loop method,
Loop {
read number of samples in range (0 , there is the cyclic core of the algorithm. First of all, it collects the
sampling max frequency ) chosen number of samples, storing them in dedicated memory lo-
−> s a m p l e a r r a y cations. Then Fast Fourier Transform is applied on the set of data,
identifying the spectrum characteristic of the detected audio signal,
do FFT on s a m p l e a r r a y −> F F T a r r a y
which can be compared with the target to possibly trigger an alert,
f o r e a c h FFT elem i n F F T a r r a y { which turns on/off the output LED of the circuit. This algorithm is it-
i f FFT elem [ SPL]>= dangerous common SPL { erated every second in order to have real-time continuous monitoring
alert
}
of the environment.
f o r each d an g er ou s f re qu e nc y in
dangerous frequencies array {
i f FFT elem [ f r e q u e n c y ] == 5 DETECTING MALICIOUS FREQUENCIES
dangerous frequency {
i f FFT elem [ SPL ] >= d a n g e r o u s S P L { The main objective of our device is to warn the user of potentially
alert harmful noises that are in her/his surrounding, helping them to pre-
}
}
vent 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.
} As discussed in [7], there are two main kinds of sound that are
very dangerous for the auditory system of the rat: one is 16kHz at
In this first prototype, the state machine in Figure 3 realizes the 115dB and one is 4kHz at 125dB. The exposition to the noise with
Arduino Firmware, which allows EarSaver to be reliable and func- 16kHz and 115dB can cause severe hearing loss for several days,
tional. It relies on the usage of the FFT algorithm, which is a poly- while the exposition to the noise with 4kHz at 125dB can cause per-
nomial approximation of the Fourier Transformation method. This manent damage to the auditory system of the rat. Also, as argued in
method is parametrized on two parameters: the sampling maximum [4], sounds at so high pressure are dangerous for the human auditory
frequency, which determines the maximum detectable frequency; the system too, and they should be avoided.
number of samples to be stored and then analyzed, which describes The noises at 115dB and 125dB are at very high pressure, so they
our implementation is shown in Algorithm 1. can be identified by the human ear; the frequency recognition, in-
At the beginning of the code, it is possible to see the declaration stead, can be more difficult for the human ear, so we need a device
of the two parameters cited above. that helps the user in recognizing also these potentially harmful fre-
quencies. As the first step, we built our prototype with with Arduino
• Sampling maximum frequency: it is chosen high enough to catch as the microcontroller, as shown in the previous section. The result-
ing device can be used for audio sampling and analysis. The device is wave generator had a pressure of 60dB, the led on our device had
very small and is battery powered, so it is perfect to be carried around not blinked, because the analyzed sound was not potentially harmful.
potentially everywhere. When we tested the device with noises with the pressure set at 80dB,
As next step, we wrote the code that permits to the Arduino to the led blinked when the noises reached 4kHz and 16kHz frequen-
work, written entirely in C++7 : through this code, we were able to cies, correctly advising the user of the analyzed harmful frequencies.
sample and analyze the audio surrounding our device and to make a When the noises produced from our wave generator had a pressure
led blink. of 90dB, the led blinked when the noises reached 4kHz and 16kHz
Our device helps the user in the recognition of frequency and pres- frequencies, correctly warning the user of the potential danger for
sure, blinking a led to alert the user when one of the following con- his ears. When the noises had a pressure of 105dB, the led blinked
ditions are met: within all the frequencies reached from our wave generator, because
we consider dangerous noises at so high pressure. The led blinking
• Analyzed sound is at a frequency of 4kHz or 16kHz and the pres- frequency is proportional to the pressure of the analyzed noises.
sure is greater equal 75dB. A problem that is possible to identify in our system is the micro-
• Analyzed sound has a pressure greater equal 100dB. phone sensibility, that, in some cases, cannot be enough to sample
very high sound pressures: the microphone we used for testing is a
The led blinking frequency is proportional to the pressure of the an-
consumer one, that can be bought from everybody to build own de-
alyzed noises. When the sound pressure is lower than 75dB, the led
vices, and not a professional one; so, the precision is not so high for
is switched off, when the sound pressure is greater equal 75dB it
professional use; it may lead to a loss of precision during measure-
blinks at a 2Hz frequency, when the sound pressure increases even
ments. From the testing results, we can ensure that our device works
more, the led blinks with an increasing frequency, until it reaches the
correctly with respect to the workflow, properly identifying the po-
100Hz blinking frequency, at the 125dB.
tentially dangerous frequencies/pressures.
The device was tested using a wave generator, an object that is able
to produce sounds at particular frequencies and pressures. We per-
formed forty noises tests, with four different pressure levels: 60dB, 7 CONCLUSIONS AND FUTURE WORK
80dB, 90dB and 105dB, varying the frequency from 2kHz to 20kHz. In this work, we created a tool that warns the user when potentially
The results of our tests are shown in Table 1: if the led blinks at the harmful noises are detected in its near surroundings. It is very small,
corresponding frequency and pressure, in the table is reported “Yes”, meaning that it can be carried potentially everywhere. It is cheap and
“No” otherwise. We tested our device in a silent room, without ex- is easy to build, meaning that it can be constructed potentially by
ternal sounds, to prevent interferences given from them. everybody. It is functional because it is able to sample and analyze
the noises coming from the near surroundings, warning the user with
Table 1. Led blinking testing results the blink of a led if the analyzed noises are potentially harmful to
60dB 80dB 90dB 105dB them. In the near future, we will build another version of our system,
2KHz No No No Yes with a better professional microphone, that will be able to sample the
3KHz No No No Yes sounds with better precision, even at higher sound pressures. Using
4KHz No Yes Yes Yes the design guidelines illustrated here, everybody can build its own
5KHz No No No Yes
system with a very low budget, safeguarding their own auditory sys-
6KHz No No No Yes
10KHz No No No Yes tem and protecting their ears from auditory diseases.
14KHz No No No Yes
16KHz No Yes Yes Yes REFERENCES
18KHz No No No Yes
20KHz No No No Yes [1] André J. Bianchi, ‘Real time digital audio processing using arduino’,
(2013).
[2] Lorenzo De Lauretis, Stefania Costantini, and Ivan Letteri, ‘An ontology
to improve the first aid service quality’, in 2019 IEEE International Con-
ference on Systems, Man and Cybernetics (SMC), pp. 1479–1483. IEEE,
6 DISCUSSION (2019).
[3] Lisa Goines and Louis Hagler, ‘Noise pollution: A modern plague’,
This paper started with an introduction to Arduino and why it is so
Southern Medical Journal, 100(3), (2007).
useful to cope with problems that are always more relevant nowa- [4] M. Maassen, W. Babisch, K. Bachmann, H. Ising, G. Lehnert, P. Plath,
days. We choose Arduino for our project for a number of reasons: it P. Plinkert, E. Rebentisch, G. Schuschke, M. Spreng, G. Stange,
is open-source, it is cheap, it is all-in-one and can be programmed V. Struwe, and H. Zenner, ‘Ear damage caused by leisure noise’, Noise
using C++. Via the combination of all these features, we got a dedi- and Health, 4(13), 1–16, (2001).
[5] A. V. Oppenheim, ‘Speech spectrograms using the fast fourier trans-
cated microcontroller that is easily expandable. The sensors and ac- form’, IEEE Spectrum, 7(8), 57–62, (Aug 1970).
tuators are relatively cheap, permitting, with a very low budget, to [6] Juniastel Rajagukguk and Nurdieni Eka Sari, ‘Detection system of sound
build one’s own devices. There are a lot of Arduino libraries available noise level (snl) based on condenser microphone sensor’, Journal of
online, that permit rapid development of code for any device. With- Physics: Conference Series, 970(1), 012025, (2018).
[7] Amanda C. Reed, Tracy M. Centanni, Michael S. Borland, Chanel J.
out Arduino and all its features, a work such as the one described in
Matney, Crystal T. Engineer, and Michael P. Kilgard, ‘Behavioral and
this paper would have been more complicated and, in some cases, it neural discrimination of speech sounds after moderate or intense noise
would have not been possible. exposure in rats’, Ear Hear, 35(6), e248–e261, (2014). 25072238[pmid].
Within the data obtained from the testing, it is possible to verify [8] Sergio Silva, Salviano Soares, and Antonio Valente, ‘Digital sound pro-
that the devices works well, correctly identifying the potentially dan- cessing using arduino and matlab’, (11 2012).
[9] X. Zhang and W. R. Zbigniew, ‘Analysis of sound features for music tim-
gerous frequencies/pressures. When the noises produced from our bre recognition’, in 2007 International Conference on Multimedia and
7 https://it.wikipedia.org/wiki/C%2B%2B Ubiquitous Engineering (MUE’07), pp. 3–8, (April 2007).