Skip to content

The physics of the Les Paul Google Doodle

June 10, 2011
tags:

In honor on of the 96th birthday of Les Paul, inventor of the electric guitiar, Google created this great doodle that lets you actually experiment and play the guitar.

I’m going to try to pull a Rhett Allain and see what I can figure out about the physics of this new Google guitar.

Finding the notes on the Google guitar

First, can I figure out the notes that are being played? This seems like something Tracker video analysis might be able to help with. I recorded a video of the doodle playing a single note using Snapz Pro, imported it into tracker, and then marked the motion of the center of the string. Here’s a plot of the vertical motion of one of the strings.

The vertical motion of one of the guitar strings. The motion appears to be a decaying oscillation that is roughly sinusoidal.

 

Because the movie is taken at 30 frames per second (and probably also there is a limit to the frame rate of the animation), you don’t really have enough data points here to make a nice smooth curve. But you can still can measure the time between two successive peaks and get the period of this oscillation, which I found to be 0.133 seconds. If we get one oscillation every 0.133 seconds, we can invert this to find the frequency in Hz.

f=\frac{1}{T}=7.5\;\textrm{Hz}

7.5 Hz? That’s below the range of human hearing.

Ok, there’s always more than one way to find the frequency. This time, let’s record the sound and see what happens when we analyze it.

Here’s the note being played:

And here’s the waveform of that note in Audacity, a great piece of free sound editing software.

Waveform produced of the longest string in the Google doodle

The note produced by a real instrument like a guitar isn’t a single tone, it’s made up of a combination of many different frequencies. This combination of frequencies is what makes two instruments, say a cello and a guitar, sound so differently when playing the same note.

One other super cool feature of Audacity is that it can plot the spectrum of a waveform, and show you all the individual frequencies and their relative strength that go into creating that waveform.

The frequency spectrum for the waveform produced by the longest string on the google guitar. On the basis of this analysis, the string seems to produce an.G2 note (98 Hz).

It seems like we’ve figured out the frequency of the base note on the guitar. A little searching of the internet gives us the notes on the guitar, which form a G major scale.

Here’s a list of each of the notes and their corresponding frequencies:

  • G: 98 Hz
  • A: 110 Hz
  • B: 123 Hz
  • C: 131 Hz
  • D: 146 Hz
  • E: 165 Hz
  • F-sharp: 185 Hz
  • G: 196 Hz
  • A:220 Hz
  • B:247 Hz

The question remains, why is the sound produced by the guitar in the hundreds of Hz, while video analysis of the motion of the string is less than 10 Hz? Let’s think about a real guitar—whenever you watch a real guitar string vibrating, you don’t see it moving as you do in the Google doodle, it’s oscillating far too fast to be seen. I think this is one of those liberties the folks have Google have taken to present us with a more engaging animation, and additionally, it really isn’t possible to draw an animation that oscillates at hundreds of Hz, since the refresh of the screen is limited far below that number.

Finding the size of the google guitar

For a guitar string, the pitch, or frequency depends on two things: the length of the string and the speed of waves in the string. You can reason to the relationship of these quantites just by remembering that the one wavelength (\lambda) passes an observer in a time of one period (T). So the velocity (\nu) must be

\nu=\frac{distance}{time}=\frac{\lambda}{T}=\lambda f,

knowing that the frequency is the inverse of the period.

The speed of wave in the string has its own dependencies, but we’ll get to that in a bit.

Since the string is fixed at both ends, we know that the lowest note this string can produce is the note that corresponds to a wavelength twice the length of the string, since this will allow the string to remain fixed at both ends of the string, as shown in illustration below.

An illustration of the string when it is maximally deflected. The string must remain at rest at both ends. Therefore, the longest wavelength of a standing wave on this string must be equal to twice the normal length of the string.

Now we can try to find the length of this string, to do that, we’ll need to figure out the scale of this illustration. The good folks at Google did include a bridge in their guitar, and after some googling, I was able to track down the dimensions on the standard string spread on an electric guitar, which is 52.4mm (0.052 m).

Using tracker to measure the length of the longest string on the guitar. If the bridge is used as a scale, the length of this string is 16 cm.

