You are on page 1of 9

Clay S.

Turner

Recursive Discrete-Time
Sinusoidal Oscillators

E very few years an arti-


cle emerges that pres-
ents a method for
generating sinusoidal
functions with a digi-
tal signal processor (DSP). While
each oscillator structure has been de-
veloped pretty much on its own, a
ence of angles formula written
explicitly in recursive form is

cos(ϕ + θ) = 2 cos(θ) cos(ϕ)


− cos(ϕ − θ).

We will refer to this as the “biquad”


form. This is also called the “direct
(1)
of θf s /2 π where f s is the sample rate.
Just like the biquad form, the coupled
form requires the use of two past val-
ues. This turns out to be the case for all
sinusoidal oscillators that are limited to
the use of real numbers.

Matrix Derivation of
simple overlying theory has not been form” implementation. If the value θ
is viewed as a step angle, then we can
Oscillator Properties
presented that unifies all of the vari-
ous oscillator structures and can easily immediately see how this formula can Now we desire to find a general
allow one to look for other potential be used to calculate the next sample of enough process that can be used to ex-
oscillator structures. We can find a sinusoid given two known samples press both the biquad and the coupled
spaced θ apart and a step factor which form equations. First we will denote
some guidance for our quest by first
is just 2 cos(θ). To see how this can be the two past values (these are actually
examining classical oscillators.
used for iterative generation of a sinu- called state variables) as x1 and x 2
The German physicist Heinrich
soid, just view the formula as follows: and their “hatted” versions as the new
Barkhausen, during the early 1900s, values. Plus we notice that the update
formulated the necessary require- NextCos = 2 cos(θ) equations are linear for both forms, so
ments for oscillation. He modeled an we can write them in terms of matrix
× CurrentCos − LastCos.
oscillator as an amplifier with its out- multiplication.
put fed back to its input via a (2)
The matrix form of the update iter-
phase-shifting network. From this ation for the biquad is
model, he deduced and stated two Instead of using a single equation
necessary conditions for oscillation. for a recurrence relation, a pair of trig-
onometric formulas may be used. An  x$ 1  2 cos(θ) −1  x1 
The Barkhausen criteria, as they are  x$  =  1 .
example that can be used to recur-  2 0   x 2 
now known, require the total loop (4)
sively generate sinusoids is
gain to be equal to one and the total
loop phase shift needs to be a multiple Likewise the coupled form’s up-
cos(ϕ + θ) = cos(ϕ) cos(θ)
of 2π radians. So, if we are to unify date iteration is written as
− sin(ϕ)sin(θ)
discrete-time oscillator designs into a
single theory, we need to find the dis- sin(ϕ + θ) = cos(ϕ)sin(θ)  x$ 1   cos(θ) sin(θ)   x1 
crete-time equivalent of the + sin(ϕ) cos(θ).  x$  =  − sin(θ) cos(θ)  x .
(3)  2 2 (5)
Barkhausen criteria and use it to de-
velop our theory. We will refer to this as the “coupled” The interpretation of the matrix it-
But first, we will look at how some form. The coupling is evident in that eration is that the column vector on
very old trigonometric formulas, each equation uses not only its past the right-hand side contains the old
viewed in a not so usual way, can be value but also the past value produced state values, and when they are multi-
utilized for sinusoidal generation. by the other equation. Again θ is used plied by the rotation matrix, you get a
Several oscillators have been designed as the step angle per iteration, and this new set of state values. Then for the
via this approach. A sum and differ- leads to an oscillator output frequency next iteration the “new values” from

MAY 2003 IEEE SIGNAL PROCESSING MAGAZINE 103


