Why would you want to create a sine wave?
Creating a sine wave is useful for a number of things.
How hard is it?
Sine waves are about the easiest waveform to create other than square waves.
What are the steps?
There are really only three things you need to know in order to create a sine wave:
The frequency
the sample rate
the level
For our example, let’s create a 100Hz sine wave using CD quality encoding (16 bit, 44.1kHz sampling rate).
A sine wave use the Sin() function to determine the frequency. From trigonometry, we know that the period of a sine wave is 360 degrees. That is, a sine wave completes an entire revolution in 360 degrees. In radians, that’s 2 * Pi.
Sin() varies from -1 to 1. We also know that the maximum value of a 16 bit recording is 32,767 and the minimum value is -32,768.
So, basically, we simply follow a sine wave, pull out t