I just got back in touch with a life-long friend, and asked him a technical question about sound and mathematics, now, I know a little about FFT (Fast Fourier Transform) Just from my musical self-training... BUT now he's pointed me to a little more knowledge, which I will share with you, dear reader.
Any periodic function, like those saw-tooth, triangle, square waves, can be produced by summing up a series of sine waves. I.e. the Fourier series,
And, if you spend a couple years studying a series of numbers between -1 and 1 (or any arbitrary bounds, really), you have almost earned yourself an electrical engineering degree. What I am saying is, this is a field called signal processing, and is a gigantic field of study which some people have devoted their entire lives to, so you should have no shortage of interesting things to see playing with this. ;-)
Your basic .wav file is the same thing: just an uncompressed series of samples. If you write a program to dump these samples to a file in binary form, then add the proper header, you have a .wav file. Also see Fourier transforms and frequency domain filters.
Just as audio is a 1-dimensional signal, images are 2-dimensional signals. Videos are 3-dimensional signals. The same theory applies to them as well.