1053-5888/03/$17.00©2003IEEE
the last iteration are used as the “old The first constraint says the deter- multiplying by one. An analogous
values” for the next iteration. Thus minant of the rotation matrix must be question in matrix theory is “Is there a
each iteration is just performed by a one. This is analogous to saying the vector x that, when multiplied by a
matrix multiplication times the state loop gain is unity. The second matrix A, results in a scalar multiple,
variables. While the idea of matrix constraint (assuming the first con- λ, of the original vector?” Mathemati-
math may seem to unnecessarily com- straint is met) says the matrix has cally this is written as
plicate things, it actually allows us to complex eigenvalues. This means the
go and find new types of oscillators. oscillator output will eventually re- Ax = λx. (10)
The term rotation is used since the peat. This is a discrete-time equivalent
matrix multiplication can be viewed to Barkhausen’s criterion for periodic- When this is satisfied, λ is an
from a special vantage point as doing ity. While not obvious, it can be eigenvalue and x is its corresponding
a rotation. This special vantage point shown from these two constraints that eigenvector of the matrix A. For our 2
will be explained in more detail later. both matrix elements, b and c, must be × 2 matrices that obey the Barkhausen
A general form that fits both of these nonzero; thus the rotation matrix can’t criteria, there will be two eigenvalues;
aforementioned oscillators is the use be triangular. What we have done here in fact they are complex conjugates of
of a 2 × 2 rotation matrix and two is basically come up with a set of rules each other, and each has a magnitude
state variables. So a general oscillator that can be easily applied to any 2 × 2 of one. For the rest of this article, the
iteration is written as matrix to see if it can be used to make rotation matrix, A, is assumed to be a
an oscillator. And soon we will come 2 × 2 matrix consisting of four real
 x$ 1   a b   x1  up with more rules that will allow you valued elements, and it obeys the
 x$  =  c .
 2  d  x 2  (6)
to identify the type of oscillator just by aforementioned Barkhausen criteria.
looking at its matrix. Explicitly matrix A is
Now we will make a brief sojourn
We will now look at a numerical a b
into eigenvalues and eigenvectors. A=  .
example of an oscillator iteration. (It
“Eigen” comes from German mean- c d (11)
is neither the biquad nor the coupled
ing characteristic. The reason we need
form mentioned earlier.) We will use
to make this side trip is that this the- If we let the vector x contain the
 095
. −1  ory will allow us to perform an adroit initial state values, the nth output,
  factoring of the rotation matrix. And y(n)of the oscillator can be written as
00975
. 095
.  (7) this will allow us to ascertain the oscil-
lator’s properties and determine the y(n) = A n x. (12)
for the rotation matrix and use initial values for the state variables.
We are used to the idea of identity Now we will use a wonderful result
1 operations such as adding zero and of eigenvalue theory and factor the
0
  (8)

for the initial state values. A graph of 1.0


both state variables’ values for the first
100 iterations is shown in Figure 1.
Now that we’ve seen a numerical 0.5
example and two analytical examples, x1(n)
naturally the question becomes “what ×××
are the constraints on the values of the 0.0
four elements in the rotation matrix
x2(n)
and have the matrix still function for
an oscillator iteration?” It turns out
−0.5
that there are two constraints, and
these are the discrete time equivalent
of the Barkhausen criteria. They are
−1.0
ad − bc = 1 0 10 20 30 40 50 60 70 80 90 100

|a + d| < 2. (9) ▲ 1. Output from example numeric oscillator.

104 IEEE SIGNAL PROCESSING MAGAZINE MAY 2003


general matrix into a product of  1 1  05
. 
S =  jφ z =  .
three matrices. This actually makes ψe ψe − jφ  05
. 
(18) (23)
raising a matrix to a power much
easier to perform
where Then our oscillator output is simply
written as
A = SDS −1 . (13)
−c
ψ= y(n) = SD n z (24)
T h u s A n can be written as b
(19)
(SDS −1 ) (SDS −1 ) (SDS −1 ) ⋅ ⋅ ⋅ (SDS −1 ) that after simplification yields
and after canceling out paired S −1 S
and
terms, we get the following simplifi-  cos(nθ) 
cation for our oscillator output: y(n) =  .
φ = arg(η) (20) ψ cos(nθ + φ) (25)
n −1
y(n) = SD S x. (14)
where Likewise given our initial choice for z,
then the initial state values are
At first blush this doesn’t seem to
help, but now let’s talk about the con- (d − a) + j 4 − ∆2
η= . x = Sz (26)
tents of the S and D matrices. First the 2b
D matrix is a diagonal matrix whose (21)
that after simplification yields
only nonzero elements are on the
main diagonal (upper left and lower It is interesting to comment on the
fact that a real-valued rotation matrix  1 
right for our case). These elements are x= ,
the eigenvalues. Also raising a diago- is factored into a product of complex ψ cos(φ) (27)
nal matrix to a power is simply the valued matrices. However, the imple-
raising of the diagonal elements to the mented oscillators will only use real which is of course just y(0).
same power. In terms of the original valued numbers. This brings to mind
rotation matrix elements, the diago- a saying attributed to the French
nal matrix is found: mathematician Jacques Hadamard: Interpreting the
“The shortest path between truths in Rotation Matrix
 e jθ the real domain passes through the
