It's pretty

hip to be

square.

For the communication of data there can be little more useful than a good square wave. Unfortunately, as has been mentioned previously, even computers can't really make a perfect square wave. Luckily for we netizens, they can fake it pretty well.

To make a square wave, start with a sine wave:

_ _
/ \ / \
/ \ / \
/ \ / \
/ \ / \
/ \ / \
/ \_/ \_

Now we have to try and turn that into a square wave. Sure, sounds great, you say, *but how?!?* By adding other sine waves, of course. Not just any sine waves, naturally, since we don't want to change the fundamental wave pattern. Nope, we want to add harmonic frequencies. More specifically, we want the odd harmonics, the third, fifth, seventh, et cetera. I'm going to stick to ASCII art representations, since the mathematics involved is best covered in other write ups.

Conveniently, we have the third and fifth harmonics of our simple sine wave right here.

_ _ _ _
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \_/ \/ \_/ \_

*3rd harmonic*

_ _ _ _ _ _ _ _
/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_

*5th harmonic*

When we add them together, we get something that looks kind of like this:

/\ /\ /\ /\
| ~~~ | | ~~~ |
| | | |
| | | |
| | | |
~~\/ \/~~~\/ \/~

Which is fairly comperable an actual square wave:

|~~~~~| |~~~~~|
| | | |
| | | |
| | | |
~~~| |~~~~~| |~~~~~

The most basic use of square waves for transmission of data is to make a positive charge a `1`, and a lack of charge a `0`, or vise-versa. You can build a better receiver and create mutiple levels of sensitivity, to send multiple bits with each signal, i.e. no charge is a `00`, the next charge is a `01`, the next charge is a `10`, and the highest charge is a `11`. There are even methods of data transmission that throw all these ideas out the window.

ssd would like me to mention that the little nobbies on the "corners" of the square wave are called "ringing." Thanks ssd!