Monday, December 20, 2010

More visuals: a sonogram

Thinking about tone color gives me an opportunity to geek out. I found a spectrogram generator (here's the code, and here's Wikipedia on spectrograms), and applied it to the F scale I graphed earlier. I put the frequency axis on a log scale, so that intervals are a constant length. There's tons of things visible here, you can get a direct sense of how strong the different harmonics of each note is. The fundamentals of the low notes are quite weak compared to the harmonics. And different notes can have quite different relative harmonic strengths, note to note: this reflects the changing color of each individual note. You can see the whole and half steps going up the major scale, not just in the fundamental, but also in each harmonic. The higher harmonics look a little wonky, interval wise though. The first harmonic (the octave) is basically parallel to the fundamental, the second (a twelth above the fundamental) also looks like a scale, though not perfectly smooth steps. Eg the upper D-E step (above the staff, D4-E4, so the overtone is A5-B5) looks much wider than the harmonics below. I think this is basically a departure from harmonicity, as James Kopp has written about. For that matter, the two E4's don't line up: I guess played them at different pitches. It's processing like this that allows pitch analysis and correction software to do what it does. Looking further up in frequency, I can still trace the scale up to around the sixth harmonic or so, but it becomes harder, as the harmonics become closer together. There's also things which I wouldn't expect to be there, eg there's dim bands between the fundamental and the first harmonic on the high E-F-E. It looks to be an octave below the second harmonic, so might be some kind of weird period doubling effect. Or an artifact. The fuzzy constant bands below the fundamentals are almost certainly artifacts, they change when I change things like the sampling window (these graphs done with 4096, or about 0.1 seconds).

Another view of the same data can be gotten by plotting in 3D. Here, the changes in intensity of every note are much clearer: not only the Bb3 I caught before, but a lot of other notes as well: the G3 after crossing the break, both E4's. And not just intensity (ie volume) but also color: the fundamental and the harmonic are not changing together.

I also turned the whole thing on its side, which shows all the notes put on top of each other. There's a strong but broad peak in the range 400-700 Hz, a formant, a weaker one around 2 kHz, then a cutoff around 2.3 kHz. That first formant is why the harmonics are so strong, and the fundamentals are so weak, at least until you get up high.

And finally, Melodyne's view of it.

No comments:

Post a Comment