Monday, March 12, 2012

Turning Whalesong into Rainbows: 1000 Numbers to 1000 words

Art by Casey Roberts
Two weeks ago I wrote about how sound gets from a whale, and into your computer.  At the end of that post, I included a pretty rainbow-colored picture of some dolphin whistles.  But I didn't ever explain how all that digital data got translated from zeros and ones into a nice pretty picture.


Why are pretty pictures important to science?  Awards are given out every year by several prestigious groups for the best images in science and biology.  These images are not only beautiful, but they often help us understand complex concepts that are difficult to understand using words alone.  For instance, I can tell you that dolphins have fat deposits in their jaw bones that help transfer sound into their ears, but the following picture by Darlene Ketton's lab at Woods Hole really shows you how the auditory fats (orange) connect up with the inner ear bones (red) to help the dolphin hear.  This picture does a better job of communicating the concept than I could do in 1000 words, AND you're not bored to death, either.


A 3-D image generated from a CT scan highlights selected
 tissue groups of a bottlenose dolphin's head. 
 (Courtesy of Darlene Ketten, WHOI)
Humans process most of their information visually, so we often need to translate acoustic information into visual information.


The acoustic data that I collect in my research is stored as binary data, which means that it is stored as a bunch of ones and zeroes, like this: 


01001000 01100101 01101100 01101100 01101111 


Each of these sets of ones and zeros corresponds to a letter or a number (the code I just used says "Hello"). Unfortunately, I can't look at binary code and understand what it means, because I'm not Neo from the Matrix.  Alas!


However, my computer understands the language of binary, and it translates all of these ones and zeros into slightly shorter strings of numbers, which look something like this (except a whole lot longer):

0.000113379 0.000136054 0.00015873 0.000181406 0.000204082 0.000226757

Not really a whole lot better, is it?  

2-D

Fortunately, I know that these random-looking numbers are the pressure values for a sound wave that has been measured 80,000 times every second. This means that the first number has a time value of 0, followed by 1/80000, 2/80000, etc.  Now that I know what the time values are, I can make graph with time on the x axis and the value for pressure on the y axis, like so: 

This is better: I can see that the sounds get louder and softer over time.  If the sound is louder, it will make bigger bumps on the graph, and if it is quieter, the bumps will be smaller.  It's still pretty hard for me to pick out the different sound frequencies, or pitches.

I can kind of see what is going on here, but it is like looking at only one line of pixels from an image of Marilyn Monroe; I don't really know what is going on [A]:


Fortunately for me, a French mathematician named Jean Baptiste Joseph Fourier (1768-1830) figured out a way to represent a continuous periodic signal (like a sound wave) as the sum of a bunch of sine waves.  This means that I can break up the signal above into a lot of simple sine waves.  I can also do the opposite, by adding up a bunch of simple sine waves to create a complicated one [B]:
Adding two sine waves together.
The top four waves combined (light blue) create the more complex wave at the bottom (dark blue) 

Even REALLY complicated waves, like this one, can be created by combining fourteen simpler waves:


2-D Again - Frequency

Once we break the sound up into its component frequencies, we can create a different picture.  This picture looks at how much of the sound is made up of each frequency.  For example, in this picture we are looking at the relative contributions of different frequencies to a sound recording.  You can see that there are more low sounds than high sounds, and that there are two small "peaks" between the frequencies of 1250 Hz and 1500 Hz.  (Hertz measures the frequency of a sound.  You can hear between 20 and 20000 Hz, depending on your age.) These two small peaks are actually the two frequencies at which the humpback whale is singing at this particular moment in time.

Now, it's like I'm looking at that picture of Marilyn vertically, but still only one row at a time.




Let's recap: To make a picture of a whale song, the computer breaks up the original sound recording into hundreds or thousands of individual segments.  For each of these segments, it does a Fourier Transform, which breaks the sound wave up into its component frequencies and creates the graph shown above.  

Next, the sound values are assigned a color.  Loud sounds are generally shown as red, and quiet sounds are blue.  If we stack these values next to each other, we start to see more of the picture:  


As more and more Fourier transforms are combined, they create the picture below, which shows the whistles of two common dolphins recorded in the Irish Sea. This picture allows us to see several important parts of the sound at once - how long it is, how loud it is, and how shrill or low the noise is.  I guess it's no lady in a red dress, but it's a whole lot more useful to me!



[A] Of course, this is not a perfect analogy, because a sound waveform is a combination of all the different frequency parts.  

[B] The explanations in this post about Fourier transform are grossly, extremely simplified, and skip over most of the math.  If you want a more thorough explanation, please see The Scientist and Engineer's Guide to Digital Signal Processing.  If you have any comments on my over-simplification, please leave them on the post or shoot me an email. 




Sunday, February 26, 2012

New Age Science: Magic Crystals and Whale Songs

