GE100 -- Lab 1: Excel Spreadsheets

-->Quiz 1
->Lab 1
-->Lab 2
-->Lab 3
-->Lab 4
-->Lab 5
-->Lab 6
-->Lab 7
->Electronic Submission
->Old Exams
->Tentative Schedule
->Support Forum
->Course Policies


Generating Sound Files in Excel and C++
Fall 2002


This webpage outlines how to generate simple sounds on a computer.


Prior to lab you should read through this assignment and download the following two files to your computer:


In groups of two you will:

  1. Generate sound data representing simple notes using Microsoft Excel.
  2. Convert the data to a .wav file.
  3. Experiment with different waveforms and perhaps even write a song.

Your speaker volume should never exceed a quarter of full volume.

Sound waves

A musical note is represented by a sine wave at a specific frequency. The table below gives the frequencies of different notes.

Note Frequency (Hz)
A 220
A# 233
B 247
C 262
C# 277
D 294
D# 311
E 330
F 349
F# 370
G 392
G# 415

Doubling the frequency gives you the same note one octave higher while halving the frequency gives you the same note one octave lower.


I have created a sample spreadsheet that can be used for generating sound data. The first column of the sine sheet contains a series of increasing, uniformly spaced numbers. They represent time information. The second column contains numbers that represent a sinusoid. (Select B1 through B45, click on the "chart wizard" icon (looks like a bar graph), select line for the "Chart type" and click on the "Finish" button. A plot of the selected data should appear... and it should look like the dark blue sine wave in the figure below.)

Sound Waveforms

In order to listen to the sound generated by this data you will need to:

  1. Save the file (you pick the name, but use the CSV (Comma delimited) format:
    In Excel: File -> Save As, select "CSV (Comma delimited)" for the "Save as type", enter a filename, and click on the "Save" button.
  2. Convert the .csv file to a .wav file:
    Download the csv2wav.exe program and drag and drop your .csv file onto the csv2wav.exe icon. This should generate a .wav with the same file name (except for the different extension).
  3. Play the file (double click on the file icon)

You may create other sounds by changing the numbers in the second column. The easiest way to do this is to:

  1. Change the equation B1. Click on the B1 cell and you should see the following equation in the "formula bar": =COS(PI()*2*262*A1). This generates the note C. You may change this equation by modifying the formula bar. Once this is done, hit enter.
  2. You will then need to copy this change to all of the other cells in column B. This can be done by going to the bottom right corner of cell B1 (B1 should be selected). This should cause the pointer arrow to turn into the plus symbol. Click and hold the mouse button down as you drag the cursor down until all of the filled cells in column B are selected. When you release the mouse button, the equation in B1 will be copied to all of the selected cells.

You can now follow the steps above to listen to this sound.

You should generate square (use the sqr worksheet), triangle (use the tri worksheet), and sawtooth (use the saw worksheet) square (use the sqr worksheet), waves (see the figure above) instead of the sine wave. Warning: I have not explained how to generate the other waveforms... you may have to think about it. Experiment with different frequencies. Compare the sounds from the various waveforms (all at the same frequency).

Lab report (due 11:00pm, the day prior to week 2 lab)

Your lab report should be an independent document. That means that someone should be able to understand what you did and why without seeing anything other than your report. Your report should include:

  • Executive summary
  • Objectives
  • Procedure
  • Activity log indicating how much time you spent on the assignment (following the template provided in the lab1.xml template document).
  • Results
  • Discussion: theory, results, practical application, personal views and/or questions, improvements
  • Conclusion

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

© 2002 Dr. Christopher C. Taylor Office: CC-27C Phone: 277-7339 Last Updated: Tue Sep 10 15:49:06 2002
I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to.