Environmental Noise Data

Measurements of noise in your own environment in dB

There are many ways of how to record noise levels in the environment, using smartphones, smart watches or dedicated noise meters. Below is an explanation of how to get this data from an Apple Watch.

Getting this data from your Apple Watch

More recent versions of the Apple Watch (Series 4 and Series 5) perform regular monitoring of environmental noise in order to be able to send warnings if the noise levels are too high. All of these data is stored in the Apple Health app on your phone and can thus be exported.

How to get the data

There is currently no easy way to export just this data, but with a bit of effort one can get access to the data. This requires first exporting all Health data and then processing this huge archive of all your data to just get the to the environmental noise.

Exporting all Health data

  1. Open your Health app on your iPhone
  2. In the top-right you should see your profile picture associated with your Apple ID
  3. Press on the profile image to open the details
  4. At the bottom of the page you should see Export All Health Data
  5. A warning about that this might take a few moments should pop up.
  6. Press Export and wait. Depending on how long you've been using an iPhone with Health, this will take a few minutes
  7. The usual iOS sharing menu will appear once the export has been finished. You can now decide where to send this data to, via email, messages etc.

For the last step it is strongly recommended to use AirDrop and send the exported data to a Mac if you have one available. The resulting export can be rather large (For @gedankenstuecke the export was 120 MB in size), making it less than ideal for email or messengers. If you can export right away to Google Drive or Dropbox that might be a good solution too.

How to process the data

However you have finished the last step of the export of the data. You should now have a ZIP archive with all of your data on your computer. Beware: the unzipped data will be quite large. An around ~120 MB big ZIP archive of @gedankenstuecke turned into a >2 GB large unzipped folder.

Furthermore: The processing instructions here require that you have this data on a computer that has some kind of Unix-esk terminal. If you are running MacOS or Linux you will be fine, if you run Windows you will unfortunately need to find out how to replace or run the sed and grep commands.

These instructions suppose that you have your exported file stored in your Downloads folder on MacOS. The step-by-step guide then becomes the following

  1. Open the Terminal app.
  2. Type in cd ~/Downloads, press enter
  3. Type in unzip export.zip, press enter
  4. Type in cd apple_health_export/, press enter
  5. Type in (or copy & paste) echo "start,end,noise_level">environmental_noise.csv;cat export.xml|grep dBASPL|grep -v Headphone|grep Record |sed "s/.*startDate=\"//"|sed "s/\" endDate=\"/,/"|sed "s/\" value=\"/,/"|sed "s/\"\/>//" >> environmental_noise.csv, then press enter

This last command will run for a while. It is going through your full Health export to identify all environmental noise entries and export just those. In the end you will have a new file in the ~/Downloads/apple_health_export/ folder, called environmental_noise.csv. This is a comma-separated file that has 3 columns (start, end and noise_level) and a single row looks like this: 2019-09-26 11:39:48 +0100,2019-09-26 12:09:46 +0100,80.5925

You can now upload this CSV file as the Environmental Noise Data.

  • Uploadable: Yes
  • Ancestors: None
  • Children: None
  • Project sources: None

Edit this entry

Return to full list of DataTypes.