It is unclear if these people
have a permit, but their lack
of clothing is very clear



Whale song - almost everyone's heard it somewhere.  It's especially prevalent on new-age CDs, usually combined with the sounds of the pan flute.  Scientists don't generally play wind instruments to whales: it's actually illegal to play sounds to whales without a permit in the United States.  Recording whale song is not illegal, as long as you don't get closer to the whale than 100 yards.  But how does the whale's song get from the whale into your iphone?

I've already talked a little about how dolphins produce sound.  The method of sound production for whales is less well understood, so let's just start with the sound once it leaves the whale's body and enters the water.

A humpback whale and
hydrophone, photo by
Flip Nicklin
Like most sound, the sounds of whale songs are a result of vibrations.  These vibrations compress and expand molecules in the the water around the whale, so the molecules are squeezed together and then spread apart.  What we think of as "sound waves" are really a measure of the amount of pressure on the molecules in the water.  This is similar to what happens when you hum: as the vocal chords in your throat move back and forth, they create changes in pressure in the air around you. Here's a little video showing how molecules are moving when you hear a sound:



The applause for "Sound and Pressure" in this video is particularly poignant.

We can't usually feel the pressure of sound waves anywhere but our ears, unless the sound is really loud, like when you stand too close to the speakers at a rock concert.


Quartz, topaz, salt, sucrose (table sugar),
bone, and even silk have piezoelectric
properties. Smashing raw quartz against
the head not recommended to activate
these properties.
Now we know that sound is made of pressure waves, but how can we convert those pressure waves into the electrical signal we need for our recorder?  This is where the new-age folks would really get excited: we're going to use some "magic" crystals.  In 1881, a man named Gabriel Lippmann came up with the idea that if we squeeze certain types of "charged" crystals, we can create an electrical current.  This theory was later demonstrated by the famous Curie family, of radioactive fame.

Charged crystals are made up of thousands of molecules, each of which has a positive and negative charge.  When the molecules are "relaxed" (when you're not squeezing them), the charges balance out.  However, when the crystal is squeezed or bent, the charges are forced together or apart, creating an electronic charge on one side of the crystal.  Modern piezoelectrics are generally made of ceramic, which are coated on either side with a thin layer of metal.  You can see a modern piezoelectric crystal if you dissect the earpiece on your headphones or a singing card from the grocery store.

Note: I found an almost identical figure on a creationism site, as evidence of creationism.  They claimed as evidence that quartz is the only natural piezoelectric material.  As we see above, this just isn't true.

Compression of the crystal
results in a change in electrical
charge, measured in volts (V).
The whale sound increases the pressure in the water.  This compresses the crystal, which creates an electronic charge on each side.  Wires attached to the crystal lead up to the computer on your boat, usually via a pre-amplifier.  A pre-amplifier is just what it sounds like - it makes things louder (amplifies them) before (pre) they go up the wire and into your computer.  Pre-amplifiers are sometimes necessary because the change in charge created by the crystal is too small to travel up a long wire.

Even when the electrical charge has gone all the way up the cable, and into the boat, it isn't done yet.  It still needs to be changed from an analog to a digital signal.  Today, we generally use computers and other digital devices (ipods, hard drives, etc) to store our data and music.  Analog data is continuous, like a sound wave.  Digital data is not continuous - it takes many many samples along a sound wave. In the figure below, we can see the analog sound (in blue) with the digital samples (red).  This is probably why many hipsters people think that records are better than digital sound - because digital recordings don't keep track of most of the sound wave.



A great example of analog recording is the vinyl record.  If you don't know what a record is, you're either very young or not a hipster.  When you play a vinyl record, a needle runs down a continuous groove in the record.  As the needle moves down the groove, it vibrates up and down.  These vibrations travel up the arm of the record player, and eventually to a piezoelectric crystal (you know this one already!).  The crystal converts the vibrations to an electric signal and sends them on to your speakers.

Scanning Electron microscope photograph of the groove
 in a record, by Chris Supranowitz.

In contrast, the data on a CD is stored digitally.  Each CD is engraved with millions of tiny dots and dashes, which your computer reads with a laser and translates into music.

Scanning Electron microscope photograph of a CD, 
After an analog to digital converter has changed our electrical signal into thousands of data points, we can finally listen (and look) at the recordings we've made. As it turns out, physics, chemistry, materials and electrical engineering, and biology have all been necessary to get the sound from the whale and into the computer.  Whether you're doing yoga (like my friend Sheldon) or desperately trying to finish your thesis, there's a lot of science behind those sounds!

Bottlenose dolphin recordings from my acoustic research.


  

Tuesday, February 7, 2012

Honolulu to Kauai in One Minute

Twice a month, I sail on a shipping tug from Honolulu to either Kauai or the Big Island. On the way, I collect acoustic and GPS data on whales and dolphins. For those of you who haven't spent the night on a tug boat crossing the Kaʻieʻie Waho channel, here's a taste of what it's like (if it was sped up a LOT and you skipped the night-time part AND had really nice weather).


iTimelapse is really fun. :)





