Audio replay of SAC seismograms



This is code I wrote for teaching purposes which audibly plays SAC seismograms. Since the ear is an excellent spectral analysis tool, listening to seismograms expands appreciation of the underlying phenomena. I intend using the programs to demonstrate surface wave dispersion, the different frequency content of P and S waves, and attenuation effects.

The code is a Fortran 77 main program and a C interface to the underlying workstation audio drivers. It works on the Linux, SunOS 4.x and Solaris Unix variants. You have the option of playing the sound through the workstation's speaker or through headphones. Headphones give much better sound quality, I'd recommend using them. Alternatively, take the audio line out of your workstation and plug it into external speakers. Workstation or laptop speaker quality is generally poor.

The code is a Unix shell archive. Copy the Web page containing it into an empty directory and make the `sh' command read it, e.g. `sh sacaudio.shar'. It will deposit five files,


Makefile       realplay.c      sacplay.f       tokens.f

in the directory. Edit Makefile according to the instructions you find in it, then type `make'. Take your favorite seismogram in a SAC file, say `/tmp/earthquake.bhz', and build an input file for the program, for example one called `sacplay.in':

/tmp/earthquake.bhz 1.0

which instructs the file to be played at maximum volume (number can range from 0 to 1). Then (with SACAUX set appropriately), play it by saying,

sacplay < sacplay.in

with either your headphones on or your head cocked towards your internal/external speaker. Unless you analyze normal modes, the file will play disappointingly fast, so repeatedly list it many times in `sacplay.in' to fully savor its spectral content:

/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0
/tmp/earthquake.bhz 1.0

Use SAC's decimate command to do an anti-aliased data downsampling to bring lower frequencies into the audio range. 10 sps data decimated by 5 puts 1 Hz seismic at 4 kHz audio, which makes the surface wave dispersion obvious. P waves sound like bongo drums, however.

Building this into SAC itself is a rather obvious extension to the project. Code in realplay.c will do everything you need after the SAC hooks are available. (Volunteers welcome if you become impatient waiting for me to do this.)


Comments, bug fixes, extensions or complaints to
George Helffrich