title: How to look up sine of different frequencies from a fixed sized lookup table?
body: <p>I am sampling a sine wave at 48 kHz, the frequency range of my sine wave can vary from 0 to 20000 Hz with a step of about 100 Hz. I am using a lookup table approach. So I generate 4096 samples for a sine wave for 4096 different phases. I think the general idea behind this to increment the step size and use different step sizes for different frequncy. So I do the following (pseudo code). But I am not sure how the step size is going to be related to the frequency I want to generate the samples of the sine wave of? For example if my frequency is 15000 Hz what would be the step size that I have to traverse? Is my sample size (4096) too low for this? </p>
  
  <pre><code> // Pseudocode
   uint16_t audio_sample[4096] = {...};
   NSTEP = freq; //???How is the step size going to be related to the freq here
  
   for(int i = 0; i &lt; 4096; i = i+NSTEP)
   {
       sine_f(i) = audio_sample[i];
   }
  </code></pre>
  
  <p>Thanks in advance.</p>