Digital Sound & Music: Concepts, Applications, & Science, Chapter 2, last updated 6/25/2013

31

Figure 2.32 440 Hz sine wave

Then with

fplot('sin(262*2*pi*t)', [0, 0.05, -1.5, 1.5], 'red');

hold on

we get this figure:

Figure 2.33 Two sine waves plotted on same graph

The 262 Hz sine wave in the graph is red to differentiate it from the blue 440 Hz wave.

The last parameter in the fplot function causes the graph to be plotted in red. Changing the color

or line width also can be done by choosing Edit/Figure Properties on the figure, selecting the sine

wave, and changing its properties.

We also can add sine waves to create more complex waves, as we did using Adobe

Audition in Section 2.2.2. This is a simple matter of adding the functions and graphing the sum,

as shown below.

figure

fplot('sin(262*2*pi*t)+sin(440*2*pi*t)', [0, 0.05, -2.5, 2.5]);

First, we type figure to open a new empty figure (so that our new graph is not overlaid on the

currently open figure). We then graph the sum of the sine waves for the notes C and A. The

result is this:

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

-1.5

-1

-0.5

0

0.5

1

1.5

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

-1.5

-1

-0.5

0

0.5

1

1.5