0  The attractive aspect of this analysis
D=  complex domain.”
− jθ method is that we can now evaluate an
0 e 
(15) Now the term “change of basis”
oscillator’s behavior by merely looking
was mentioned in connection with
at its rotation matrix! We see that our
where matrix S. This is used since the matri-
analyses includes two angles. The an-
ces S and S − 1 map between external
gle θ is the step angle per iteration, and
and internal space. This should be
∆ the angle φ is the phase shift between
θ = cos −1   viewed as the state variables undergo-
2 the two state variables. So, we can see
(16) ing three processes. The first is a trans-
that if we desire an oscillator to have
formation to internal space represen-
quadrature outputs (the two state vari-
and tation. The second process is a pair of
ables), then φ must be ±90°, which in
rotations performed on them, and
terms of the matrix elements means
lastly, a transformation back to exter-
∆ = a + d. (17) that the two values on the main diago-
nal space. In internal space, the two ro-
nal must be the same! So if a = d, we
tations are in opposite directions; this
It is at this point that we can see how have a quadrature oscillator. Likewise
allows us to combine complex num-
raising the matrix D to a power affects a the scaling factor ψ tells us the ampli-
bers so as to result in only real num-
rotation. In fact, θ, is the step angle of tude of the second state variable rela-
bers. Now let the variable z be an inter-
the oscillator per iteration. Now the tive to the first one. If we desire the
nal representation as follows:
“change of basis” matrix, S, contains two outputs to have equal amplitudes,
the eigenvectors that correspond to the then the off diagonal elements must be
eigenvalues used in matrix D. Again in z = S −1 x. (22) negatives of each other! That is,
terms of the original rotation matrix el- b = − c. So looking back at the matrix
ements, the matrix S is Next let x have an initial value so that used in our numerical example, we can

MAY 2003 IEEE SIGNAL PROCESSING MAGAZINE 105


quickly ascertain the outputs are in
quadrature but will have unequal am- a
plitudes as its graph confirms.
Now when it comes to program- +
b Σ Z−1 y1(n)
ming the oscillator in a DSP chip, +
we would not normally elect to
implement the iteration as a matrix
multiply; something simpler may be
possible! So we will derive the net- c
work diagram that represents the +
Σ Z−1 y2(n)
general rotation matrix multiplica- d +
tion. In the world of signal process-
ing, it is customary to try to only use
addition, multiplication, and delays,
and that is all we will use. The center- ▲ 2. Generic oscillator iteration network diagram.
piece of the network diagram in Fig-
ure 2 is the pair of delay elements that
if the two sine wave outputs have the since François Viète discovered the
are interpreted to hold the state vari-
same amplitude, then we have an trigonometric recurrence relation (1)
ables. For each iteration, the outputs
equi-amplitude oscillator. Four of the long before; his result was published
of the delay elements are used as the
five oscillators in this catalog are in in the year 1571! The biquad oscilla-
past values and the inputs to the delay
use in industry as they are mentioned tor has equi-amplitude outputs,
elements are the new values. For ex-
in various application notes and trade which turn out to have a relative
ample, the input to the upper delay el-
journals. The quadrature oscillator phase shift of θ
ement in Figure 2 is calculated:
with staggered update is one I put to- k = 2 cos(θ) (28)
gether using this matrix theory. Often
y$ 1 = ay1 + by 2 . you can make a new oscillator by per-  k −1
muting the matrix elements of a 1 0 .
  (29)
This generic form requires four known oscillator. Just apply the
multiplies and two additions for each Barkhausen criteria to the resulting
matrix to see if they still hold. Also When the rotation matrix (29) ele-
iteration. If the rotation matrix has ments are substituted in Figure 2, the
some values in common or some are you can multiply an oscillator matrix
by another matrix and often create an- generic oscillator network becomes the
simply zero or one, then the iteration biquad oscillator shown in Figure 3.
computations may become simpler. other oscillator. So, as you can gather,
this catalog hardly exhausts the possi-
ble list of oscillators. To show the Digital Waveguide
Catalog of Oscillators structure of an oscillator’s matrix in
its simplest form, the concept of tun- The digital waveguide oscillator is the
Now that we had gone through the simplest (in terms of the number of
ing parameter is introduced. This pa-
theory of discrete-time recursive os- multiplies) oscillator with quadrature
rameter, k, is related to the step angle,
cillators, we will now list some com- outputs. For k near zero, the outputs
θ. The exact relation, which depends
mon oscillators along with their become nearly equal in amplitude. This
on the particular oscillator used, will
attributes. I have chosen five oscilla-
be provided.
tors that span the gamut based on the
number of multiplies per iteration −
Σ
and their type of outputs. All oscilla- Biquad +
tors represented by 2 × 2 matrices will Z−1
produce two sine waves simulta- The biquad oscillator was one of the k
neously. These two sine waves will al- first discrete oscillators to see use in y1(n)

ways have the same frequency, be out signal processing applications. I recall
Z−1
of phase with each other, and may an application patent issued in the
have differing amplitudes. If the out- 1980s that used this oscillator for y2(n)
puts are 90° out of phase, then we generating call progress tones used in
have a quadrature oscillator. Likewise telephony. I found this interesting ▲ 3. Biquad oscillator.

106 IEEE SIGNAL PROCESSING MAGAZINE MAY 2003


means this oscillator can be effectively can function as an oscillator alone. there is a cost; this oscillator requires
used to phase lock a signal near 1/4 the This oscillator is shown in Figure 5. four multiplies per iteration. This oscil-
sampling rate. More on dynamic tun- lator, like the biquad, may be derived
θ
ing (i.e., changing frequency while in k = 2 sin   directly from trigonometric formulas
2 (32)
operation) of oscillators later. Figure 4 as shown in (3). Here the two trigono-
shows the network form for the digital metric functions are written in terms of
waveguide oscillator. 1 − k 2 k 1 k  1 0 the single parameter, k. This oscillator
 =  .
 −k 1 0 1  − k 1 (33) is shown in Figure 7.
k = cos(θ) (30)
k = sin(θ) (36)
 k k − 1 Quadrature,
k + 1 .
 k  (31) Staggered Update  1 − k2 k 
 .
This quadrature oscillator has nearly  − k 1 − k2  (37)
Note that the digital waveguide equi-amplitude outputs when k is
oscillator is a claimed item under U.S. small. Again, as before, we show the
patent #5701393, so consult the pat- Gathering our catalog of oscillator
factoring of its matrix, but here we properties yields the data in Table 1.
ent’s owner before using this oscilla- notice that the right-hand factor is
tor in a product. effectively a biquad oscillator. So
the left-hand factor is used to
change the configuration of the
Dynamic
Equi-Amplitude, right-hand oscillator. This oscillator Amplitude Control
Staggered Update is shown in Figure 6. So far the oscillators we have de-
The staggered update oscillators take scribed are ballistic in the sense that
their name from the fact that one state k = cos(θ) (34) they are loaded with some values
variable is first updated and then that and allowed to free run. If the run
new value is used in the update of the  k 1 − k 2  1 − k  0 1 time is “short,” then this may be ad-
 =  .
remaining variable. This oscillator’s
 −1 k  0 1   −1 k equate. But errors can and may ac-
outputs are equi-amplitude and cumulate to the point where the
(35)
quasi-quadrature, with the quadra- output no longer meets your re-
ture relation being reached in the quirements. Thus a way of control-
limit of small k. To explicitly show the Coupled, ling the oscillator’s amplitude is
oscillator iteration as being staggered, needed. A standard approach uses
its matrix along with a factoring of
Standard Quadrature an automatic gain control (AGC).
the matrix is shown. Notice how the The coupled standard quadrature oscil- Since we are iterating the oscillator,
matrix factors into a product of two lator features both quadrature and why don’t we just measure the
triangular matrices, neither of which equi-amplitude outputs. However, strength of the output and correct it

+
+ Σ Z−1 y1(n)
Σ Z−1 y1(n) k −

+ k
Σ
+

k
+
Σ Z−1 y2(n)

+
Σ Z−1 y2(n)
+

▲ 4. Digital waveguide oscillator. ▲ 5. Equi-amplitude, staggered update oscillator.

MAY 2003 IEEE SIGNAL PROCESSING MAGAZINE 107


k
1−k2
+ +
Σ Z−1 y1(n)
− Σ Z−1 y1(n)
k +

k
− −
Σ Z−1 y2(n) Σ Z−1 y2(n)
k + 1−k2 +

▲ 6. Quadrature, staggered update oscillator. ▲ 7. Coupled, standard quadrature oscillator.

after each iteration? Also, if the er- P0q ▲ Perform one oscillator iteration to
rors are small, the corrections only G= .
P q
(40) update the state variables.
need to be approximate. ▲ Measure the oscillator’s output
Now when we are measuring the power, P.
In this formula, P is the measured
oscillator’s output we will use pow-
power, P0 is the set point power, and ▲ Calculate a gain factor, G.
ers (squares of the amplitude) in-
q is a convergence factor. Since we ▲ And finally, scale the state variables
stead of the amplitudes to avoid
rather not perform division, we will by this gain factor.
square roots. Square root calcula-
use the first-order Taylor’s approxi-
tions tend to be costly in a DSP. The
mation; it has the neat property of
instantaneous power, P, is given by
turning division into subtraction. It is Dynamic
the following formula (in terms of
state variables, matrix elements, and Frequency Control
P
phase shift): G ≈ 1+ q − q . Finally we get to the subject of dy-
P0 (41)
b 2 −b namic frequency control. Since there
x12 − x2 − 2 x1 x 2 cos(φ) are some applications where one
P= c c . Since we are using G to scale the am- would like to have a numerically con-
sin 2 (φ) plitudes (the state variables), it is best
(38) trolled oscillator, we will briefly look
to let q = 1 / 2. Also, when using fixed at what it takes to do this with these
This formula looks painful to imple- point DSPs, it becomes convenient to oscillators. Changing an oscillator’s
ment, but for fixed frequencies, the cal- let the set point power also be 1/2 frequency merely requires modifying
culation only involves six multiplies (amplitude≈0.707). Thus our correc- the rotation matrix’s k value for any
and two subtracts. However, looking tion formula becomes new θ frequency value. The difficult
ahead to being able to change fre- part, however, is maintaining ampli-
3 tude control during dynamic fre-
quency, we see that if we restrict our- G= − P.
selves to the quadrature oscillators 2 (42) quency changes. Since our general
( φ ± 90° ), then the formula for the power formula (38) shows both a de-
power becomes much simpler! It is just But we still have one more poten- pendence on the frequency and am-
tial problem and that is G will nomi- plitude r atio, this can prove
nally be one, and sometimes we will computationally inefficient in the
b 2
P = x12 − x2 . need to multiply the state variables by general case. Thus the problem is up-
c dating the coefficients in the power
(39) a number slightly greater than one. A
trick that can be used is to multiply formula as the frequency is changed.
Along with the power measure- the state variables by 1/2 G and then Plus some oscillators will also change
ment, we need to find the gain needed double the results. So in summary the output amplitudes.
to properly scale the state variables. A AGC approach consists of the follow- If we apply some restrictions to
general gain formula is ing steps per iteration. the type of oscillator we can simplify

108 IEEE SIGNAL PROCESSING MAGAZINE MAY 2003


the situation. If we look at just using This approximation works well when ▲ 5) And finally, scale the state vari-
a coupled-standard quadrature oscil- k is small, and k is small for frequen- ables by this gain factor.
lator, all of these problems go away. cies near one-fourth the sampling It should be understood that there
In this case the formula for the power rate. If the tuning range needs to be is only one pair of state variables in-
becomes independent of the matrix enlarged, a higher-order expansion volved in the previous set of steps.
elements altogether! However, the may be used. Steps 1, 2, and 5 operate on the one
difficulty in this case lies in the ma- So far we have been making the os- pair of values. And step 3 just uses the
trix coefficients where two of them cillators easily controllable by using same pair to calculate the power. This
involve radicals. One can use a low-order series expansions for the can be viewed as two oscillators oper-
first-order binomial expansion for difficult to calculate terms. But these ating on the same state variables. It
these two terms, but then the deter- approximations carry a price tag; that just happens that one oscillator allows
minant is not quite one, so the AGC is, we either must use the oscillator in a for dynamic frequency control, and
must make up for the error. The cou- narrow tuning range where k is small, the other just shifts the frequency.
pled-standard quadrature rotation or we must use a higher-order approx- The networks representing the oscil-
matrix that uses first-order binomial imation to accommodate a larger lator iterations are still the same as
expansions for the two terms with range of operation. This results from previously cataloged. Explicitly we
radicals is the limitation that the low-order ap- can write the translation (shift) ma-
proximation is only good over a finite trix as
 k2  range. Sometimes our problem won’t
 1 − k  really be one of needing a large range  cos(ω) sin(ω) 
2
 .
k2  of operation, but rather we need to op-  − sin(ω) cos(ω).
 −k 1−   (46)
erate over a narrow range where k is
 2  (43) centered around some nonzero value.
This case is easily handled by the use of In a practical implementation, you
Equation (43), which can now be a frequency translation matrix. This will set ω = 2 π f o / f s where f o is the
used to approximate (37), has a deter- matrix, in effect, shifts the center fre- shift frequency in Hertz, and f s is the
minant that’s nearly one (specifically quency of our oscillator to the point of sample rate. The shift frequency may
1 + k 4 / 4), so the gain compensation interest. The oscillator’s center fre- be different than the new desired cen-
works well for a wide range of k. But quency is taken to be the frequency ter frequency, since the natural center
even if we use a non-equi-amplitude where k is zero, and thus the approxi- frequency for some of the oscillators
quadrature oscillator, we can find a mations are exact at this frequency. is one-fourth of the sampling rate.
simple solution for its amplitude con- The steps for one iteration of a dy- So what we’ve learned is that a rec-
trol. In fact we move the approxima- namic frequency, amplitude con- ipe for recursive oscillator design is
tion in the process from the rotation trolled oscillator that uses a frequency the following:
matrix to the power measurement. translation matrix are as follows: ▲ Pick your step angle based on the
An example using the digital wave- ▲ 1) Perform one oscillator itera- desired oscillator frequency by using
guide oscillator will now be shown. tion using a tunable oscillator to up- θ = 2 πf / f s .
The power formula for the digital date the state variables. This can be ▲ Select the desired oscillator network
waveguide oscillator in terms of the one of the aforementioned quadra- based on the properties in Table 1.
tuning parameter, k, is ture oscillators. ▲ Define k using its relation to θ in
▲ 2) Update the state variables using Table 1.
k−1 2 the frequency translation matrix. This ▲ Determine network coefficients
P = x12 − x2 . matrix is simply the same as shown in from the appropriate rotation matrix
k+1 (44) (37) where k is fixed to represent the in Table 1.
translation (shift) frequency. Since ▲ Establish the initial conditions
But knowing that we will be calculat- the values in this matrix are inter- from (27).
ing the power on every iteration, and preted to be constant, these values can ▲ Implement the oscillator using the
preferring to avoid division, we will be calculated prior to runtime. target hardware environment to de-
use a first-order series expansion of ▲ 3) Measure the oscillator’s output termine if dynamic amplitude control
the denominator that gives the fol- power, P. This is just applying (38) or is necessary.
lowing approximation for P: one of its simpler incarnations to the ▲ And if dynamic frequency control
state variables. is being used, determine if a transla-
P ≈ x12 + (1 − k) 2 x 22 . (45) ▲ 4) Calculate a gain factor, G. tion matrix is needed.

MAY 2003 IEEE SIGNAL PROCESSING MAGAZINE 109


FSK Modulator two trigonometric constants can be mate by three. The low-pass filter
Design Example calculated prior to use, so we won’t be used in this process will be selected to
concerned with there being radicals. offer intersymbol interference (ISI)
For our example, we will highlight The second oscillator that changes rejection. A polyphase-raised cosine
the design of a simple modulator for a frequency while in operation will use filter will suffice. And finally, we will
1,200 Bd frequency shift-key (FSK) the first-order binomial expanded scale the input to the oscillator, so it
modem. The modem generates either version of the coupled standard quad- will emit the correct frequencies.
1,300 or 2,100 Hz depending on rature oscillator (43). We are using Since we are doing an FM process,
whether it is sending a “0” or a “1” this oscillator since it allows for easy the scaling just sets the modulation
bit. We will let our sample rate be 8 index. The scaling can be combined
frequency and amplitude control; re-
kHz, which is common in telephony. into the sample rate conversion pro-
member the amplitude control is re-
Since the data rate does not divide cess. If a polyphase filter method is
quired h ere, somewhat for
evenly into the sample rate, a sample used, the coefficients for each of the
accumulated numerical errors, but
rate conversion will be needed. This filters just get scaled to set the modu-
mainly since this matrix (43) does not
also means the oscillator will generate lation index.
strictly obey the Barkhausen criteria.
intermediate frequencies other than The fixed frequency matrix is set to
Fortunately, the AGC can more than
1,300 and 2,100 Hz. This modulator operate at 1,700 Hz, i.e., the average
example will benefit from the use of a compensate for the oscillator’s gain as
of the two desired frequencies. Nu-
translation matrix as well. long as k is small, which means low
merically, the fixed frequency matrix
Looking at our two frequencies, frequencies with this oscillator, hence
is just
namely 1,300 and 2,100 Hz, we see the use of the frequency translation in
that we can use a fixed frequency os- the overall modulator.
Since the input to the modem is a   2 π1,700   2 π1,700  
cillator at 1,700 Hz and let the vari-  cos sin  
able frequency oscillator range sequence of bits (1,200 b/s), we need   8,000   8,000  
between +400 and −400 Hz. So we to do several things before we let it  
will use two oscillator matrices in tan- control the oscillator’s frequency.  − sin  2 π1,700   2 π1,700  
cos  
First we need to perform an antipodal   8,000   8,000  
dem where one has a fixed frequency
and the other varies depending on mapping of the data, i.e., map “1” bits  0233445
. 0972370
. 
whether we are sending a “0” or a “1.” to a value of +1, and map “0” bits to ≈ .
 − 0972370
. 0233445
. 
The first oscillator will function as the −1. Next we need to resample these
frequency translation oscillator and 1,200 values per second to 8,000 per (47)
hence uses (46) for its work. This os- second since this is the modem’s sam-
cillator will not change frequency pling rate. Basically a multirate filter Now for the variable frequency part.
during the modem’s operation, so the is used to interpolate by 20 and deci- Since we desire to deviate between

Table 1. Recursive oscillator properties.


Quadrature
Oscillator Mult./Iter. Equi-Amplitude k= Rotation Matrix
Output
 k −1 
Biquad 1 Yes No 2cos(θ) 1 0 
 

 k k − 1
Digital waveguide 1 No Yes cos(θ) k + 1 k 

1 − k 2 k
Equi-amplitude-staggered update 2 Yes No 2sin(θ/2)  
 −k 1

 k 1 − k2 
Quadrature-staggered update 2 No Yes cos(θ)  
 −1 k 

 1 − k2 k 
