Wednesday, January 24, 2007

SigSys, piano style

I've seen a variant of this diagram in every SigSys book I've found (a grand total of 3, but... hush).
Basically, signals go into systems, and new signals come out. When they go in on the left side, we usually call them X; the output of a system is usually labeled Y. Y? Dunno. Anyhow, signals can be functions, or they can be discrete or continuous. Discrete functions have values at certain time steps, and that's it; continuous functions have a value at all times.

And then there's this diagram, which you also see a lot. I'm going to be a bad engineer and not label my axes or anything. It's a sketch.
Or in other words, equalizers (this is just a high-pass, you can generalize).

Diana opened class on the first day by playing us music (a signal) and showing us what it sounded like after passing through different filters (systems). First, the signal. (This isn't actually the one Diana played; it's what I had lying around. I don't know what song either is.)

The image quality makes my eyes hurt, but you can click on the picture to see a less-awful version. The green thing on the bottom is called a spectrogram, which is basically "continuous sheet music that's very hard to read." See hackish overlay of notes on top. Both sheet music and spectrograms tell you what frequencies are going at any given time, how long they are going for, and how loud they sound (fortes and accents in the sheet music, bolder colors for louder notes in the spectrograms). Anyway, this is a signal. And now: signals... the filtered versions.

Roughly translated to piano, high pass, low pass, and band pass mean "play the right hand", "play the left hand", and "play only the notes you hit with your thumbs. ("Pass" refers to the frequencies you allow to pass through.)

In reality, it sounds more like this, especially if you have a lower-order filter. They don't actually cut off the frequencies with perfect clean-ness, just more fade 'em out over time. This is why the little diagram of the filters (the red and green picture above) isn't a nice sharp step function, but a sort of funky little curve.

Another cool thing about the sheet music analogy is that the Fourier transform actually makes sense. The transform depends on the orthogonality of sines (which we had to prove in PDEs; I will see if I can dig up my chicken scratch on it) and says that you can split any signal into sine waves - or in other words, frequency components... or in other words, notes. This is a piece of music, but at any moment you can stop and say "hey, look at the keys (frequencies) I'm pressing on the piano" and break the chords down into individual notes. Fourier transforms take a signal in the time domain and transform it to one in the frequency domain, and vice versa. Kind of like saying "Ok, I can look at my music in terms of when I'm playing the notes, or in terms of what notes (frequencies) I play most often."

We also talked about complex arithmetic, which I won't write about now because it's basically "do you remember how to convert between polar and rectangular coordinates?" right now.

1 comment:

David Klempner said...

The transform depends on the orthogonality of sines...

This is an extremely fundamental idea here.

Although not *quite* the right way to put it, the "time domain" and "frequency domain" (as signal processing people tend to put it) are like different bases of a vector space.

A "system" is a function from signals to signals. A "signal" most commonly a function mapping a[1] real value (often time) to a[1] real value (eg, voltage, or what have you). In a DSP context, the function maps from integers instead of reals...

In many of the simple contexts, particularly in DSP, the "systems" are actually a linear transformation.

[1] Or k-tuples also