This notebook expects environmental noise tracking data from an Apple Watch as an additional data source in addition to GPS data from Overland. It then maps out where in your environment you encounter noise. This notebook makes use of the new data types feature on Open Humans, allowing you to properly deposit the noise data in your Open Humans account.
I saw that the latest Apple Watch hardware/software passively keeps track of environmental noise you encounter. I thought it would be interesting to see where around the city (in my case in Paris) I encounter environmental noise.
This notebook makes use of two data sources:
The Overland connection for Open Humans. It passively tracks your GPS data and stores the data in Open Humans.
The environmental noise data as collected by your Apple Watch. Right now there is no easy way to perform this extraction of data, but there is a how-to that has a step-by-step guide on getting this data into Open Humans if you go to the
Uploader tool of Open Humans.
This notebook itself is written in
R to perform the analysis ^ visualization of the data.
For a start let's load our required packages. This can take a bit of time, as two packages need to be installed.
Updating HTML index of packages in '.Library' Making 'packages.html' ... done Attaching package: ‘purrr’ The following object is masked from ‘package:jsonlite’: flatten Attaching package: ‘lubridate’ The following object is masked from ‘package:base’: date Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Google's Terms of Service: https://cloud.google.com/maps-platform/terms/. Please cite ggmap if you use it! See citation("ggmap") for details. Updating HTML index of packages in '.Library' Making 'packages.html' ... done Attaching package: ‘data.table’ The following objects are masked from ‘package:lubridate’: hour, isoweek, mday, minute, month, quarter, second, wday, week, yday, year The following object is masked from ‘package:purrr’: transpose
With this out of the way, we can in a first step load our Overland data from Open Humans. As the GPS records are can grow pretty large, each
Year-Month will get it's own file. You can select 3 months of data by editing the
year-month data in the bit below, to make sure to grab the data you are interested in. In my case I'm getting the data from October to December 2019.
Now we can start downloading the data. In the end this data will be stored in the variable
 "read first month"  "read second month"  "read third month"
We have columns for our latitude & longitude, along with data on if/how we moved around and the speed. For further analyses we might be interested in a number of things:
That way we can plot our maps in a way that tells us when we were at a given space, helping us to better understand the noise measured at that time. The cell below performs this processing:
Now comes one of the most tricky parts of using this notebook: For the visualization to properly work you need to define the boundaries of the map, by giving the correct
boundary_ values below. Those are the latitude & longitude values which will define how big/small the map piece is we will see.
There is no easy way at this point to find 'good' boundaries and it will take some fiddeling around with those numbers to get the map you are actually interested in. The values provided by default give a good view of central Paris, but you are likely interested in a different place.
42 tiles needed, this may take a while (try a smaller zoom). Source : http://tile.stamen.com/toner/14/8296/5633.png Source : http://tile.stamen.com/toner/14/8297/5633.png Source : http://tile.stamen.com/toner/14/8298/5633.png Source : http://tile.stamen.com/toner/14/8299/5633.png Source : http://tile.stamen.com/toner/14/8300/5633.png Source : http://tile.stamen.com/toner/14/8301/5633.png Source : http://tile.stamen.com/toner/14/8296/5634.png Source : http://tile.stamen.com/toner/14/8297/5634.png Source : http://tile.stamen.com/toner/14/8298/5634.png Source : http://tile.stamen.com/toner/14/8299/5634.png Source : http://tile.stamen.com/toner/14/8300/5634.png Source : http://tile.stamen.com/toner/14/8301/5634.png Source : http://tile.stamen.com/toner/14/8296/5635.png Source : http://tile.stamen.com/toner/14/8297/5635.png Source : http://tile.stamen.com/toner/14/8298/5635.png Source : http://tile.stamen.com/toner/14/8299/5635.png Source : http://tile.stamen.com/toner/14/8300/5635.png Source : http://tile.stamen.com/toner/14/8301/5635.png Source : http://tile.stamen.com/toner/14/8296/5636.png Source : http://tile.stamen.com/toner/14/8297/5636.png Source : http://tile.stamen.com/toner/14/8298/5636.png Source : http://tile.stamen.com/toner/14/8299/5636.png Source : http://tile.stamen.com/toner/14/8300/5636.png Source : http://tile.stamen.com/toner/14/8301/5636.png Source : http://tile.stamen.com/toner/14/8296/5637.png Source : http://tile.stamen.com/toner/14/8297/5637.png Source : http://tile.stamen.com/toner/14/8298/5637.png Source : http://tile.stamen.com/toner/14/8299/5637.png Source : http://tile.stamen.com/toner/14/8300/5637.png Source : http://tile.stamen.com/toner/14/8301/5637.png Source : http://tile.stamen.com/toner/14/8296/5638.png Source : http://tile.stamen.com/toner/14/8297/5638.png Source : http://tile.stamen.com/toner/14/8298/5638.png Source : http://tile.stamen.com/toner/14/8299/5638.png Source : http://tile.stamen.com/toner/14/8300/5638.png Source : http://tile.stamen.com/toner/14/8301/5638.png Source : http://tile.stamen.com/toner/14/8296/5639.png Source : http://tile.stamen.com/toner/14/8297/5639.png Source : http://tile.stamen.com/toner/14/8298/5639.png Source : http://tile.stamen.com/toner/14/8299/5639.png Source : http://tile.stamen.com/toner/14/8300/5639.png Source : http://tile.stamen.com/toner/14/8301/5639.png
The cell above will download the map according to your boundaries. Run the cell below to see the map and evaluate whether it matches the area you are interested in. Otherwise adjust the boundaries above, run the cell above again and then plot again to see if you're having the right area. Rinse & repeat until you are happy with the map itself.
This version of the notebook expects you to have already uploaded your noise data to Open Humans through the Upload tool. There are detailed instructions on how to get the data associated with the data type.
If you haven't uploaded the data yet, this notebook will not be able to run!
Once you have done this step, you can import the noise data through the cell below:
In addition loading the data, this also identifies the halfway date/time point of each data point (individual recordings can have a total length of around 30 minutes. By calculating the halfway point we just pretend that the dB value was recorded in the middle of it.
Now we can look at our noise data:
|2019-09-26 11:39:48||2019-09-26 12:09:46||80.5925||1798 secs||2019-09-26 11:54:47||2019-09-26 11:54:47|
|2019-09-26 12:09:46||2019-09-26 12:39:46||65.5902||1800 secs||2019-09-26 12:24:46||2019-09-26 12:24:46|
|2019-09-26 12:39:46||2019-09-26 13:09:46||60.8837||1800 secs||2019-09-26 12:54:46||2019-09-26 12:54:46|
|2019-09-26 13:09:46||2019-09-26 13:39:46||55.3789||1800 secs||2019-09-26 13:24:46||2019-09-26 13:24:46|
|2019-09-26 13:39:46||2019-09-26 14:09:41||63.3795||1795 secs||2019-09-26 13:54:43||2019-09-26 13:54:43|
|2019-09-26 14:09:41||2019-09-26 14:39:36||66.8587||1795 secs||2019-09-26 14:24:38||2019-09-26 14:24:38|
We're close to doing our first map. The only thing we need to do is to join the data. We do this by matching each GPS entry we recorded to the noise recording that was done most closely to the recording of that GPS data point. As the Noise data is most likely much more coarse grained than the GPS data, we will end up assigning the same noise level recording to many GPS points, but that's the best we can do.
For a start let's look at the noise levels in rough categories across town. To this end we bin the individual dB values into different groups
For each of those categories we create one map, showing where most of those recordings where done:
Warning message: “Removed 10517 rows containing non-finite values (stat_bin2d).”