13.32. A QUADRATURE
OSCILLATOR
Here we present a wellbehaved digital
quadrature oscillator, whose output is y_{i}(n) + jy_{q}(n), having the structure shown in Figure 1379(a). If you're
new to digital oscillators, that structure looks a little
complicated but it's really not so bad. If you look carefully, you
see the computations are
Figure 1379. Quadrature oscillators:
(a) standard structure; (b) structure with AGC.
and
Equation 13134'
Those computations are merely the rectangular
form of multiplying the previous complex output by a complex
exponential e^{j}^{q} as
Equation 13135
So the theory of operation is simple. Each new
complex output sample is the previous output sample rotated by
q radians, where q is 2pf_{t}/f_{s} with f_{t} and f_{s} being the oscillator
tuning frequency and the sample rate, respectively, in Hz.
To start the oscillator, we set the initial
conditions of y_{i}(n–1) = 1 and y_{q}(n–1) = 0 and repeatedly compute new
outputs, as time index n advances,
using Eq. (13134). This
oscillator is called a coupled quadrature
oscillator because the both of its previous outputs are used
to compute each new inphase and each new quadrature output. It's a
useful oscillator because the full range of tuning frequencies are
available (from nearly zero Hz up to roughly f_{s}/2), and its outputs are
equal in amplitude unlike some other quadrature oscillator
structures[77].
The tough part, however, is making this oscillator stable in
fixedpoint arithmetic implementations.
Depending on the binary word widths, and the
value q, the output amplitudes can
either grow or decay as time increases because it's not possible to
represent e^{j}^{q} having a magnitude of exactly one,
over the full range of q, using
fixedpoint number formats. The solution to amplitude variations is
to compute and
and
multiply those samples by an instantaneous gain factor G(n) as shown in Figure 1379(b). The trick here is how to
compute the gain samples G(n).
We can use a linear automatic gain control (AGC)
method, described in Section 1330, as shown in Figure 1380(a) where a is a small value, say, a = 0.01. The value R is the desired rms value of the
oscillator outputs. This AGC method greatly enhances the stability
of our oscillator. However, there's a computationally simpler AGC
scheme for our oscillator that can be developed using the Taylor series approximation we learned
in school. Here's how.
Figure 1380. AGC schemes: (a) linear
AGC; (b) simplified AGC.
Using an approach similar to Reference [78],
we can define the desired gain as
Equation 13136
This is the desired output signal magnitude
M_{des} over the actual
output magnitude M_{act}.
We can also represent the gain using power as
Equation 13137
where the constant P_{des} is the desired output
signal power and P_{act}
is the actual output power. The right side of Eq. (13137) shows P_{act} replaced by the desired
power P_{des} plus an
error component E, and that's the
ratio we'll compute. To avoid square root computations and, because
the error E will be small, we'll
approximate that ratio with a twoterm Taylor series expansion
about E = 0 using
Equation 13138
Computing the Taylor series' coefficients to be
a_{0} = 1 and a_{1} = –1/2P_{des}, and recalling that
E = P_{act}–P_{des}, we estimate the
instantaneous gain as
Equation 13139
If we let the quadrature output peak amplitudes
equal 1/ , P_{des} equals 1/2 and we
eliminate the division in Eq.
(13139) obtaining
Equation 13140
The simplified structure of the G(n)
computation is shown in Figure
1380(b).
As for practical issues, to avoid gain values
greater than one (for those fixedpoint fractional number systems
that don't allow numbers 1), we use the clever recommendation from Reference
[77]
of multiplying by G(n)/2 and doubling the products in Figure 1379(b). Reference
[78]
recommends using rounding, instead of truncation, for all
intermediate computations to improve output spectral purity.
Rounding also provides a slight improvement in tuning frequency
control. Because this oscillator is guaranteed stable, and can be
dynamically tuned, it's definitely worth considering for
realvalued as well as quadrature oscillator applications[77].
