Generating (and Saving) Tones with SoX

I’ve been using the command line program SoX to generate tones for my physics demonstrations on sound waves.

Single frequency tones can be used for talking about frequency and wavelength, as well as discussing octaves.

Combine two tones allows you to talk about interference and beats.

SoX can do a lot more than this, so I though I’d compile what I’m using it for in a single, reference post. For the record: I’m using SoX in Terminal on a Mac.

Using SoX

To play a single note (frequency 173.5 Hz) for 5 seconds, use:

> play -n  synth 5 sin 347

To save the note to a mp3 file (called note.mp3) use:

> sox -n note.mp3 synth 5 sin 347

The SoX command to play two notes with frequencies of 347 and 357 Hz is:

> play -n synth 15 sin 347 sin 357

and to make an mp3 file use:

> sox -n beat_10.mp3 synth 15 sin 347 sin 357

Listen for the Beat

Two sound waves with slightly different frequencies sometimes cancel each other out (destructive interference) and sometimes add together (constructive interference) to create a sound that gets loud and quiter with a beat. The two lower sound waves (green and blue) are out of phase, and their combination (superposition) creates the third (red) wave.

Play two sound tones that are close together in frequency and the sound waves will overlap to create a kind of oscillating sound called a beat.

When you hear the beat (see below), you're hearing the alternating of the high amplitude region and the low amplitude region.

Below are two tones: separated and then mixed — listen for the beat.

Frequency Sound File (mp3)
Tone 1 347 Hz 1m.mpg
Tone 2 357 Hz 1m-357.mp3
Mixed Tones (with beat) 347 Hz + 357 Hz beat_10.mp3

Interestingly, you can sometimes hear the beat as a third tone if the frequency difference is just right. The frequency of the beat is the difference between the frequency of the two tones.

Notes

The SoX command to play two notes with frequencies of 347 and 357 Hz is:

> play -n synth 15 sin 347 sin 357

to make an mp3 file use:

> sox -n beat_10.mp3 synth 15 sin 347 sin 357

What Causes Autism?

Martha Herbert argues that diet and environmental toxins play a significant role in creating autism in an interview with Anne Strainchamps on To the Best Of Our Knowledge.

After much thought, I have come to the formulation that autism may be most comprehensively understood and helped through an inclusive whole-body systems approach, where genes and environment are understood to interplay.

— from Martha Herbert’s Website.

Herbert is the author of The Autism Revolution, and her website also hosts her scientific publications.

The Real-Time ITCZ

NOAA provides real-time (at least in the last 6 hours) images of the tropical Atlantic, which will often show the Inter-Tropical Convergence Zone (ITCZ) quite nicely.

They show images captured using visible light:

Tropical Atlantic using visible light. (ᔥEUMETSAT, ↬NOAA)

As well as infra-red:

Tropical Atlantic using visible light. (ᔥEUMETSAT, ↬NOAA)

Octave Sound Samples

I’ve not had much real musical training, but enough to know that I have a terrible ear for sound and can’t reproduce a note for anything. However, an informed source tells me that octaves represent the same note at different pitches.

The pitch is the frequency of the sound wave.

This "note" is a sound wave with a frequency (pitch) of 347 cycles per second (347 Hz), which has a wavelength of approximately 1 meter. It sounds like this.

If one note has twice the frequency of the other, they’re said to be one octave apart. For example, click on the image below to listen to the same note at different octaves:

Click the waves to hear the different octaves. The wavelengths of the sounds are shown (in meters).




Or play the files:

Wavelength Frequency Sound File (mp3)
1 m 347 Hz 1m.mpg
0.5 m 694 Hz 50cm.mp3
0.25 m 1388 Hz 25cm.mp3