Pea whistle steganography

[Image: Acme Thunderer 60.5 whistle]

Would anyone notice if a referee's whistle transmitted a secret data burst?

I do really follow the game. But every time the pea whistle sounds to start the jam I can't help but think of the possibility of embedding data in the frequency fluctuation. I'm sure it's alternating between two distinct frequencies. Is it really that binary? How random is the fluctuation? Could it be synthesized to contain data, and could that be read back?

I found a staggeringly detailed Wikipedia article about the physics of whistles – but not a single word there about the effects of adding a pea inside, which is obviously the cause of the frequency modulation.

To investigate this I bought a metallic pea whistle, the Acme Thunderer 60.5, pictured here. Recording its sound wasn't straightforward as the laptop microphone couldn't record the sound without clipping. The sound is incredibly loud indeed – I borrowed a sound pressure meter and it showed a peak level of 106.3 dB(A) at a distance of 70 cm, which translates to 103 dB at the standard 1 m distance. (For some reason I suddenly didn't want to make another measurement to get the distance right.)

[Image: Display of a sound pressure meter showing 106.3 dB max.]

Later I found a microphone that was happy about the decibels and got this spectrogram of a 500-millisecond whistle.

[Image: Spectrogram showing a tone with frequency shifts.]

The whistle seems to contain a sliding beginning phase, a long steady phase with frequency shifts, and a short sliding end phase. The "tail" after the end slide is just a room reverb and I'm not going to need it just yet. A slight amplitude modulation can be seen in the oscillogram. There's also noise on somewhat narrow bands around the harmonics.

The FM content is most clearly visible in the second and third harmonics. And seems like it could very well fit FSK data!

Making it sound right

I'm no expert on synthesizers, so I decided to write everything from scratch (whistle-encode.pl). But I know the start phase of a sound, called the attack, is pretty important in identification. It's simple to write the rest of the fundamental tone as a simple FSK modulator; at every sample point, a data-dependent increment is added to a phase accumulator, and the signal is the cosine of the accumulator. I used a low-pass IIR filter before frequency modulation to make the transitions smoother and more "natural".

Adding the harmonics is just a matter of measuring their relative powers from the spectrogram, multiplying the fundamental phase angle by the index of the harmonic, and then multiplying the cosine of that phase angle by the relative power of that harmonic. SoX takes care of the WAV headers.

Getting the noise to sound right was trickier. I ended up generating white noise (a simple rand()), lowpass filtering it, and then mixing a copy of it around every harmonic frequency. I gave the noise harmonics a different set of relative powers than for the cosine harmonics. It still sounds a bit too much like digital quantization noise.

Embedding data

There's a limit to the amount of bits that can be sent before the result starts to sound unnatural; nobody has lungs that big. A data rate of 100 bps sounded similar to the Acme Thunderer, which is pretty much nevertheless. I preceded the burst with two bytes for bit and byte sync (0xAA 0xA7), and one byte for the packet size.

Here's "OHAI!":

Sounds legit to me! Here's a slightly longer one, encoding "Help me, I'm stuck inside a pea whistle":

Homework

  1. Write a receiver for the data. It should be as simple as receiving FSK. The frequency can be determined using atan2, a zero-crossing detector, or FFT, for instance. The synchronization bytes are meant to help decode such a short burst; the alternating 0s and 1s of 0xAA probably give us enough transitions to get a bit lock, and the 0xA7 serves as a recognizable pattern to lock the byte boundaries on.
  2. Build a physical whistle that does this! (Edit: example solution!)

18 comments:

  1. ”Would anyone notice if a referee's whistle transmitted a secret data burst?” — You, if anyone, would!

    ReplyDelete
  2. This whistle ["Help me, I'm stuck inside a pea whistle"] sounds pretty much like data transmission on an old modem which was plugged into the telephone line. So I guess one would notice that if it were used extensively.

    ReplyDelete
  3. Notice that there are dark bands horizontally between the sections of noise looking vertically, suggesting that the noise itself is generating harmonics. Maybe you could hide a signal in the harmonic noise leaving the fundamental alone to help preserve the character of the sound?

    ReplyDelete
    Replies
    1. The noise harmonics are parameterized in the encoder (line 26), so it shouldn't be difficult. But I think the noise sounding wrong is what already gives away the synthetic nature of the sound, and modulating it with data wouldn't necessarily improve that.

      Delete
  4. Have you looked into the pealess designs? I love their simple physics for an un-jammable trill. I own a Fox 40 Classic. It's very loud. The package claims 115 dB and one soccer ref site measured it at 124 dB (one must be careful...sonic weapons here). I confirmed it as just barely audible from 700 m away during a gale. Mfg. claims up to 1-mile/1600m, which I believe if blown forcefully and in still air. I'd love to get Acme's Metropolitan 15. Heck, I'd like to start a collection. http://acmewhistles.ca/ http://www.youtube.com/fox40world

    ReplyDelete
    Replies
    1. Hmm, no I haven't. Do they also exhibit the frequency shift behavior?

      Delete
    2. A sports referee is almost certainly using a Fox 40-style whistle. Pea whistles are not loud enough to be heard in a full stadium. A pea whistle has a lot of "resistance" in it, I suspect a lot of the energy you put into it gets put into moving the pea around, not making sound. I think the purpose of the pea is just to periodically block airflow out of the whistle, causing an amplitude modulation. I'm not sure about the frequency modulation though. If you look here (there's a button by the stop which will show you a spectrogram) you can see:

      A pea whistle:
      https://freesound.org/people/MentalSanityOff/sounds/218318/

      Another pea whistle:
      https://freesound.org/people/joedeshon/sounds/78508/

      And a Fox 40 whistle:
      https://freesound.org/people/Pablo-F/sounds/90743/

      I don't see much frequency modulation, but I do see amplitude modulation.

      You can see the Fox 40 sounds more like what you hear at sporting events. The Fox 40 whistle has no pea, and achieves its "trill" by having two holes which emit sounds at two slightly different frequencies producing a phased output called "beat":
      https://en.wikipedia.org/wiki/Beat_(acoustics)

      I think a synthesizer/stegnosizer based on the Fox 40 would be more cryptic, as the amplitude modulation frequency is higher and so variations might be less noticible. You could also possibly modulate the phase.

      Delete
    3. Thanks for the insight!

      The trill in that Fox 40 sound is also a frequency modulation: http://i.imgur.com/6IZKZWE.png

      Delete
  5. I hate saying this, to my ears, it's pretty obvious that the noise of that whistle has data in it.

    All whistles have noise, some more than others. I see that there is noise around the varying whistle tone.I wonder if you could use substitute the noise for a spread spectrum pseudo-noise and send your data by using orthogonal sequencies. It might sound a bit less obvious.

    ReplyDelete
    Replies
    1. I agree that the noise part came out way too artificial, it's probably due to the fact that it's just one low-pass signal with a number of identical harmonics, very little entropy.

      Delete
    2. But this post was more about the possibility of mechanical FSK than audio steganography per se. More to come, perhaps.

      Delete
    3. Watching a random foreign football match on a website, i would think it was a product of the delivery or my awful laptop speakers. over the course of a 90 minute match you could probably say a lot, vuvuzelas would be another great target.

      Delete
  6. "Build a physical whistle that does this!" Now that's a challenge :)

    Maybe if the pea could be slowed down a bit, for fsk modulation. With a magnet as pea and a electromagnet right next to the whistle. Or if a magnet is too heavy to be used as a pea: an aluminium foil ball, and hope for some eddy current braking.

    It will look a bit suspicious though, with all the wires sticking out.

    ReplyDelete
    Replies
    1. Challenge accepted btw: https://lukelectro.wordpress.com/2015/12/28/continued-data-transmission-whistle-experiment-more-successful-this-time/

      Delete
    2. Can you get any data back out of it?

      Delete
  7. Good stuff!!! Played with synths for ages but never thought of this.

    ReplyDelete
  8. Oona
    You are definetely on the right track here, but in a way its a type of reversing engineering.
    Ever heard of the MIT-developed Vuvuzela. It's an untraceable Anonymous Messaging System. Sort of similar to TOR but with built in noise ( which actually could have been made by a whistle ;)

    All our best
    Anonymous Scandinavia

    ReplyDelete

Please browse through the FAQ first, it might be that your question is already answered.

Spammers have even found comments sections, so this comments section is pre-moderated; it will take some time for the comment to show up.