INTRO ANIMATION TO BE DETERMINED

## Objectives

To develop the connection between sine waves and the sounds that they can generate.

## Level

This demo can be used at the precalculus or calculus level. It may also be used in introductory courses on speech and hearing.

## Prerequisites

Familiarity with the graphs of sine functions and the properties of amplitude, period, and phase shift together with knowledge of angular measure in degrees and radians.  Basic knowledge of Excel if the included interactive Excel worksheet is used. Basic knowledge of MATLAB if the included MATLAB experiments are used.

## Platform

Portions of the demo can be done within a browser. Excel or MATLAB are needed if the accompanying activities are used.

## Instructor's Notes

Background on sound:
The trigonometric functions of sine and cosine are used to build models for processes that repeat in cycles or involve oscillations. Typical biological examples that involve oscillations are heartbeats and breathing. Examples that involve cycles include the daily and seasonal cycles of the earth, population cycles, and tides. What we refer to as sound, and experience as noise, music, and speech, etc., involves oscillations. An object produces sound when it vibrates in a solid, liquid, or gas.  The situation we focus on in this demo is the sounds we hear made by an object vibrating in our atmosphere. So the sound will be traveling through air.

"To see how this works, let's look at a simple vibrating object: a bell. (See Figure 1.)When you hit a bell, the metal vibrates -- flexes in and out. When it flexes out on one side, it pushes on the surrounding air particles on that side. These air particles then collide with the particles in front of them, which collide with the particles in front of them, and so on. This is called compression."

Figure 1. (Used with permission from How Stuff Works.)

"When the bell flexes away, it pulls in on the surrounding air particles. This creates a drop in pressure, which pulls in more surrounding air particles, creating another drop in pressure, which pulls in particles even farther out. This pressure decrease is called rarefaction."

