[<< | Prev | Index | Next | >>]

Friday, July 26, 2002

Waves and Wavelets

Yeah, I should be working on my AI, but.. What can I say -- I'm easily distracted.

I wrote some code to do wavelet transforms. Frequency is on the vertical axis (low frequencies on the top), and time on the horizontal. The above plot is of middle-C played in alternation and unison with each of the other notes of the octave in order, as in the sequence C; C#; C+C#; C; D; C+D; C; D#; C+D#, and so on. Notice that a single note, such as the first C, is composed of many frequencies -- they are called the harmonics, and are spaced at integer multiples of the base frequency. Since this is a log scale, the pattern of harmonics for all notes is exactly the same, just shifted vertically depending on the note.

In case you've ever wondered what was special about, say, the 5th, or major or minor 3rds, or the octave, for that matter, there's your answer on the above graph: Note how the stair-steps fall within the horizontal bands laid down by the repeating C key. The first (top) harmonic reaches the second one only after the entire octave (twelve steps -- the eight notes of the "octave" don't count sharps even though all twelve keys are equally spaced!). The second harmonic reaches it's companion after seven steps, which is a fifth in octave terminology (C/G). The third harmonic reaches it's companion after five steps (a fourth - C/F), the fourth harmonic after four steps (a major third - C/E), and the fifth after three steps (a minor third - C/E-flat). The third harmonic also goes on to hit a second band (two harmonics away instead of one as with all the prior examples) after nine steps (a sixth - C/A). Since the lowest-numbered harmonics tend to be the strongest, the above examples are roughly in order of "how good a match" the two notes are: C/C(octave), C/G(fifth), C/F(fourth), C/E(major third), and C/E-flat(minor third), with C/A (the sixth) falling somewhere toward the end there. If the plot showed frequency in a little finer detail, you would also see that the aligning harmonic of the E (the major third) is slightly too high in frequency, whereas the aligning harmonic of the E-flat is slightly too low. Perhaps this gives the major and minor third their characteristic "more than enough" and "not quite enough" feeling? Hmm.

The above was recorded from a little mic sitting on my office desk while I plunked the piano keys in the living room. I'm surprised it picks up so well at distance! It bodes well for having the computer take voice commands later on.

In almost unrelated news, the surf is up, so I finally got to try out my new waxless board! Woh, very different. First attempt, I tripped over the tail traction when popping up and pulled a sharp, unintentional turn half way down the face of the wave, almost beaning someone in the head. Didn't do that again. Once I got the hang of it, though, it's a whole new level of control over the board. It is good. I caught many waves. This board's easier to duck-dive than my old one too. Not quite as squirly, though -- it seems made for larger waves. If my body recovers in time, they're supposed to be 4-6' this weekend...

[<< | Prev | Index | Next | >>]

Simon Funk / simonfunk@gmail.com