A numerically-controlled oscillator (NCO) is a digital
signal generator
A signal generator is one of a class of electronic devices that generates electrical signals with set properties of amplitude, frequency, and wave shape. These generated signals are used as a stimulus for electronic measurements, typically used i ...
which creates a
synchronous
Synchronization is the coordination of events to operate a system in unison. For example, the conductor of an orchestra keeps the orchestra synchronized or ''in time''. Systems that operate with all parts in synchrony are said to be synchronou ...
(i.e. clocked), discrete-time, discrete-valued representation of a
waveform
In electronics, acoustics, and related fields, the waveform of a signal is the shape of its graph as a function of time, independent of its time and magnitude scales and of any displacement in time.David Crecraft, David Gorham, ''Electronic ...
, usually
sinusoidal
A sine wave, sinusoidal wave, or just sinusoid is a mathematical curve defined in terms of the '' sine'' trigonometric function, of which it is the graph. It is a type of continuous wave and also a smooth periodic function. It occurs often in m ...
.
NCOs are often used in conjunction with a
digital-to-analog converter
In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse function.
There are several DAC architec ...
(DAC) at the output to create a
direct digital synthesizer
Direct digital synthesis (DDS) is a method employed by frequency synthesizers used for creating arbitrary waveforms from a single, fixed-frequency reference clock. DDS is used in applications such as signal generation, local oscillators in communi ...
(DDS).
Numerically-controlled oscillators offer several advantages over other types of oscillators in terms of agility, accuracy, stability and reliability.
NCOs are used in many communications systems including digital up/down converters used in 3G wireless and software radio systems, digital
phase-locked loop
A phase-locked loop or phase lock loop (PLL) is a control system that generates an output signal whose phase is related to the phase of an input signal. There are several different types; the simplest is an electronic circuit consisting of a ...
s, radar systems, drivers for optical or acoustic transmissions, and multilevel
FSK FSK may refer to:
* FSK (band), a German band
* Federal Counterintelligence Service, (Russian ') of Russia
* Fiskerton railway station, in England
* Forskolin, a diterpene
* Forsvarets Spesialkommando, a Norwegian special forces unit
* Fort Scott M ...
/
PSK modulators/demodulators.
Operation
An NCO generally consists of two parts:
*A ''phase accumulator'' (PA), which adds to the value held at its output a frequency control value at each clock sample.
*A ''phase-to-amplitude converter'' (PAC), which uses the phase accumulator output word (phase word) usually as an index into a waveform
look-up table
In computer science, a lookup table (LUT) is an array that replaces runtime computation with a simpler array indexing operation. The process is termed as "direct addressing" and LUTs differ from hash tables in a way that, to retrieve a value v wi ...
(LUT) to provide a corresponding amplitude sample. Sometimes
interpolation
In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points.
In engineering and science, one often has a n ...
is used with the look-up table to provide better accuracy and reduce phase error noise. Other methods of converting phase to amplitude, including mathematical algorithms such as
power series
In mathematics, a power series (in one variable) is an infinite series of the form
\sum_^\infty a_n \left(x - c\right)^n = a_0 + a_1 (x - c) + a_2 (x - c)^2 + \dots
where ''an'' represents the coefficient of the ''n''th term and ''c'' is a const ...
can be used, particularly in a software NCO.
When clocked, the phase accumulator (PA) creates a
modulo
In computing, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another (called the '' modulus'' of the operation).
Given two positive numbers and , modulo (often abbreviated as ) is t ...
-2
N sawtooth wave
The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is so named based on its resemblance to the teeth of a plain-toothed saw with a zero rake angle. A single sawtooth, or an intermittently triggered sawtooth, is called a ...
form which is then converted by the phase-to-amplitude converter (PAC) to a sampled sinusoid, where N is the number of bits carried in the phase accumulator. N sets the NCO frequency resolution and is normally much larger than the number of bits defining the memory space of the PAC
look-up table
In computer science, a lookup table (LUT) is an array that replaces runtime computation with a simpler array indexing operation. The process is termed as "direct addressing" and LUTs differ from hash tables in a way that, to retrieve a value v wi ...
. If the PAC capacity is 2
M, the PA output word must be truncated to M bits as shown in Figure 1. However, the truncated bits can be used for interpolation. The truncation of the phase output word does not affect the frequency accuracy but produces a time-varying periodic phase error which is a primary source of spurious products. Another spurious product generation mechanism is finite word length effects of the PAC output (amplitude) word.
The frequency accuracy relative to the clock frequency is limited only by the precision of the arithmetic used to compute the phase.
NCOs are phase- and frequency-agile, and can be trivially modified to produce a
phase-modulated or
frequency-modulated
Frequency modulation (FM) is the encoding of information in a carrier wave by varying the instantaneous frequency of the wave. The technology is used in telecommunications, radio broadcasting, signal processing, and computing.
In analog freque ...
output by summation at the appropriate node, or provide
quadrature outputs as shown in the figure.
Phase accumulator
A binary phase accumulator consists of an N-bit binary
adder and a
register
Register or registration may refer to:
Arts entertainment, and media Music
* Register (music), the relative "height" or range of a note, melody, part, instrument, etc.
* ''Register'', a 2017 album by Travis Miller
* Registration (organ), th ...
configured as shown in Figure 1.
Each clock cycle produces a new N-bit output consisting of the previous output obtained from the register summed with the frequency control word (FCW) which is constant for a given output frequency. The resulting output waveform is a staircase with step size
, the integer value of the FCW.
In some configurations, the phase output is taken from the output of the register which introduces a one clock cycle
latency but allows the adder to operate at a higher clock rate.
The adder is designed to overflow when the sum of the
absolute value
In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), an ...
of its operands exceeds its capacity (2
N−1). The overflow bit is discarded so the output word width is always equal to its input word width. The remainder
, called the residual, is stored in the register and the cycle repeats, starting this time from
(see figure 2).
Since a phase accumulator is a
finite state machine
A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number o ...
, eventually the residual at some sample K must return to the initial value
. The interval K is referred to as the grand repetition rate (GRR) given by
:
where GCD is the
greatest common divisor
In mathematics, the greatest common divisor (GCD) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers ''x'', ''y'', the greatest common divisor of ''x'' and ''y'' is ...
function. The GRR represents the true periodicity for a given
which for a high resolution NCO can be very long.
Usually we are more interested in the ''operating frequency'' determined by the average overflow rate, given by
:
(1)
The ''frequency resolution'', defined as the smallest possible incremental change in frequency, is given by
:
(2)
Equation (1) shows that the phase accumulator can be thought of as a programmable non-integer
frequency divider
A frequency divider, also called a clock divider or scaler or prescaler, is a circuit that takes an input signal of a frequency, f_, and generates an output signal of a frequency:
:
f_ = \frac
where n is an integer. Phase-locked loop frequency ...
of divide ratio
.
Phase-to-amplitude converter
The phase-amplitude converter creates the sample-domain waveform from the truncated phase output word received from the PA. The PAC can be a simple
read only memory
Read-only memory (ROM) is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device. Read-only memory is useful for storing sof ...
containing 2
M contiguous samples of the desired output waveform which typically is a sinusoid. Often though, various tricks are employed to reduce the amount of memory required. This include various trigonometric expansions, trigonometric approximations
and methods which take advantage of the quadrature symmetry exhibited by sinusoids.
Alternatively, the PAC may consist of
random access memory
Random-access memory (RAM; ) is a form of computer memory that can be read and changed in any order, typically used to store working Data (computing), data and machine code. A Random access, random-access memory device allows data items to b ...
which can be filled as desired to create an
arbitrary waveform generator
An arbitrary waveform generator (AWG) is a piece of electronic test equipment used to generate electrical waveforms. These waveforms can be either repetitive or single-shot (once only) in which case some kind of triggering source is required (i ...
.
Spurious products
Spurious
Spurious may refer to:
* Spurious relationship in statistics
* Spurious emission or spurious tone in radio engineering
* Spurious key in cryptography
* Spurious interrupt in computing
* Spurious wakeup in computing
* ''Spurious'', a 2011 novel ...
products are the result of
harmonic
A harmonic is a wave with a frequency that is a positive integer multiple of the ''fundamental frequency'', the frequency of the original periodic signal, such as a sinusoidal wave. The original signal is also called the ''1st harmonic'', the ...
or non-harmonic
distortion
In signal processing, distortion is the alteration of the original shape (or other characteristic) of a signal. In communications and electronics it means the alteration of the waveform of an information-bearing signal, such as an audio signal ...
in the creation of the output waveform due to non-linear numerical effects in the signal processing chain. Only numerical errors are covered here. For other distortion mechanisms created in the
digital-to-analog converter
In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse function.
There are several DAC architec ...
see the corresponding section in the
direct-digital synthesizer article.
Phase truncation spurs
The number of phase accumulator bits of an NCO (N) is usually between 16 and 64. If the PA output word were used directly to index the PAC look-up table an untenably high storage capacity in the ROM would be required. As such, the PA output word must be truncated to span a reasonable memory space. Truncation of the phase word causes
phase modulation
Phase modulation (PM) is a modulation pattern for conditioning communication signals for transmission. It encodes a message signal as variations in the instantaneous phase of a carrier wave. Phase modulation is one of the two principal forms ...
of the output sinusoid which introduces non-harmonic
distortion
In signal processing, distortion is the alteration of the original shape (or other characteristic) of a signal. In communications and electronics it means the alteration of the waveform of an information-bearing signal, such as an audio signal ...
in proportion to the number of bits truncated. The number of spurious products created by this distortion is given by:
:
(3)
where W is the number of bits truncated.
In calculating the
spurious-free dynamic range Spurious-free dynamic range (SFDR) is the strength ratio of the fundamental signal to the strongest spurious signal in the output. It
is also defined as a measure used to specify analog-to-digital and digital-to-analog converters (ADCs and DACs, res ...
, we are interested in the spurious product with the largest amplitude relative to the carrier output level given by:
:
where P is the size of the phase-to-amplitude converter's lookup table in bits, i.e., M in Figure 1. For W >4,
:
Another related spurious generation method is the slight modulation due to the GRR outlined above. The amplitude of these spurs is low for large N and their frequency is generally too low to be detectable but they may cause issues for some applications.
One way to reduce the truncation in the address lookup is to have several smaller lookup tables in parallel and use the upper bits to index into the tables and the lower bits to weigh them for linear or quadratic interpolation. Ie use a 24-bit phase accumulator to look up into two 16-bit LUTS. Address into the truncated 16 MSBs, and that plus 1. Linearly interpolate using the 8 LSBs as weights. (One could instead use 3 LUTs instead and quadratically interpolate). This can result in decreased distortion for the same amount of memory at the cost of some multipliers.
Amplitude truncation spurs
Another source of spurious products is the amplitude
quantization of the sampled waveform contained in the PAC look up table(s). If the number of DAC bits is P, the
AM spur level is approximately equal to −6.02 P − 1.76
dBc
dBc (decibels relative to the carrier) is the power ratio of a signal to a carrier signal, expressed in decibels. For example, phase noise is expressed in dBc/ Hz at a given frequency offset from the carrier. dBc can also be used as a measurement o ...
.
Mitigation techniques
Phase truncation spurs can be reduced substantially by the introduction of
white gaussian noise prior to truncation. The so-called
dither
Dither is an intentionally applied form of image noise, noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and digital vide ...
noise is summed into the lower W+1 bits of the PA output word to linearize the truncation operation. Often the improvement can be achieved without penalty because the DAC noise floor tends to dominate system performance. Amplitude truncation spurs can not be mitigated in this fashion. Introduction of noise into the static values held in the PAC ROMs would not eliminate the cyclicality of the truncation error terms and thus would not achieve the desired effect.
See also
*
Digital-to-analog converter
In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse function.
There are several DAC architec ...
(DAC)
*
Digitally controlled oscillator
A digitally controlled oscillator or DCO is used in synthesizers, microcontrollers, and software-defined radios. The name is analogous with "voltage-controlled oscillator." DCOs were designed to overcome the tuning stability limitations of early ...
(DCO)
*
Direct digital synthesis
Direct digital synthesis (DDS) is a method employed by frequency synthesizers used for creating arbitrary waveforms from a single, fixed-frequency reference clock. DDS is used in applications such as signal generation, local oscillators in communic ...
(DDS)
References
{{DEFAULTSORT:Numerically-controlled oscillator
Digital signal processing
Synthesizers
Electronic oscillators
Digital electronics