"In this way, a vibrating object sends a wave of pressure fluctuation through the atmosphere. We hear different sounds from different vibrating objects because of variations in the sound wave frequency. A higher wave frequency simply means that the air pressure fluctuation switches back and forth more quickly. We hear this as a higher pitch. When there are fewer fluctuations in a period of time, the pitch is lower. The level of air pressure in each fluctuation, the wave's amplitude, determines how loud the sound is." (From http://health.howstuffworks.com/hearing1.htm; used with permission.)

Compression is a slightly higher pressure than the surrounding air, rarefaction is slightly lower. The simplest sound would consist of what we would hear as a "pure tone," and would consist of a gentle smooth curve which would increase to a maximum level and then decrease to a minimum level and back again. If such a curve was graphed it would strongly resemble a sine wave. The pure tone is the sort of sound produced by a very simple physical oscillating device, like a tuning fork.

Review of sine waves:
For an introduction to the generation of the graphs of sine and cosine by 'wrapping' around a circle click here to go to our Circular Functions demo. Here we interested in the family of functions of the form

where

• |A| = amplitude, which is half the distance between the maximum and minimum values.

• The period is and is the smallest time t needed for the function to execute on complete oscillation or cycle.

• is called the phase shift and represents a horizontal shift of the sine curve by the amount .

As A, B, and f are varied the shape of the sine wave changes. To execute or download an Excel file that lets you vary each of these parameters click on the Excel screen shown in Figure 2.

Figure 2.

To see animations of varying the parameters, click one of the following: Amplitude animation, Period animation, Phase Shift animation.

Terminology:
The language of mathematics for describing sine waves and that used by acoustic engineers, physicists, and the speech and hearing sciences varies somewhat. This section provides connections for the terminologies used by these different groups.

• Frequency: The number of times something is repeated. In acoustics, it refers to the number of complete sound waves that pass a given point in a given time. Usually measured in Hertz (one cycle per second). Typically refers to the pitch of a sound, how high or low it is. The higher the number, the higher the pitch.

• Hertz: The unit of frequency, abbreviated Hz. The same as cycles per second. The measure of how long it takes one complete (sound) wave to pass by a given point.

• Pitch: We use the term pitch to be the same as (the fundamental) frequency. Its meaning can vary depending upon whether you are processing sound or working in psychoacoustics where it is taken to mean an auditory (subjective) attribute.

In acoustics an expression for a sine wave is often written in the form

where f is the frequency of the wave measured in Hertz. Comparing the mathematical form with this acoustical form we see that hence we have

Thus whether you specify the coefficient B in or the frequency f in the sound wave that is generated will be the same. To execute or download an Excel file that lets you experiment with the acoustics form of the sine wave equation click on the Excel screen shown in Figure 3.

 Figure 3.

Sounds from Sine Waves:
The upper and the lower limits of the audible frequency range for the human ear is about 20 to 20,000 Hz. The actual range for an individual depends on many factors such as the age of the listener and the physical environment. In this demo we will use "wave" files which are described as follows.

 "A Wave file is an audio file format, created by Microsoft, that has become a standard PC audio file format for everything from system and game sounds to CD-quality audio. A Wave file is identified by a file name extension of WAV (.wav). Used primarily in PCs, the Wave file format has been accepted as a viable interchange medium for other computer platforms, such as Macintosh. This allows content developers to freely move audio files between platforms for processing, for example." Source: http://searchsmb.techtarget.com/sDefinition/0,,sid44_gci213473,00.html

We will provide a set of wave files for common frequencies that can be used for demonstrations. In addition, we provide an interactive Excel program that can be used to create files or have your students create files. A MATLAB routine for creating wave files is also included with some suggestions for experiments.

The frequencies for musical notes for an equal-tempered scale can be found at http://www.phy.mtu.edu/~suits/notefreqs.html . Middle C (also called C4) has a frequency of about 261 Hz, G above Middle C (also called G4) has a frequency of about 392Hz, and C above middle C (also called C5) has a frequency of about 523Hz. In Figure 4 click on a note to hear a wave file corresponding to the sine wave equation displayed. As you listen to the wave files note the change in pitch of the notes.

Figure 4.

In Figure 5 are two notes of the same frequency. Click on the notes to listen to them. Which note has the has the larger frequency?

Figure 5.

Excel Activity:

and Excel to generate wave files for male, female, and children voice frequencies. Some experience entering equations, dragging to a create column of data, and playing a sound file will be helpful. Directions are included in a set of notes and in Comments imbedded within the Excel worksheet. Click here to access or save the Excel worksheet.

MATLAB Activity and Experiments:
MATLAB contains functions that can create, play, and save wave files. Wave sound files stored in  8-bit or 16-bit format that contain data with amplitude outside the range [-1, 1] are clipped prior to saving the file. Thus for simplicity, in this demo we will set the amplitude to 1 and we set the phase shift f to zero. The MATLAB function sine_tone.m which can be downloaded by clicking here can create and save wave files by specifying the frequency and file name. A brief description of the function follows.

function [t,y]=sine_tone(nfreq,fname)
%SINE_TONE A routine to generate pure tone using a sine wave with frequency nfreq.
%
%INPUT: nfreq = frequency of the tone
%           fname = a string with the filename; it can contain folder info
%
%OUTPUT: <> a graph with several cycles of the wave
%               <> a wave file containing the tone with name = fname
%                   default values of 8000 samples per second & 16 bits per sample
%               <> t is the array of time steps
%               <> y is the array of the sine wave
%
%NOTES: <> the time interval is 0 to 8 with steps of 1/8192
%             <> several warning messages may appear because of clipping the amplitude to
%                  be between -1 and 1 when saving the file; these can be ignored
%

To hear the wave file created by this function with frequency f = 50, click here.

For an activity or lab use function sine_tone.m to create wave files for male voices which start with a frequency of about 100Hz, females about 200Hz, and children about 300Hz, respectively.

Experiment 1. The function sine_tone.m can easliy be modified to create other sounds. The mathematical expression

is an example of a damped sine wave. It has a decreasing amplitude as shown in Figure 6. Click here to hear a corresponding wave file in which we set the frequency to f = 50.

 Figure 6.

Experiment 2. Another interesting sound is one in which there is an oscillation in the damping. Modify the sine_tone.m function using frequency f = 50 to generate a wave file that corresponds to the mathematical expression

whose graph appears in Figure 7.

 Figure 7.

Auxiliary Resources:

1. The physics of hearing at http://www.audioholics.com/techtips/audioprinciples/interconnects/PhysicsofHearing.html
contains an excellent discussion of general principles of sound waves.

2. For a nice discussion of the human hear go to http://health.howstuffworks.com/adam-200010.htm where there is a very nice narrated Flash animation.

3. See http://health.howstuffworks.com/hearing.htm for a brief discussion of the mechanical phenomenon within the ear that converts sounds to impulses that your brain can process. Another nice discussion on this theme is at http://hep.physics.indiana.edu/~rickv/Ear.html .

Acknowledgement: Portions of this demo are based on materials from http://www.indiana.edu/~acoustic/s319/proj105dkp.html which is a project that is part of Mathematical Foundations
of Speech and Hearing at Indiana University. A special thanks to Diane Kewley-Port, Professor of Speech and Hearing Sciences Professor of Cognitive Sciences, Indiana University, for permission to use the WaveWriter macro in the Excel activity described above.

## Credits

This demo was submitted by David R. Hill, Temple University and is included in Demos with Positive Impact with his permission.

Demos with Positive Impact