Earth Notes: Rad Sounds II: Attempting a Higher-fi Home-heating Time-lapse

Updated 2019-10-19 14:48 GMT.
Audification: a sequel with added audio advice from colleagues! #podcast #tech #audification #Nyquist
2018 4o 5s Audacity screenshot
"radsounds" Uploaded . Duration 202 seconds. Download MP3 clip 2941kB (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 908kB, hi-fi FLAC clip 9341kB.
Transcript:

Hi, I'm Damon Hart-Davis, and this is the Earth Notes podcast episode for 12th October 2019.

I'm trying for even radder sounds from my radiators and temperature data.

My colleagues were horrified when I explained the very simple method that I was using to convert temperature data samples into constant-rate 'audio' data. Mainly in how each 715 seconds I took the last valid temperature sample to use as the next output audio sample. A famous (dead) chap called Nyquist may also be spinning given the potential noise injected into the audio by doing that.

Nyquist said that any frequencies above half the sampling rate are not going to be rendered well or at all in the output. They may turn into beat frequencies or disappear, or likely just noise. Such frequencies above half the sample rate should be cut off, ie filtered out, before taking the output samples.

In defence of my simple method, temperature is only internally sampled by the Radbots every minute. Only a subset of stats is sent on each transmission. Transmissions are 2 minutes apart, but typically temperature will only get sent at most [about] once every 4 or 8 minutes. Radbot does try to send a value as soon as possible after it changes, and temperature changes will typically be one unit in the least significant place (1ulp) before rescaling. Thus the resampling method I was using probably wasn't losing much information, for example, or adding much noise. At least for the '4o' outside samples that change relatively smoothly.

I tried instead resampling the data at 60 seconds rather than 715 seconds, so all actual Radbot information should be present in the intermediate .wav. This gives a nominal 525600Hz sample frequency.

I tried a number of approaches, but settled on loading the data into Audacity, using "Normalize" to get the volume OK, then "Resample" to the final 44100Hz. That leaves a spectrum that rolls off fast enough to make Nyquist happy, and has peaks at around 365Hz and its harmonics, as I would expect.

Before: [twice 2018-4o]

After: [twice 2018-4o-NR]

It doesn't sound much different to me for 4o though.

Nor indeed for 5s, where the low-pass filtering might have been expected to take more roughness off.

Before: [twice 2018-5s]

After: [twice 2018-5s-NR]

Note that the FLAC files are slightly smaller with the cleverer processing, which does imply slightly less noise.

However, perhaps simple is good enough for this simple case. I shall seek more advice!

There's more on my "Earth Notes" Web site at Earth.Org.UK.

The Sounds

4o: outside

From last time: temperatures outside in our porch (4o) for all of 2018 (.wav):

"2018 4o" Uploaded . Duration 1 seconds. Download MP3 clip 15kB (i) (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 7kB, hi-fi FLAC clip 48kB.

Now with samples (up to) every 60s rather than 715s, ie a nominal 525600Hz, then resampled in Audacity hoping for a better sound (.wav):

"2018 4o 525600Hz" Uploaded . Duration 1 seconds. Download MP3 clip 15kB (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 7kB, hi-fi FLAC clip 46kB.

Now with the 525600Hz input, in Audacity Normalize then Low-Pass Filter at 22050Hz with 6dB/octave roll-off then Resample to 44100Hz (and set project rate to 44100Hz):

"2018 4o NLR" Uploaded . Duration 1 seconds. Download MP3 clip 15kB (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 7kB, hi-fi FLAC clip 45kB.

Now with the 525600Hz input, in Audacity Normalize then Resample to (and project rate) 44100Hz (spectrum):

"2018 4o NR" Uploaded . Duration 1 seconds. Download MP3 clip 15kB (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 7kB, hi-fi FLAC clip 46kB.

5s: inside

From last time: temperatures at my desk (5s) for all of 2018 (.wav):

"2018 5s" Uploaded . Duration 1 seconds. Download MP3 clip 17kB (i) (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 9kB, hi-fi FLAC clip 55kB.

Now with the 525600Hz input, in Audacity Normalize then Resample to (and project rate) 44100Hz (.wav):

"2018 5s NR" Uploaded . Duration 1 seconds. Download MP3 clip 18kB (may not be available in data-saver/lite mode), download low-bandwidth MP3 clip 9kB, hi-fi FLAC clip 53kB.

Code

Sampling 4o (up to) every 60 seconds (Radbot's underlying sampling rate) and therefore at a nominally higher frequency of 525600Hz to achieve 1 year in 1 second. I do some sort of low-pass filtering and resample in Audacity to 44100Hz.

xz -d < data/OpenTRV/pubarchive/remote/2018.json.xz | sh script/mkaudio/OpenTRVJSONtoWAV.sh "T|C16" 819C99B4B9BD84BB 60 525600 > ~/tmp/out.wav

Sources and Links

  • Catalina microphone issue with Audacity: ... I am unable to record audio with [] the microphone ... . The work-around seems to be to run Audacity from the terminal with /Applications/Audacity.app/Contents/MacOS/Audacity.