Project 1 Spring 2009
Generate and Play Digital Sine Waves

Download PROJ1TEMP.xls from CD
A. Introduction:

For this project you are provided with an Excel spreadsheet in the file PROJ1TEMP.xls.  This spreadsheet will serve as a template for your project.  To obtain the Excel template, you must copy or download the file to your computer from the courseware CDrom.  See Resources|Excel Hints|Microsoft Excel Assignment Hints|Download Instructions for help downloading. 

Once you download this file, you can modify the spreadsheet as required in the steps outlined below. You then must turn in the completed Excel file by uploading the file to your Oncourse DropBox.   Be sure to name the file according to the naming convention specified as "proj1dkp", .doc or .xls that includes your initials.  Files with improper names cannot be easily matched to their owners. You will also turn in a written project report following the Guidelines for Writing Project Reports and the steps/questions below. This report should both be printed out for grading, and uploaded to your DropBox.

The file PROJ1TEMP.xls contains a sine wave, its graph, and the tools necessary to save sine waves as sound files within the Excel spreadsheet.  As detailed below, your assignment is to:

  • Produce two additional sine waves
  • Convert them to sound, play the sounds, and listen to them
  • Graph each sine wave (using about 100 points per graph)

B. Background (see also Sections 1.1 - 1.5)

The equation for a sine wave may be written as:

s(t) = A · sin ( 2 · p · f · t + D )   

for continuous time, t, or

s(n) = A · sin ( 2 ·p · f · n/Fs + D

for discrete samples, n, or

s(n) = A · sin ( 2 · pi · f · n · delta.gift + phi

for discrete samples, n.

where

A is the amplitude of the sinusoid
f is the frequency of the sinusoid in Hz
n is one of the N samples, N = {1,2..n}
Fs is the sample frequency in samples/second or Hz (e.g., Fs = 11025 Hz)
t is the sample period in seconds (1/Fs)
D is the starting phase in radians
t = n /Fs


C.  Follow the steps below and the Guidelines for Writing Project Reports to complete Project 1.

  1. Download the Excel template PROJ1TEMP.xls and save the file on your local system or network drive. Be sure to change the file name according to the naming convention specified in the DropBox instructions. PROJ1TEMP.XLS has a "Macro" in it. In the STC cluster, "Enable Macros" by clicking on the Security bar when the spreadsheet first opens. Otherwise, follow the instructions on our Weekly Schedule for Macros.
  2. The PROJ1TEMP.xls Excel template contains a 256-Hz sine wave that matches the specifications given in row 2 of the following table.  Follow the format of that 256-Hz sine wave to create two new sine waves in the template with the values given in the third and fourth rows of the table below.

      Frequency Amplitude Phase
    S1(n)* f1 = 256 Hz (~ middle C) A1 = 24000 D 1 = 0
    S2(n) f2 = 512 Hz (~ C above middle C) A2 = 22000 D2 = 0
    S3(n) f3 = 384 Hz (~ Gabove middle C) A3 = 16000 D3 = pi;  **

    * Provided in PROJ1TEMP.xls template.
    ** p is expressed as "pi()" in Excel.

  3. Create an Excel chart (graph) of the two new sine waves (amplitude on the y axis and sample number on the x axis).  Be sure to graph enough samples to produce several cycles of the sinewave.  
  4. Create sound files and speaker symbols for each new sine wave and label them.  First, notice the speaker symbol near the top of the column with the 256-Hz sine wave.  Double click on that speaker, and listen to the very short sine wave.  Do this repeatedly to get a good sense of what it sounds like.  
  5. To produce and listen to sound in Excel, we need to follow the current conventions for digital audio using the PC computer platform. These conventions closely follow the standards developed for compact disc (CDs) recordings.  The three most important conventions we must adhere to are: (a) the use of the ".wav" file format, (b) the use of a sampling frequency of Fs = 11025 Hz, and (c) the restriction that our sound's amplitude must range between -32767 and 32768.  
  6. Create sound files for the two new sine waves and embed them in your Excel Workbook.  First, highlight the range of values that represents your "sound," and then run the macro "WaveWriter" by clicking on the icon so named.  Refer to the instructions for using the WaveWriter macro in the Excel spreadsheet or supplemental  instructions given in the Instructions for Using the WaveWriter Macro in Excel 97 and 2000 link of the "Resources" section of this text.

    THIS IS THE ONLY RESULTS QUESTION FOR THE REPORT: Explain the differences in loudness, pitch, etc., that you hear among the three sounds.  

  7. Next to the column of sample numbers, create a column of numbers that represents time in seconds given the sampling rate of Fs = 11025 Hz.  Graph at least one of the new sine waves using time on the x axis rather than sample points.
  8. For your Project 1 report, please read Guidelines for Writing Project Reports.  Since the first project is brief relative to later projects, the anticipated length of your report is 1.5 pages plus printed copies of each of your graphs.  Please type the report and turn in a printed copy.  Any equations may be written by hand.  For this report, section IV (see Guidelines) will be short and will not be weighted heavily in the grade.

    a. Turn in the printed report and associated graphs.
    b. Upload your Excel and .doc file to your Drop Box on Oncourse using file names with your initials.