And using tracker to make measurements according to the scale, I find that the length of this guitar string is 16 centimeters, or about 6 inches. Uh-oh—this seems like a pretty small guitar. But let’s keep going and figure out what this tells us about the speed of waves in this string.

If we go ahead and assume that string is, as the internet tells us, producing a G-note at 98 Hz, and use the length of the string we just found, we can measure the wave speed in the string, using our work above.

\nu=\lambda f= 0.16\;\textrm{m} \cdot 98 \; \textrm{Hz}=16 \frac{\textrm{m}}{\textrm{s}}, which is pretty slow for a guitar string.

Are the strings on the Google guitar real?

I said previously that the speed of the wave in string has its own dependencies. We could determine this theoretically, by considering a small piece of the string, analyzing the forces on it, and ultimately solving a second order differential equation. I’ll skip that and just reproduce the result

\nu = \sqrt{\frac{T_s}{\mu}},

where T_s is the tension in the string in Newtons, and \mu is the mass per unit length of the string. Unfortunately, for a real guitar, both of these quantities are manipulated in order to produce the a wider range of possible notes on the guitar. Each string in a guitar has a different mass per unit length. The string that produces the highest notes also has the smallest mass per unit length, so that it can produce even higher notes that it would if it were identical to the other strings.

This creates a bit of a problem, since both the tension and the mass per unit length of the strings are unknown, we can’t go much further without making some assumptions. Typical electric guitars are kept at a tension of 13-15 pounds. For our purposes, we’ll assume Google uses a middle value of 14 pounds of tension (63 N) and see what that tells us about the mass per unit length of this string.

Solving the above expression for \mu, we get

\mu = \frac{T_s}{\nu^2}

Using our values of T_s=63\;\textrm{N} and 98\;\textrm{Hz}, we get
\mu = \frac{63\;\textrm{N}}{\left(98\;\textrm{Hz}\right)^2}=6\times10^{-3}\;\frac{\textrm{kg}}{\textrm{m}}

That’s a mass per unit length of 6 grams per meter, which seems to be inline with some of the reasonable values for mass per unit length for guitar strings as reported on this page.

So, to recap, while the great Google guitar has been altered a bit so that you can see the strings vibrating, and this guitar is much smaller than any real guitar, it does seem to follow the same laws of physics as a real guitar, if we assume that the Google elves at Mountain View are keeping it tuned to a standard tension.

This was my first attempt at pulling of a Rhett Allain style analysis of some everyday (or everyweb) phenomena. My knowledge of guitars is strictly limited to the “air” and “hero” varieties, so there are problem a host of errors here to accompany the usual calculation mistakes you’re sure to also find.

At our GPD meeting this past Wednesday, which featured Rhett discussing his work, he made a nice statement (which I’m paraphrasing) about how much fun it is to explore the physics of angry birds, and other videos to see how they correspond to our physical laws, since what you are doing in essence, is exploring brand new worlds, where the laws of physics might be totally different from our own. It’s the thrill of discovery, and after a few hours spent this morning trying to study Google’s guitar, I’d have to agree.

