Hack of the Whenever I Get Around to It

November 29, 2007

Graphics on Oscilloscopes using Audio CDs

Filed under: Uncategorized — Chris Merck @ 1:10 am

In a course this semester I had the opportunity to use a full-analog oscilloscope (circa 1960). The glow of the phosphor, the smoothness, and the simplicity of the device enchanted me – its elegance unsurpassed by the newer feature-loaded digital monstrosities. Particularly of interest to me were the figures which may be created by putting the scope in XY-mode (where channels 1 and 2 control the x- and y-deflection of the cathode ray respectively). If sine waves are used the resulting patterns are called Lissajous figures, but more interesting figures are possible if specially crafted inputs are used. I made it my goal to display a flower pattern (the polar graph of sine wave harmonics) on the scope by some easy method.

I decided to write a program to generate stereo sound that the oscilloscope would translate into 2D graphics (when the left audio channel is run into the x channel and the right into the y). After three hours in the EE lab I came up with the following:

  • flowergen.c, to enable the generation of sound to produce vector graphics with functions defined by the user. Currently it makes dancing flower shapes and a pong imitation.
  • img.c, to convert greyscale png images into sound which will then be displayed on the scope, using a rastering technique.
  • scope.c, to simulate an oscilloscope for testing when no scope is at hand.

These programs may be downloaded here. They require a Linux machine to run. I suppose they could also run on other systems with some modification.

Here is what the result looks like (the pong imitiation is missing from the end of the video as I ran out of memory on my SD card… you will have to try it for yourself to see that!):

For detailed instructions on how to do this yourself check out my instructable on the subject (not written as of yet).

For those who want instant gratification all you have to do is download (and extract) the finished wav files and burn them to a CD. Then sacrifice a pair of headphones to make a cable to connect the headphones jack of a portable CD player to the scope.



Blog at WordPress.com.