2.14. Exercises

Exercise 2.4.

Now you have seen the coswave.m program, you are advised to try it out in Octave. Suppose you call the output file cosine.dat. You won't be able to play the file cosine.dat, because it is a "raw" binary data file: it is not in any recognised audio file format. Fortunately, utilities are available in many operating systems for converting raw audio files to a variety of standard audio file formats. Using "Cool Edit 96" on a PC, for instance, I can follow the following steps to play the cosine.dat audio file:

1) Start Cool Edit 96: from the Start menu, select "Programs", then "Syntrillium", then "Cool Edit 96". Your configuration could be different.)
2) Pull down "File/Open..." and move to the right directory
3) At the bottom of the "Open a Waveform" window, in the "Files of type:" field, pull down type "All files (*.*)"
4)  Double click on the file cosine.dat.
5) Since cosine.dat is not in a recognised audio file format, a window pops up with the title "Interpret Sample Format As". Select the sample rate 8000, channels: mono, and resolution: 16-bit.
6) In the "Raw Data (no header)" window that now pops up, select "Data formatted as PCM, Intel (LSB,MSB)".
7) All being well, the cosine wave should now be displayed. Clicking on the "play" button causes it to be played over the sound card as a short audible bleep.

Exercise 2.5. Recording and displaying speech waveforms

As well as looking at and listening to cosine.dat, examine the speech wave joe.dat, a recording of a sentence containing many of the phonemes of English. What sampling rate was used in that recording? (Note that the resolution is 16 bits and the bytes are in the "Intel" byte ordering convention.)

Exercise 2.6.
In the lecture I stated that "215 is about 32,000". What is the exact value?

Exercise 2.7.

Modify the program's sampling rate, tone frequency and duration of the signal generated.