19 Comments leave one →
  1. June 10, 2011 3:41 pm

    John, the size of your window in your analysis is too small. Change it to 8192 or higher and you’ll see that the fundamental peak is right at 98 Hz, which is the frequency associated with the lowest G on a guitar (G3).

    • June 10, 2011 3:44 pm

      Aw snap! That’s going to change all my analysis. I thought it was G4.

      • June 10, 2011 3:52 pm

        The spectrum analyzer in audacity is actually pretty good if you know how to use it. The way it displays the spectrum, however, leaves a bit to be desired. I usually encourage my students to export the spectrum and graph it in excel or some other graphing program that we have which they are more familiar with and can control all the parts of the graph.

        • June 10, 2011 3:57 pm

          Ok, I think I fixed things up. It increased the mass per unit length by about a factor of 10.

  2. June 10, 2011 4:56 pm

    Excellent. Looks very much like something I would do.

    • June 10, 2011 5:09 pm

      Thanks Rhett. Coming from you, that means a ton, and I learned everything I know from reading your posts.

      • June 11, 2011 6:37 am

        I was thinking the same thing as I was reading this…

  3. June 10, 2011 5:52 pm

    Hey John. I actually programmed the doodle. This is a great writeup. I’m very interested in string physics as well. Your conclusion is correct that we took a lot of liberties. The key was to make the animation feel right and play back smoothly at 30 fps and not get strobe-like.

    Of course, a string doesn’t just vibrate in the “jump rope” fashion – it doesn’t account for the harmonics/overtones. I did simulate frequency very loosely by having higher strings oscillate faster, but again, it’s just for the right feeling, not physics-level accuracy.

    I love that you took it to this level though. I used a similar engine for my http://www.mta.me project – and more of my interactive musical projects are at http://www.chenalexander.com

    • June 10, 2011 7:54 pm

      Alexander,
      One other quick question, if you don’ t mind—what language do you program the doodle in? I tried looking at the source code, but it didn’t make much sense to me.

      • June 11, 2011 12:10 pm

        I wrote my part in Javascript, using HTML5 Canvas to draw the lines dynamically. The live code is probably very compressed or minify’d so impossible to decipher. I am trying to form a plan to do some video tutorials to show how the string plucking part of the code works, just haven’t had a chance yet.

  4. June 10, 2011 6:00 pm

    Also, the conclusion you drew from your sampling of the oscillation is right – I set the string to oscillate with a simple sin function. Felt nice to me.

    • June 10, 2011 6:08 pm

      Alexander,
      Thanks so much for taking the time to read and comment on my blog. It was a ton of fun to try to figure out the physics of the guitar, so thanks for putting that together.

  5. June 10, 2011 6:12 pm

    One last note (only because I think it might interest you) – The animation of the strings actually update in smooth steps per frame, not compensating for time. That means if you compare a very slow computer, next to a modern fast one, the strings might oscillate slower on the slower machine because it cannot keep up with the requested 30 fps update calls. This ensures that the animation is always smooth, not jumping sporadically.

    This is a common dilemma for programmers – whether to have smooth animation, or true time-based consistency. There are tradeoffs.

    Thanks for giving me a place to geek out over these details🙂

  6. Rob Spencer permalink
    June 10, 2011 7:25 pm

    John, I really enjoyed your analysis. I use Audacity for a speed of sound lab. Basically, I have a 1.2 m (ish) cardboard tube which I have standing upright. I click record and then hold the computer mic at the top of the tube. Then I snap my fingers. I usually do this several times until I get a pretty loud snap. After stopping the recording, I find one of the “snap” events. If I zoom in, the event spreads out on the screen and I can determine the initial snap and its associated echo profile. The time between incident and echo on the Audacity scale is the time the sound travels down the tube and back. A simple measurement of the length of the tube allows for both time sound travels and distance it travels to be determined. This gives way better results than the old tuning fork held above a tube of water listening for resonance.

    I also will play a tuning fork into a computer mic while recording and then zoom in on the pattern in order to confirm the frequency. You can zoom to very small time intervals. When I was reading your Doodle explanation, that is what I thought you were going to do. Then you pulled out the waveform spectrum. I suppose I will have to play with that! Thanks for the motivation!
    Rob Spencer

    • June 10, 2011 8:06 pm

      Rob,
      Thanks—I like your lab ideas. I had always used logger pro to do these things. I need to play around more with Audacity.

  7. June 11, 2011 4:10 pm

    I reached the conclusion that the strings on the guitar were not to scale much more simply: they have about the same pitch as a real guitar (probably a recording of a real guitar) but are much shorter, therefore they would need either ridiculously low tension (no stiffness to respond to a pluck) or ridiculously high mass.

    Personally, I would have like it better if the sounds had been synthesized in the doodle, rather than just played back, but that’s just my prejudice.

    • June 14, 2011 9:48 am

      You’re right. I had to manually add decay to the samples. One reason is filesize (shorter samples = smaller files). Second reason is finding a good “sweet spot” length for each sample so that songs don’t get muddy, if you’re playing a lot of overlapping notes.

      I like to think of ours as acting kind of like a palm-muted guitar🙂

      A more advanced tool would act more like a MIDI keyboard, where it separates sustain from release stages of a sample so that the length could be varied. Seemed like overkill for this.

Trackbacks

  1. The Science Learnification (Almost) Weekly – June 19, 2011 « Science Learnification

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: