Type: Answers


Last Modified: February 13, 2006

How do I obtain the phase increment value for the numerically controlled oscillator (NCO) compiler?

Description

There are two ways to obtain the phase increment value for the NCO Compiler.

One method is to use the NCO Compiler MegaWizard® Plug-In Manager to approximate the phase increment value. On page 2 of the NCO Compiler MegaWizard Plug-In, you will find the Frequency Calculator. Enter the input clock period and the desired output frequency and click Calculate. The Frequency Calculator will display the approximate phase increment value in the MegaWizard interface.

The other method to obtain the phase increment value is to use the following equation:

     F(output_of_sinusoid) = [Phase_increment/(2N)] * F(clk)

     where:

     F(output_of_sinusoid) = Desired output frequency of the NCO Compiler,
     N = Accumulator bit width, and
     F(clk) = Input clock frequency

When selecting which method to use, you should note that the Frequency Calculator in the MegaWizard Plug-In Manager can introduce rounding errors when calculating the phase increment value. Therefore, Altera recommends that you use the equation method of calculating the phase increment value for better accuracy.

Find more KDB articles