JAVA/ANDROID APPLICATION FOR DETECTING HEARING LOSS - JAVA/ANDROID APPLIKATION UTVECKLING FÖR HÖRSELTEST - DIVA-PORTAL
←
→
Page content transcription
If your browser does not render page correctly, please read the page content below
JAVA/ANDROID APPLICATION FOR DETECTING HEARING LOSS Java/Android applikation utveckling för hörseltest Robin Lundin Söderberg Examensarbete, 15 hp Högskoleingenjörsprogrammet i Elektronik och datorteknik, 180 hp Vt 2022
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Preface I would like to extend a special thanks to Amin Serami who has been my supervisor at Umeå University and has been involved and contributed with technical views and other advice. I would also want to extend a thanks to HRF (Hörselskadades riksförbund) for financing this project. i
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Abstract An Android mobile application has been created with a standard audiometry test and a specific psychoacoustic (temporal masking) test to measure the user’s hearing profile and the hidden hearing loss. The application performs these tests over Bluetooth communication with a specific headphone (Sony WH-1000X M3). The audiometry test is following the standards. The audiometry will be playing tones in different frequencies (1KHz, 2KHz, 3KHz, 4KHz, 6KHz, 8KHz, 500Hz, 250Hz). The user is responding to the tone by pressing or releasing a touch button on the phone screen. The temporal masking plays a noise and a ftm (Functional tone management) tone in three different frequencies (500Hz, 2KHz, 4KHz). The noise will have the same intensity through the test on 80dB but the ftm (Functional tone management) tone will change the intensity depending on the input from the user. The user should respond to the ftm (Functional tone management) tone by pressing or releasing a touch button on the phone screen. The application is then sending the results over Bluetooth to the specific headphones over serial communication (SPP profile). The test result will then be used for tuning the sound coding parameters in the connected headphones according to the user’s individual hearing profile. The design of the headphone is not part of this thesis work but will be done in the future. ii
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Sammanfattning En Android-mobilapplikation har skapats med en standard audiometri-test och ett specifikt psyko akustiskt (temporal masking) test för att mäta användarens hörselprofil och den dolda hörselnedsättningen. Applikationen utför dessa tester över Bluetooth- kommunikation med en specifik hörlur (Sony WH-1000X M3). Audiometri-testet följer standarderna för ett audiometri-test. Audiometrin kommer att spela toner i olika frekvenser (1KHz, 2KHz, 3KHz, 4KHz, 6KHz, 8KHz, 500Hz, 250Hz). Användaren svarar genom att trycka eller släppa på knappen som visas på skärmen, när användaren hör eller slutar att höra tonen som spelas. Temporal masking testet kommer att spela brus och ftm (Functional tone management) toner i tre olika frekvenser (500Hz, 2KHz, 4KHz). Bruset kommer att ha samma intensitet genom hela testet på 80dB men ftm (Functional tone management) tonen kommer andras beroende på input från användaren. Användaren svarar genom att trycka eller släppa på knappen som visas på skärmen, när användaren hör eller slutar att höra tonen som spelas. Applikationen kommer att skicka resultatet över Bluetooth till de specifika hörlurarna via seriell kommunikation (SPP- profil). Testresultatet kommer sedan att användas för att ställa in ljudkodningsparametrarna i de anslutna hörlurarna enligt användarens idividuella hörselprofil. Utformingen av hörlurarna körs parallelt som detta projekt men är inte en del av detta examensarbete. iii
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Table of Contents Preface................................................................................................................................... i Abstract ................................................................................................................................ ii Sammanfattning ................................................................................................................. iii 1. Introduction .................................................................................................................. 1 1.1 Background ............................................................................................................................. 1 1.2 Issue ........................................................................................................................................ 1 1.3 Purpose ................................................................................................................................... 1 1.4 Goal ......................................................................................................................................... 2 2. Theory ........................................................................................................................... 3 2.1 Pure-tone audiometry ............................................................................................................ 3 2.2 Temporal masking .................................................................................................................. 3 2.3 Play sounds in Java/Android .................................................................................................. 4 2.3.1 Media-player: .................................................................................................................. 4 2.3.2 Sound-pool:...................................................................................................................... 4 2.4 Wave file ................................................................................................................................. 5 2.5 Audio chain ............................................................................................................................. 5 3. Method ......................................................................................................................... 7 3.1 Audiology ................................................................................................................................ 7 3.1.1 Audiometry ...................................................................................................................... 7 3.1.2 Temporal masking ........................................................................................................... 8 3.2 Combine wave files................................................................................................................. 9 3.3 SPP........................................................................................................................................... 9 3.4 Implementation .................................................................................................................... 10 3.5 Clinic study ............................................................................................................................ 12 4. Results ......................................................................................................................... 13 4.1 Test person ........................................................................................................................... 13 4.2 Standard deviation ............................................................................................................... 16 4.3 SPP......................................................................................................................................... 19 5. Discussion ................................................................................................................... 20 5.1 Problems ............................................................................................................................... 20 5.2 Results ................................................................................................................................... 20 5.3 Time consuming .................................................................................................................... 20 5.4 Memory management .......................................................................................................... 20 6. Conclusion................................................................................................................... 21 Reference ........................................................................................................................... 22 iv
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 v
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 1. Introduction 1.1 Background Around the world there is approximately half a billion people with a hearing disability, that is around 6–8% of the people on this planet [1]. According to HRF (hörselskadades riksförbund) [2] about 18,5% of the people in Sweden have a hearing disability, which is about 1,5 million people. HRF [3] also says that there are around four million people in Sweden that has problems with hearing when it is a background noise. This is because a hearing loss impairs the ability to sort out the irrelevant sounds and essential information, for example such as perceiving speeches over car sounds. A pure-tone audiometry is performed in a silent room. The person places headphones over their ears to make things more soundproof. The audiometry will then play sounds in different tones. If the person can hear the tone, the person will press a button and hold it down to indicate for how long they hear the tone [4]. One of the few start-up companies that has been addressing this issue is Mimi hearing technologies [11]. They have created a mobile application for both Android and iOS that runs a psychoacoustic threshold masking test to assess the spectral resolution of the user [12]. This test has been taken by over 1.5 million people on their phones worldwide [12]. Based on the test results, filters and other sound processing modules are tuned and applied to personalize the sounds on headphones, TVs, and hearables according to the individual’s hearing profile. This approach has received good feedback from hearing impaired users, a major limitation is that the software component (created by Mimi) doesn’t have control over the true intensity of the sounds being played by the hardware. This limitation also exists in the hearing test where the software does not know the true intensity of the sounds being played on the headphone. To solve this limitation, both software and hardware components must be designed together [5]. 1.2 Issue A pure-tone audiometry is the most common test that is done for hearing loss. A pure- tone audiometry does not test to see if the person is having problems with sorting out sounds over background noises. A person can pass the pure-tone test but still have hearing problems specially in background noise, a so called “hidden hearing loss”. Modern hearing aids are small and discrete devices that are designed to compensate for some important aspects of hearing loss. However, due to well-known physical limits, hearing aids are still far from providing high-quality sounds especially for music listening and phone conversation. One major limitation is due to the small size of the speakers that need to fit into the ear canal. Another major limitation is due to the underpowered embedded central processing units (CPUs) that cannot host powerful algorithms for noise cancelation, spatial 3D audio processing, echo cancelation, etc. [5]. 1.3 Purpose The purpose of this project is to create an Android mobile application to perform a standard audiometry and a specific psychoacoustic (temporal masking) to measure the user’s hearing profile and the hidden hearing loss. The application performs these tests 1
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 over Bluetooth communication with a specific headphone (Sony WH-1000X M3). The user is responding to the sound by pressing or releasing a touch button on the phone screen. The application can send the results over Bluetooth to headphones over serial communication (SPP profile) [5]. The test result will then be used for tuning the sound coding parameters in the connected headphones according to the user’s individual hearing profile. The design of the headphone is not part of this thesis work but will be done in the future. 1.4 Goal The goal with this dissertation is to upgrade today’s hearing loss test with a wider spectrum to be able to indicate if the person is starting to have a hearing loss or not. The goal is also to implement tone audiometry and temporal masking to a Java/Android application to be able to send the results via serial communication to a headphone. 2
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 2. Theory This section will be going through some of the more important information. 2.1 Pure-tone audiometry Pure-tone audiometry is plotting the thresholds over frequency. A pure-tone audiometry is performed in a silent room. The person places headphones over their ears to make things more soundproof. The audiometry will then play sounds in different tones and pitches (figure 1). If the person can hear the tone, the person will press a button and hold it down to indicate for how long they hear the tone [4]. The stimulus level usually changes with 5dB steps. The frequencies that the pure-tone audiometry is using is in octave and some half-octaves. The octave interval is between 125Hz – 8kHz and the half octave interval is between 750Hz – 6kHz [6]. Figure 1. Pure-tone audiometry 2.2 Temporal masking There are two types of temporal masking that are interesting in this application. The backward temporal masking is when the signal (tone) is being played and then the masker is being played after a certain amount of time (figure 2). The Forward temporal masking is when the masker is being played first and then the sound (tone) is being played after a certain amount of time [7] (figure 2). Both types are being used in this application (figure 3). There are several parameters that determine temporal masking, time interval between the sound (tone) and the masker, masker level, masker duration, and the acoustic similarity between the sound (tone) and the masker. When all the parameters are held constant, the temporal masking decreases fast as the interval between sound (tone) and masker increases. For a forward temporal masking no masking occurs when the interval is equal or greater than 200ms. For a backward temporal masking the minimal masking occurs when the time interval is equal or larger than 25ms [7]. 3
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Figure 2. Showing backward and forward masking Figure 3. Temporal masking 2.3 Play sounds in Java/Android Media-player and sound-pool are the most common functions that are being used when playing sounds in Java/Android. Both have pros and cons when in use. 2.3.1 Media-player: Media-player can be used to control playback audio files. The media- player is not thread-safe, creation of all access to player instances should be on the same thread. The media-player has a lot of functions for example isPlaying(). It’s a great function to be able to know if the media-player is already playing [8]. One thing to have in mind with media-player is that every time media-player adds a new sound it is adding it to the memory. So, to be able to use media-player the memory leaks need to be handled. Media-player is often used to play longer sounds for example background music. It takes some time for media player to start because it needs to add the sound to the memory. 2.3.2 Sound-pool: Sound-pool is a collection of sounds that is stored in the memory. Sound-pool uses the Media-Codec service to decode the audio into 16-bit PCM. This will help to not load the CPU when the application ships with compressed streams. The sounds in sound-pool are expected to be short. Each decoded sound has a limit of one megabyte, which is approximately 5.6sec at 44.1kHz stereo. Because the sounds are stored in the memory already the sound-pool can handle short gaps between sounds. Sound-pool does not have any functions to know if it is still playing [9]. 4
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 2.4 Wave file A WAV file or Waveform Audio file format is a member of Microsoft’s Resource Interchange File Format (RIFF) for storing audio. The WAV file does not apply any compression to the storage like a MP3 file does. A WAV file can be compressed with ACM codecs. If a WAV file needs to be converted to another file format, there is several APIs for that [10]. The WAV file contains two different chunks of data. The first one “ftm” is the chunk that specifies the data form. The second one “data” is the chunk that contains the samples. The header is 44 bytes long and contains for example, length of the data, sample rate, bits per sample and more that can be seen in figure 4 [10]. Figure 4. Wave file. 2.5 Audio chain An audio chain is a chain of components where the sound (signal) is being transmitted through. In this application there is three major components that affect the intensity of the sound (signal). The application is going to transmit the sound (signal) over Bluetooth but if this was changed to a cable (AUX) instead, the intensity would be affected, and a new calibration will be needed for the application to be able to give a correct threshold. The same applies with the headphones. The calibration of the application has been done using Sony WH-1000X M3, so if the headphones were switched to another pair the intensity would be affected and a new calibration would be needed. The headphones have speakers in them, if any of these speakers were switched, a new calibration would be needed. As can be seen in figure 5 there is one more component and that is the phone. The phone that is being used for the application will affect the intensity, but in 5
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 this case the Bluetooth is taking care of that. So, the phone will not affect the intensity when Bluetooth is being used. Figure 5. Audio Chain 6
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 3. Method This section will go through how the implementation of the major parts have been implemented in this application. 3.1 Audiology This section will go through the implementation of the two tests (Audiometry and temporal masking). 3.1.1 Audiometry The tones have already been implemented and are ready to be played. The algorithm needs to go through all the frequencies that we are using in this test (250Hz, 500Hz, 1KHz, 2KHz, 3KHz, 4KHz, 6KHz, 8KHz). Figure 6 shows the audiometry test of the right ear. It’s also showing that we are starting on 1000Hz and not 250Hz, this is because of the standards of the audiometry test that we need to follow. It also showing that the first frequency is starting on a higher decibel intensity than the other frequencies are. This is also one of the standards we need to follow in this procedure. The test starts on the first frequency that shows in figure 6. If the person who is taking the test is not pressing the button on the screen the decibel intensity will increase with 5dB every time it plays the tone. If the user is pressing the button, the first value will not be stored just to get a better calculation of the threshold later. When the user is holding the button down the decibel intensity will decrease with 5dB every time it’s being played. When the user can’t hear the tone any more the user then releases the button, and the value of the decibel intensity will be stored. After that the user releases the button the decibel intensity will start to increase again but this time with 2dB instead of 5dB. The same thing is happening when the user is pressing the button down again but decreasing with 2dB. This is just to get a better calculation of the threshold. Figure 6 shows that five values of the decibel intensity are being stored. The five values are being used to calculate the threshold of that frequency. This will be repeated through all the frequencies. The only difference between them is that only the first frequency is starting on a decibel intensity of 30dB, the other frequencies start on a decibel intensity of 0dB. Figure 7 shows the same test but on the left ear. The test works in the same way as the right ear does. Figure 6. Audiometry samples right ear. 7
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Figure 7. Audiometry samples left ear. 3.1.2 Temporal masking The implementation of the temporal masking test is a bit more complicated than the audiometry test. This is because the gap between the noise and the tone (see figure 3) needs to be exactly in the millisecond to be correct, a system sleep or a thread sleep is not working to give an exact pause in milliseconds. To be able to fix this problem a function needs to be created to take a noise and a tone to combine them with the gap it needs to have in between. To be able to combine them a new header needs to be made (see figure 4). The test starts on the first frequency that shows in figure 8. If the person who is taking the test is not pressing the button on the screen the decibel intensity will be increasing with 5dB every time it plays the tone. If the user is pressing the button, the first value will not be stored just to get a better calculation of the threshold later. When the user is holding the button down the decibel intensity of the tone will then decrease with 5dB every time it’s being played. When the user can’t hear the tone any more the user then releases the button, and the value of the decibel intensity will be stored. After that the user releases the button the decibel intensity will start to increase again but this time with 2dB instead of 5dB. The same thing is happening when the user is pressing the button down again but decreasing with 2dB. This is just to get a better calculation of the threshold. The temporal masking that’s being used in this application can be seen in figure 3. It contains a masker (noise) followed by a tone with a specific gap between them. This temporal masking (noise, gap, tone) will be repeated until the application has stored five inputs from the user that can be seen in figure 8. Figure 8. Temporal masking samples. 8
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 3.2 Combine wave files Temporal masking is using gaps of 80, 40, 20, 10 and 5 milliseconds. These gaps need to be exactly on the time. These gaps are in between the noise and the tone in temporal masking (see figure 3). One solution to this problem is to combine wave files and add the gap in between so it is just one file. To be able to combine these three (noise, gap, tone) into one file the noise and the tone needs to be converted from a wave file into a byte array. So, when the application starts it reads the two files into byte arrays. When the program is converting them to byte arrays it also needs to take away the wave header from the byte array. To be able to take the wave header away the function needs to skip reading the first 44 bytes from the file. The program will also need to create a byte array for each gap. For a gap of 5ms a byte array of 480 bytes needs be created. When a new byte array is created it will be automatically filled with zeros and that’s what the gaps need to have. When the three-byte arrays are created they need to be combined to one long byte array. The byte-buffer in Java is a great thing to use here to combine them to one byte array. To be able to use this new byte array that is combined with noise, gap, and tone it will need a wave header. To be able to add a header to the byte array another byte array will be needed. A class was made to be able to handle everything that the header needs (see figure 4). The class has one major function that the main program will call. The function will write a byte array and fill it with correct data and return it to the main program. The main program can then add the header to the beginning of the byte array that holds the noise, gap, and tone. When the two-byte arrays have been combined to one long byte array the program will convert that byte array to a wav file and save it under download on the phone. 3.3 SPP The program is going to be able to send the results of the thresholds from each test via Bluetooth. A framework was created to be able to send this data over Bluetooth (SPP) (figure 9). The frame is a way for the receiver to be able to know if the information it’s receiving is correct. The first byte indicates the starting point and will be filled with AA. The second one is to indicate what type of payload it is. In this case the payload will always be data so the bytes will be DA. The third byte is indicating the length of the payload. After this the payload follows and this will contain the data. The fourth and the fifth bytes contains the sum of all the data in the payload. The sixth byte is to indicate the end of the frame, and this will be loaded with EE. 9
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Figure 9. SPP message frame. 3.4 Implementation To be able to make this application easy for a user to use, some UI/UX needs to be implemented. When the application begins a start-activity will be the first thing that appears on the screen for the user (figure 10). This activity will display some instructions on how to proceed with both tests (temporal masking and audiometry). It will also display four buttons, three of the buttons will each play a different sound making the user aware of how the noise, ftm tone, and the tone for audiometry will sound during the test. This helps the user to prepare and to make themselves aware of what they are listening for during the tests. The fourth button is to go to the main-activity, and it will take the user to next page. On this page a text will appear to indicate what type of test the user is about to begin as well as indicating what ear it will begin testing. There will also be a button displayed on the bottom of the screen that says “start” on it. The user will press the button when they are ready to begin the test (figure 11). When the user has pressed down on the start button, it will disappear. A new button should appear that reads “press”. This is the button the user is going to be pressing when it hears the tone (figure 12). When the test is complete the “press” button will disappear, and a new “start” button will show. The title will change to tell the user what the next test will be, and on which ear it will test. When the user has completed all the tests the button will disappear from the screen, and a text will indicate that all the tests are completed. Figure 13 shows the flow chart of the implementation of the application. 10
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Figure 10. Start page of Figure 11. Page before Figure 12. Page when the test application starting the test is running. Figure 13. Flow chart of the application 11
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 3.5 Clinic study A small clinic study has been made on this application. This clinic study was made on seven different people in an age range of 20–35 on both females and males in Umeå, Sweden. All people involved with this study had indicated that they had a normal hearing and had no known problems in hearing with background noises or when it is quiet. The volunteer was alone with me in a quiet room when the test took place. The volunteer received a small brief of how the test would work before it started. The volunteer did not receive too much information before the test, to indicate if a person can successfully complete the test without having someone around to ask questions throughout. How a temporal masking and an audiometry test works is the information that was given to the volunteer before the test began. This information is also displayed on the start screen for the user which can be seen in figure 10. The volunteer was also told the order that the tests occur. Stating that the first test will be a temporal masking on the right ear followed by an audiometry test on the same ear and then switching over to the left ear. 12
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 4. Results This section will go through the results from the volunteers that have been involved in this small clinic test. The volunteers were aged between 20-35 years. All the volunteers have indicated having a normal hearing. The volunteers started with a temporal masking test on the right ear followed with an audiometry on the same ear. After the right ear had been completed the same tests have been completed on the left ear. 4.1 Test person This section is showing how the results from one volunteer with a normal hearing can look like from preforming these tests in the application (figure 14 -21). Temporal masking right ear 500Hz 85 75 Hearing threshold (dB) 65 55 45 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 14. Temporal masking right ear result on 500Hz. Temporal masking right ear2000Hz 85 75 Hearing threshold (dB) 65 55 45 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 15. Temporal masking right ear result on 2000Hz. 13
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Temporal masking right ear 4000Hz 85 75 Hearing threshold (dB) 65 55 45 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 16. Temporal masking right ear result on 4000Hz. Temporal masking left ear 500Hz 85 75 Hearing threshold (dB) 65 55 45 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 17. Temporal masking left ear result on 500Hz. Temporal masking left ear 2000Hz 85 75 Hearing threshold (dB) 65 55 45 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 18. Temporal masking left ear result on 2000Hz. 14
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Temporal masking left ear 4000Hz 85 75 Hearing threshold (dB) 65 55 45 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 19. Temporal masking left ear result on 4000Hz. Audiometry right ear -5 5 Hearing threshold (dB) 15 25 35 45 55 65 75 85 250 500 1000 2000 3000 4000 6000 8000 Frequency Figure 20. Audiometry results on right ear. Audiometry left ear -5 5 Hearing threshold (dB) 15 25 35 45 55 65 75 85 250 500 1000 2000 3000 4000 6000 8000 Frequency Figure 21. Audiometry results on left ear. 15
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 4.2 Standard deviation This section will show the median results that the volunteers got from preforming these hearing test in the application (figure 22 – 29). Temporal masking right ear 500Hz 45 Hearing threshold (dB) 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 22: Standard deviation on temporal masking right ear on 500Hz. Temporal masking right ear 2000Hz 45 Hearing Threshold (dB) 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 23: Standard deviation on temporal masking right ear on 2000Hz. 16
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Temporal masking right ear 4000Hz 45 Hearing threshold (dB) 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 24: Standard deviation on temporal masking right ear on 4000Hz. Temporal masking left ear 500Hz 45 Hearing threshold (dB) 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 25: Standard deviation on temporal masking left ear on 500Hz. Temporal masking left ear 2000Hz 45 Hearing Threshold (dB) 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 26: Standard deviation on temporal masking left ear on 2000Hz. 17
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Temporal masking left ear 4000Hz 45 Hearing threshold (dB) 35 25 15 5 -5 5 10 20 40 80 Gap time (ms) Figure 27: Standard deviation on temporal masking left ear on 4000Hz. Standard audiometry right ear -5 5 Hearing threshold (dB) 15 25 35 45 55 65 75 85 250 500 1000 2000 3000 4000 6000 8000 Frequency Figure 28: Standard deviation on audiometry right ear. Standrad audiometry left ear -5 5 Hearing threshold (dB) 15 25 35 45 55 65 75 85 250 500 1000 2000 3000 4000 6000 8000 Frequency Figure 29: Standard deviation on audiometry left ear. 18
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 4.3 SPP A simple application was created to be able to test if the Bluetooth (SPP) was able to connect to the computer and send the correct value (figure 31). The terminal on the computer needs to be running to be able to connect to the computer with Bluetooth (SPP) (figure 30). Figure 30. Terminal on the computer that receives the message from the application through Bluetooth (SPP). Figure 31. The test application that can connect to the computer and send text over Bluetooth (SPP). 19
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 5. Discussion 5.1 Problems One of the hardest things to implement in this application was the temporal masking. To be able to play a sound in Java is simple and an easy way to do it is to use media player. With temporal masking the gap between the noise and the tone needed to be so exact that the system sleep or thread sleep was not able to be used to give the perfect gap that was needed. If the system sleep or thread sleep gave an exact gap time the implementation of temporal masking would be much easier. One of the solutions was to create a new wave file in Java that contains the noise, gap, and tone. To be able to combine these three in to one file was not a big problem to overcome. The new problem was to understand how to create a new wave header and what information that it needed to contain to be able to play the new file with media player. 5.2 Results All the volunteers in this small clinic study that was made said that they had normal hearing before starting this test. By looking at the audiometry test that the people were taking all of them received a threshold under 20 decibels. A score under 20 decibels sees as normal hearing when following the standards in an audiometry test. Some of the scores that the volunteers received was just under 20 decibels, but I think they would have got a lower score if they did a retest. It can be a bit confusing from the beginning to understand what to do when taking the test even if an instruction has been given. A solution to this would be to make a small trial test for the user to do before taking the real test. By looking at the temporal masking test that the volunteers have been taking, most of them have a score between 15 decibel and just under 35 decibels. Temporal masking is not a standard test so in this case there is no standard values to go by. Because all the volunteers have a normal hearing according to the audiometry test these scores can see as normal. Even here I think that the score can be even lower if the volunteers could take a small trial test before the real test begins. The user can play the noise and the tone before taking the test, but they can’t test to see how it will be when the noise and tone is combined. 5.3 Time consuming Before the volunteers tried the test, I took the time to see how long the test would take. For me, the test took just under 25 minutes, and I would say that the volunteers took around the same time when they completed the test. Some of the volunteers thought that the time that they needed to spend on the test was a bit too long when they have normal hearing. One way to make the test shorter is to control if the person gets a low threshold after the temporal masking test and then skip the audiometry test to save time. 5.4 Memory management One of the improvements that needs to be made in the future of this application is the memory management. The application is making a new wave file for the temporal masking test that contains the noise, gap, and tone (see figure 3). The file is being stored under /storage/emulated/0/Download/, this is under the external storage and not the internal storage. Why the file is being stored under external storage is because it’s easier 20
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 to debug. One problem with this is that not all the android phones are having the same path (/storage/emulated/0/Download/) to the storage. This problem was found on an older android phone (phone was from 2017). This makes the application crash when it tries to create this new file on an android phone with a different path. The improvement that needs to be made is to change to the internal storage instead of external storage that is being used today. The application is also creating four different text files in the end of the application. These text files contain the decibel thresholds from each test. These files are being created to be able to reach the results of the tests without the need to send the result over Bluetooth (SPP). These four text files are being stored under the same external storage as the wave file that was being created for the temporal masking test (/storage/emulated/0/Download/). Improvement of this can be to not store the results as text files or to change to internal storage instead of the external. 6. Conclusion An Android mobile application has been created with an implemented standard audiometry test and a specific psychoacoustic (temporal masking) test to measure the user’s hearing profile and the hidden hearing loss. The application performs these tests over Bluetooth communication with a specific headphone (Sony WH-1000X M3). The user is responding to the tone by pressing or releasing a touch button on the phone screen. The application is sending the results over Bluetooth to the specific headphones over serial communication (SPP profile) where an Arm Cortex-M7 processor is receiving the data. The test results will then be used for tuning the sound coding parameters in the connected headphones according to the user’s individual hearing profile. 21
Examensarbete för högskoleingenjörsexamen i elektronik och datorteknik 15hp vt2022 Thesis for bachelor’s degree in electronics and computer technology 15hp vt2022 Reference [1]. B. S. Wilson, D. L. Tucci, M. H. Merson, and G. M. O’Donoghue, “Global hearing health care: new findings and perspectives,” The Lancet (British edition), vol. 390, no. 10111, pp. 2503–2515, 2017, doi: 10.1016/S0140-6736(17)31073-5. [2]. M. Lundekvam, “Hörselskadade i siffror” Hörselskadades Riksförbund, Stockholm, Sweden, Vol 2.1, 2017. [Online]. URL: https://hrf.se/app/uploads/2016/06/Hsk_i_siffror_nov2017_webb.pdf (Retrieved: 29- 03- 2022). [3]. J. Strömgren, “Kakofonien” Hörselskadades Riksförbund, Stockholm, Sweden, 2016. [Online]. URL: https://hrf.se/app/uploads/2016/06/kakofonien.pdf (Retrieved: 29-03-2022). [4]. E. Brender, A. E. Burke, and R. M. Glass, “Audiometry,” JAMA: the journal of the American Medical Association, vol. 295, no. 4, pp. 460–460, 2006, doi: 10.1001/jama.295.4.460. [5]. A. Saremi, “Application to HRF”, unpublished. [6]. R. Burkard, “Hearing Disorders,” Academic press, Vol. 3, nr. 1, pp. 273–281, https://doi.org/10.1016/B978- 0-12-803678-5.00198-3. [7]. F. E. Musiek and G. D. Chermak, “Psychophysical and behavioral peripheral and central auditory tests,” Handbook of Clinical Neurology, vol. 129, pp. 313–332, 2015, doi: 10.1016/B978-0-444-62630- 1.00018-4. [8]. Android, “MediaPlayer,” 2022. [Online]. URL: https://developer.android.com/reference/android/media/MediaPlayer (Retrieved: 01-04-2022). [9]. Android, “SoundPool,” 2022. [Online]. URL: https://developer.android.com/reference/android/media/SoundPool (Retrieved: 01-04-2022). [10]. FILEFORMAT, “What is a WAV file?, WAV File Format, WAV File Header,” 2022. [Online]. URL: https://docs.fileformat.com/audio/wav/ (Retrieved: 01-04-2022). [11]. Mimi, “mimi, ” 2022. [Online]. URL: https://mimi.io/ (Retrieved: 06-04-2022). [12]. Mimi, “Mimi Hearing Test,” 2022. [Online]. URL: https://play.google.com/store/apps/details?id=io.mimi.ht&hl=sv&gl=US (Retrieved: 06-04-2022). 22
You can also read