Note: This page has been translated by MathWorks. Please click here

To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Generate real or complex sinusoidal signals—optimized for HDL code generation

**Library:**DSP System Toolbox / Signal Operations

DSP System Toolbox / Sources

DSP System Toolbox HDL Support / Signal Operations

DSP System Toolbox HDL Support / Sources

The NCO HDL Optimized block generates real or complex sinusoidal signals, while providing hardware-friendly control signals. It uses the same phase accumulation and lookup table technology as implemented in the NCO block. It provides the following features:

A lookup table compression option to reduce the lookup table size with less than one LSB loss in precision. See Lookup Table Algorithm for more detail.

An option to synthesize the lookup table to a ROM when using HDL Coder™ with an FPGA target. To enable this feature, right-click the block, select

**HDL Code > HDL Block Properties**and set**LUTRegisterResetType**to`none`

.An optional input port for external dither.

An optional reset port that triggers a reset of the phase to its initial value during the sinusoid output generation.

An optional output port for the current NCO phase.

Given a desired output frequency *F*_{0},
calculate the *phase_increment* input value using

$$phaseincrement=(\frac{{F}_{0}\cdot {2}^{N}}{{F}_{s}})$$

$${F}_{s}=\frac{1}{{T}_{s}}=\frac{1}{sampletime}$$

The frequency resolution of an NCO is defined by

$$\Delta f=\frac{1}{{T}_{s}\cdot {2}^{N}}\text{Hz}$$

Given a desired phase offset (in radians), calculate the
*phase_offset* input value using

$$phaseoffset=\frac{{2}^{N}\cdot desiredphaseoffset}{2\pi}$$

This block appears in the

**Sources**libraries with**Phase increment source**parameter set to`Property`

. The only input port is**validIn**.This block appears in the

**Signal Operations**libraries with**Phase increment source**parameter set to`Input port`

. This configuration shows the optional input port**inc**.

This icon shows all the possible ports of the NCO HDL Optimized block.

Was this topic helpful?