In the example below, let's assume that f is 440 Hz (cycles per second), which is concert A. On a piano, this is the A above middle C:
- a factor of 1 results in the same frequency as f, because 1*f==f.
- a factor of 2 yields a frequency an octave higher than f.
For this example, we obtain 880 Hz, which is the A above high C on a piano:
- a factor of 4 yields a frequency two octaves higher than f.
Here we obtain 1760 Hz, an octave above the A above high C:
- a factor of 3 is between one and two octaves higher, and it turns out to be one octave plus a just (or, perfect) fifth above the pitch corresponding to f. Here we obtain the frequency 1320 Hz, which sounds like the E above high C.
The sound is slightly different than on a piano, where the pitches are not perfect but are instead evenly spaced apart from each other. The corresponding note on the piano has a frequency of 1318.51 Hz, slightly flatter than what we get by our frequency factor. - a factor of 0.75 (ratio of 3:4) yields a note that sounds like an E, but dividing by 4 lowers its pitch by two octaves. With f at concert A, a frequency factor of 3:4 yields a frequency of 330, whichsounds like the E above middle C:
Again, the pitch on a piano is slightly different; in this case it is slightly flatter at 329.63.
The first row is the fundamental frequency. The second is an octave higher, and is 3/4 as strong as the fundamental frequency. The third row specifies a pitch that is a fifth above the fundamental freqnecy, and quieter still at half the strength of the fundamental frequency.
Frequency Factor Relative Numerator Denominator Strength 1 1 1 2 1 0.75 3 2 0.50
The waveform that results from such an instrument specification is shown below in red, with the three frequency factors shown in black:
- The red solid waveform is literally the sum of the black dotted waveforms. The sound you produce is sampled from the red waveform, and that is the subject of this extension.
- The plot shown above is not the subject of this extension, but is shown to help explain how complex sounds are built from simple ones, as follows:
- The black waveform with the largest amplitude (the tallest black waveform) is the fundamental frequency at relative strength 1. The sample shown is for 1/440 of a second of a 440 Hz concert-A. This is sufficient ot show one full cycle of the fundamental frequency.
- The black waveform with the next largest amplitude has relative strength 0.75. It is an octave higher, so it oscillates twice in the timespan of the fundamental pitch's waveform.
- The black waveform of smallest amplitude (at half the strength of the fundamental frequency) is the 3:2 frequency factor, which sounds like a fifth above the fundamental frequency. As expected, it exhibits 1.5 cycles in the timespan of the fundamental pitch's waveform.
- The sound of the red waveform, which is what you will produce below, is similar to an oboe or a clarinet (in the opinion of my son).
The information about the frequency factors must be saved (in arrays) for future use.
The hz value is computed from concert A (440 Hz), taking the specified number of equally spaced chromatic steps above (or below) concert A.The relevant details, explained in the lecture slides for this module, are not necessary to complete this extension, but please ask if you would like clarification.
In place of that value, you must compute the sum of sine wave samples, one for each frequency factor, as follows:
When you done with this extension, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches
You will modify your program further in this extension to produce the sine-wave plots that depict how sine-wave addition occurs.
The details of this assignment are not completely specified so that you must think through what is needed to produce meaningful plots. Ask for help as needed!
Think about how many samples you need to capture to show one complete cycle at 440 Hz.One way to reason about this is to use the units of the various computations and multiply or divide them to obtain the property you seek.
When you done with this extension, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches
If you have added sound and pictures to your solution for Lab 4, demo those to a TA and receive points for this extension.
When you done with this extension, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches