How do you create a lookup table for a sine wave in Matlab?

How do you create a lookup table for a sine wave in Matlab?

  1. Create Lookup Tables for a Sine Function.
  2. Introduction.
  3. Set Function Parameters for the Lookup Table. Use errmax with Unrestricted Spacing. Use nptsmax with Unrestricted Spacing. Restricting the Spacing. Use errmax with Even Spacing.
  4. Specifying Both errmax and nptsmax.
  5. Comparison of Example Results.

What is sine lookup table?

The Sine-Cosine Lookup block implements sine and cosine functions using the specified position or phase input signal. The block uses the lookup table approach for optimized code-execution. You can specify the number of lookup table points in the Number of data points for lookup table parameter.

How do you find the frequency of a sine wave?

The equation of a basic sine function is f(x)=sinx. In this case b, the frequency, is equal to 1 which means one cycle occurs in 2π. If b=12, the period is 2π12 which means the period is 4π and the graph is stretched.

How to make a sine wave look up table?

This calculator generates a single cycle sine wave look up table. It’s useful for digital synthesis of sine waves.

How to look up sine of different frequencies?

Note: for higher quality output you can use linear interpolation between the LUT values at phase_i and phase_i + 1, but the above approach is good enough for most audio applications. With look up table approach one may wish to use the memory efficiently and store only the first quadrant of the sine wave.

What is the incremental distance of a sine wave?

So what is the incremental distance if we are using a 64 element look-up table instead of a sine function based on 2π? incremental distance = 2k*64/48k = 8/3. In this case increment represents a virtual phase increment or more directly a table index increment.

Is there a quadratic interpolation for sine wave?

If you have some DSP’s to spare, and want better than 16-bits of precision, a basic table lookup followed by a quadratic interpolation can often be done in less time for more accuracy without costing nearly as many LUTs as the equivalent CORDIC. Examples of all of these algorithms can be found in my github repository.