499hz creates waves, but anything above that appears to be blank. What gives?
At a frequency of half the sample rate you get two samples per cycle… One sample-point for the positive-half of the “waveform” and one sample-point for the bottom half of the “waveform”. (If that doesn’t make sense, [u]this tutorial[/u] explains how audio is digitized/sampled.)
Mathematically, the sine of zero-degrees is zero, and the sine of 180 degrees is also zero. If you try to generate a sine wave at one-half of the sample rate, ALL of your samples end-up at zero-degrees and 180 degrees* (where the wave passes-through the zero-crossing) and you’ll get a series of zero-value samples = DIGITAL SILENCE!
However, the cosine of zero degrees and 180 degrees is 1. If you generate a cosine wave at half the sample rate it, will work!
\
- To be more precise, all of the samples lie at multiples of 180 degrees (and all multiples of 180 degrees have a sine equal to zero). So, a sine wave has a value of zero (a zero-crossing) every 180 degrees.