Monday, February 6, 2012

Dolphins on Helium

When you or I breathe helium at a birthday party, we get fun, squeaky munchkin voices. That's pretty fun, but what would happen if you gave helium to a dolphin? Cetacean scientists have done just that, and it wasn't because they'd been playing too much beer-pong .
What possible reason (other than the fact it's totally hilarious) could marine mammal scientists have to give a dolphin helium? For the answer, we first have to know a little bit about dolphin behavior.


In the wild, dolphins can dive hundreds of feet deep. At those kinds of depths, gasses get compressed and become more dense. The compression of gasses is one reason why human divers rarely go that deep. As the air is compressed, the molecules of the air get closer together, and the air takes up less space. Dolphins have actually evolved the ability to let their lungs collapse as the air compresses, which has a side benefit of making them less bouyant and making diving easier!(1) The picture at right (from Moore et al(2), 2011) shows a cat-scan of a dolphins lung as it compresses under pressure.
How does helium come into all of this? Helium affects our voices because it is lighter than air. At depth, the air in a dolphin's lungs is heavier than normal air - pretty much the opposite of the effect of helium. So we could expect the effect of deep diving on a dolphin's 'voice' to be the opposite of breathing helium on a human's voice. The opposite of breathing Helium for a human is breathing Sulfer Hexaflouride, a gas which is heavier than air. Do NOT try this at home.


Dolphin communication underwater should theoretically be effected somewhat like it affects the mythbusters guy - they should sound like scary Dolphin Terminators. Let's see what actually happened...

The two whistles are a little bit different(3), but neither of these sounds anything like Barry White. What gives? The reason dolphins are not effected by compressed air the way we think they should be lies in the difference between the way humans and dolphins make sounds. In real life (as opposed to on Flipper, whose voice was done by a monkey), dolphins communicate mainly through high-pitched whistles. Dolphin whistles are produced by changing the air pressure around an organ inside of the dolphin’s head. (Most toothed whales actually have two of these organs, but animals in the sperm whale family do not). This organ looks a little bit like a pair of lips, and functions a little bit like them too(4), as we’ll see in a minute.
To produce a whistle, the dolphin changes the air pressure around the phonic lips, something like you or I would blow air through our lips to make a “raspberry” sound. As you tighten the muscles in your lips while blowing air through them, you change how fast your lips flap, changing the pitch of the sound. In addition, every video in existence on lip buzzing includes a creepy-looking mustache.


Dolphins are doing this same sort of thing, but inside their heads!
Human voices, unlike dolphin 'voices,' are effected by the way sound bounces around inside our throat and mouth. Helium increases the speed of sound inside your mouth, which changes the way the sound waves bounce around in there. When the sound actually gets out of your mouth, you sound really funny. This video by the Naked Scientists explains it really well:
The sounds dolphins make don't bounce around in an air space before the leave the dolphin's head, so they sound exactly the same with and without helium.
And that, my friends, is why dolphins aren't actually much fun at a party.






1 Skrovan, R.C., Williams, T.M., Berry, P.S., Moore, P.W., and Davis, R.W. 1999. The diving physiology of bottlenose dolphins (Tursiops truncatus) II. Biomechanics and changes in buoyancy at depth. Journal of Experimental Biology 202: 2749-2761.
2 Moore, M.J., Hammar, T., Arruda, J., Cramer, S., Dennison, S., Montie, E., and Fahlman, A. 2011. Hyperbaric computer tomographic measurement of lung compression in seals and dolphins. Journal of Experimental Biology 214: 2390-2397.
3 Madsen P.T., Jensen F.H., Carder D. and Ridgway, S. 2011. Dolphin whistles: a functional misnomer revealed by heliox breathing".Biology Letters, doi:10.1098/rsbl.2011.0701
4 Cranford, T.W., Elsberry, W.R., VanBonn, W.G., Jeffress, J.A., Chaplin, M.S., Blackwood, D.J., Carder, D.A., Kamolnick, T., Todd, M.A., and Ridgeway, S.H. 2011. Observation and analysis of sonar signal generation in the bottlenose dolphin (Turciops truncatus): Evidence for two sonal sources. Journal of Experimental Biology 407: 81-96.
This post was inspired by Paul Nachtigall's Seminar and:
Jensen F.H., Perez J. M., Johnson M., Aguilar Soto N. and Madsen P.T.(2011) , "Calling under pressure: short-finned pilot whales make social calls during deep foraging dives".Proceedings of the Royal Society B. doi: 10.1098/rspb.2010.2604.