Coupled-standard quadrature 4 Yes Yes sin(θ)  2
 − k 1 − k 

110 IEEE SIGNAL PROCESSING MAGAZINE MAY 2003


+400 and −400 Hz, we find the scal- Summary ment at Wireless Systems Engineer-
ing for the frequency input to the os- ing, Inc. He is pursuing his Ph.D. and
cillator by k = sin(2 π 400 / 8,000) = We have explored the basic theory of
holds a B.S. in mathematics and an
0.309017. So our ISI filtered antipo- recursive digital oscillators with a
M.S. in physics from Georgia State
dal values need to range between bent towards the practical, and from
University. He is a member of Pi Mu
±0.309017. The frequency input, there we have looked at some com-
mon oscillators. Then we added some Epsilon and Sigma Pi Sigma honor
which is updated 8,000 times per sec- societies.
ond, becomes the value k used in mechanisms for controlling their am-
(43). The two unique values in matrix plitude and adjusting their frequency.
(43) are calculated 8,000 times per And last we showed a brief example of
second and then used in the variable how these oscillators and their con- References
frequency oscillator iteration. And of trol mechanisms may be used to make [1] J. Diefenderfer, Principles of Electronic Instrumen-
course the initial state values for the FSK modulators. I hope I have tation. Philidelphia, PA: Saunders College Pub-

oscillator combination are simply piqued the your interests, and I en- lishing, 1979, pp. 185.
courage you to go and develop your [2] M. Frerking, Digital Signal Processing in Com-
 2 own oscillators using the rules and munication Systems. Norwell, MA: Kluwer,
  ≈ 0707107
.  techniques presented here. 1993, pp. 214-217.
 2   0 .
 0    [3] S. Friedberg and A. Insel, Introduction to Linear
(48) Algebra with Applications. Englewood Cliffs, NJ:
Prentice-Hall, 1986, pp. 253-276.

These are found by scaling the re- Acknowledgment [4] R. Higgins, Digital Signal Processing in VLSI.
sult of (27) by P0 , and P0 is chosen I would like to give credit to those Englewood Cliffs, NJ: Prentice-Hall, 1990, pp.
529-532.
so (42) may be used for amplitude who frequent the USENET group
control. comp.dsp. From time to time ques- [5] S. Leon, Linear Algebra with Applications, 2nd
ed. New York: MacMillan, 1986, pp. 230-259.
For each iteration then, we just tions arise about oscillators, and vari-
▲ Antipodal map, resample, ISI re- ous group participants have offered [6] A. Oppenheim and R. Schafer, Discrete-Time
jection filter, and scale the 1,200 b/s information about oscillators that has Signal Processing. Englewood Cliffs, NJ:
Prentice-Hall, 1989, pp. 342-344.
data to create “k” for this iteration. proved invaluable here for this article.
▲ “Matrix multiply” the state vari- [7] J. Smith and P. Cook, “The second order digital
waveguide oscillator,” in Proc. Int. Computer
ables by the 1,700 Hz fixed frequency Clay Turner is vice president and
Music Conf., San Jose, CA, Oct 1992, pp.
matrix. cofounder of Wireless Systems Engi- 150-153.
▲ “Matrix multiply” the state variables neering, Inc. He has over 20 years of
[8] J. Smith and P. Cook, “System and method for
by the variable frequency matrix; the experience in digital signal process-
real time sinusoidal signal generation using
value of k was determined above. ing, mathematical programming, waveguide resonance oscillators,” U.S. Patent
2 2
▲ Measure the power:*P = x1 + x 2 . embedded programming, telephony, #5701393, Dec 23, 1997.
▲ Calculate the gain: *G = 3 / 2 − P. and the design of “off-air” protocol [9] C. Turner, “A discrete time oscillator for a DSP
▲ Scalar multiply the state variables analyzers, and he is responsible for based radio,” in SouthCon/96 Conf. Rec., Or-
by the gain, G. mathematical algorithm develop- lando, FL, 1996, pp. 60-65.

MAY 2003 IEEE SIGNAL PROCESSING MAGAZINE 111

You might also like