You are on page 1of 4

International Journal of Advanced Engineering Research and Technology (IJAERT)

219

Volume 3 Issue 6, June 2015, ISSN No.: 2348 8190

FPGA based Recursive Sinusoidal Oscillators


Tarun Kaushik
Department of E&CE
PEC University of Technology
Chandigarh, India

Dr. Neelam Rup Prakash


Department of E&CE
PEC University of Technology
Chandigarh, India

Abstract
In this paper different recursive sinusoidal oscillator and
their FPGA implementation and performance is
evaluated. The presented recursive oscillators are
capable of generating multiple outputs with good
spectral purity. The performance is compared for
spectral purity, critical path and resource utilization. The
simulated and implemented results are verified using
MATLAB and Xilinx tools. The Oscillators are
implemented on ZYNQ FPGA.

measured the performance against the parameters of root


mean square error and spurious free dynamic range
(SFDR). In this paper, the different oscillator
performance is compared against area utilization, critical
path, SFDR and power consumption. The paper is
structured into four sections. Section I presents
introduction, section II discusses theory of recursive
sinusoidal oscillators, and section III and IV describes
implementation and performance on FPGA and
conclusion respectively.

II. RECURSIVE SINUSOIDAL OSCILLATORS

Keywords FPGA, SFDR, THD, DDS, ZYNQ

I. INTRODUCTION
The conventional method of generating sinusoidal
wave uses sample storage in memory and then reading
them at a defined rate. This method forms the basis of
popular digital direct synthesizers which are used and
studied extensively but an alternative method of using
recursive methods is not used much. Such sinusoidal
wave generating oscillators is based on recursive
methods uses positive feedback satisfying the
barkhausen criterion. These types of oscillators are
essentially discrete-time simulations of physical
oscillatory systems having a simple harmonic motion
with zero damping as their solution [1]. The output of
such oscillating system is sinusoidal waveform. These
have the advantage of simplicity, high spectral purity and
low resource utilization while having shortcomings such
as amplitude instability, amplitude quantization noise
and non-linear frequency control as compared to
traditional Direct Digital Synthesis (DDS) based
oscillators. These oscillators find applications in music
synthesis, communication systems, DSP, FFT and
sinusoidal generation.
The standard approach to design such oscillators is to
design an amplifier whose gain is controlled by suitably
planned phase shifting network [2]. But this must satisfy
the discrete time equivalent of barkhausen criteria, which
says that the total loop gain, be equal to unity and the
loop phase shift should be multiple of 2 radians. As
these oscillators employs feedback for their operation
that means given past values, next values can be
calculated with the help of recurrence relations defining
the discrete time representation of such structures.
Krupski [3][4] discussed novel recursive oscillator and

As the recurrence relation can predict next values


from past values, they form the basis of discrete time
representation of recursive sinusoidal oscillators. The
following equation (1) known as trigonometric recursion
generates the sinusoidal sequence using recursive
process [1] [5]
cos( + ) = 2cos() cos() cos( )

(1)

where is step angle. The above equation allows


calculation of next value of cos based on previous two
values and forms the basis of biquad oscillator. The
discrete time representation of equation (1) is given by
y(n + 1) = 2cos() y(n) y(n-1)

(2)

where y(n+1), y(n) and y(n-1) represents the next,


present and previous sinusoid sample. Putting n = n-1 in
equation (2), the casual form of above equation is
y(n) = 2cos() y(n-1) y(n-2)

(3)

The equation (3) represents the biquad oscillator in


direct form as shown in fig 1, where n>=0 and =T.
Thus the output frequency depends on step angle and the
initial conditions.
Another set of coupled trigonometric equations (4a)
and (4b) is used to generate the quadrature outputs.
cos( + ) = cos() cos() - sin() sin()
(4a)
sin( + ) = sin() cos () + cos() sin()
(4b)
The above set of equations forms the basis of coupled
form of oscillator and can be represented in discrete
forms as follows:

www.ijaert.org

International Journal of Advanced Engineering Research and Technology (IJAERT)

220

Volume 3 Issue 6, June 2015, ISSN No.: 2348 8190

y1(n+1) = cos() y1(n) - sin() y2(n)


y2(n+1) = sin() y1(n) + cos() y2(n)

y1 (n 1) 2 cos( ) 1 y1 (n)

0 y 2 (n)
y 2 (n 1) 1

(5a)
(5b)

The above two equations are coupled in the sense that


one output depends on its past value as well as another
variable past value too. In addition to above two
oscillator forms, this paper investigates two more forms:
modified coupled form and digital waveguide form.
The above equations are easily representable in
matrix form as follows, which is called as matrix
iteration [2] in terms of old and new set of state values.

The biquad form does not produce quadrature outputs


as it is evident from its rotation matrix, but produces
equal amplitude output since a12 = -a21. Also, it is the
simplest form as it requires only one multiplication.
The coupled form oscillator, fig 2, is defined by the
iteration matrix

y1 (n 1) cos( ) sin( ) y1 (n)

y 2 (n 1) sin( ) cos( ) y 2 (n)

y1 (n 1) a11 a12 y1 (n)

y 2 (n 1) a 21 a 22 y 2 (n)
The second matrix is known as rotation matrix and it
helps in visualizing and designing the new oscillator
forms. Applying the barkhausen criteria, the first criteria
of unity gain is satisfied by making the determinant of
rotation matrix one whereas the second condition
translates into that all the elements of rotation matrix
must have complex eigen values. Further, to produce
quadrature outputs diagonal elements of rotation matrix
must be same whereas to produce equiamplitude outputs
off diagonal elements must be negative of each other.
The first and simplest oscillator form is direct form or
biquad oscillator, the impulse transfer function of which
is given by

H ( z)

1
1 2 cos( )z -1 z 2

As it is clear from the above rotation matrix, coupled


form oscillator produces equiamplitude quadrature
outputs. Also, the poles are slightly displaced from unit
circle as compared to biquad form, thus contributing to
oscillation amplitude exponential growth or decay over
time. However, the poles are uniformly distributed
around the unit circle [1] resulting in a linear relation
between oscillation frequency and . This oscillator
requires four multiply and two addition operation
operations as shown in fig 2.

(6)

Fig 2: Coupled Form Oscillator

Fig 1: Biquad Oscillator


where = 2 * (fs/f), fs being the sampling frequency
and f desired output frequency of sinusoid.
The poles of H(z) are complex conjugate and lie on
unit circle to produce sinusoid oscillations for all values
of n. It produces stable oscillations; the only factor
contributing to instability is quantization effects in the
form of coefficient truncation. The initial conditions are
y(-1) = y(-2) =0 and unit impulse is applied at t=0 for
sustained oscillations. The iteration matrix for biquad
form is

Thus, coupled form is costly in terms of resources


and computation as compared to biquad form. It is
modified by placing its poles either beyond or precisely
on the unit circle, a form known as modified coupled
form. Moreover, this requires two multiply operations
less than the coupled form as shown in fig 3, thus
reducing the cost of computation too. This modified
coupled form oscillator removes the oscillation
amplitude sensitivity to arithmetic quantization [6]. The
rotation matrix for this form as follow indicates that this
form produces equiamplitude outputs but no quadrature
outputs.

www.ijaert.org

International Journal of Advanced Engineering Research and Technology (IJAERT)

221

Volume 3 Issue 6, June 2015, ISSN No.: 2348 8190

2
y1 (n 1) 1 2 sin ( 2 ) 2 sin( 2 ) y1 (n)

y
(
n
)

2
y 2 (n 1) 2 sin( )

1
2

dual core ARM Cortex A9 MPcore based processing


system (PS) with 85,000 Series-7 Xilinx programmable
logic (PL) in a single device [9]. In this paper,
performance is compared against area utilization,
spectral purity and maximum sampling frequency. The
oscillators are designed for output frequency of 4MHz
frequency with sampling frequency of 25MHz. All the
discussed recursive oscillator forms are implemented
using Xilinx ISE 14.3 and System Generator. A system
generator model of coupled form oscillator is shown in
fig 5.

Fig 3: Modified Coupled Form Oscillator


Fig 5: Sysgen Implementation of Coupled Form
Oscillator
The last oscillator form discussed is waveguide form
[7], proposed by Smith and Cook in context of computer
music work. The iteration matrix is as follows:

y1 (n 1) cos( )
cos( ) 1 y1 (n)

y 2 (n 1) cos( ) 1 cos( ) y 2 (n)

Table 1 below shows the area utilization and speed


comparison of all discussed oscillators form. As it is
clear from the table 1 that biquad form oscillator uses
least number of occupied slices as well as slice LUTs
which also validates the discussion in the paper.
Table 1: Resource utilization and Speed Comparison

As it is clear from the fig 4, this form of oscillator


requires only one multiplication and three addition
operations per sample, assuming both amplitude and
frequency are constant. As compared to coupled form
oscillator, this form does not suffer from exponential
oscillation amplitude problems due to quantization. The
rotation matrix indicates that this form is able to produce
quadrature outputs but of unequal amplitudes.

Fig 4: Waveguide Form Oscillator

III. IMPLEMENTATION AND PERFORMANCE


The discussed oscillator form is implemented on
ZYNQ FPGA using Zedboard. The Zedboard [8] is
based on the high performance, low power, 28nm Xilinx
Zynq-7000 All Programmable SoC (AP SoC) having a

The critical path analysis of all oscillator form is


performed and coupled form oscillator is found having
highest sampling frequency and hence minimum period.
Moreover, modified coupled oscillator has least
maximum frequency of all form of oscillators discussed.
The waveguide oscillator occupies almost same
resources as biquad form but has significant less
maximum frequency.
The recursive oscillators are among the purest
oscillators available. Spectral purity is measured with
respect to Spurious Free Dynamic Range (SFDR) and
Third Harmonic Distortion (THD) as shown in Table 2.
Biquad form of oscillator is found having highest SFDR
among all oscillator forms. Fig 6 shows spectrum plot of

www.ijaert.org

International Journal of Advanced Engineering Research and Technology (IJAERT)

222

Volume 3 Issue 6, June 2015, ISSN No.: 2348 8190

coupled form of oscillator. The spectrum is plotted using


the model in fig. 5.

Fig 6: Magnitude Spectrum Plot of Coupled form


Oscillator

in Microelectronics and Electronics, 2009. PRIME


2009. Ph.D., Cork, pp. 244 - 247, 2009
[5] C. Turner, A Discrete Time Oscillator for a DSP
Based Radio, SouthCon/96 Conference Record,
Orlando, FL, IEEE 1996, pp. 60-65
[6] J. W. Gordon, and J. O. Smith, A sine generation
algorithm for VLSI applications, Proceedings of the
1985 International Computer Music Conference,
Vancouver, 1985
[7] J. Smith and P. Cook, The second order digital
waveguide oscillator, International Computer Music
Conference, San Jose, CA, Oct 1992, pp.150-153
[8]ZedBoard.org,
"ZedBoard,"[Online].Available:
http://www.zedboard. org/.
[9] Zynq-7000 All Programmable SoC Overview, DS190
(v1. 2), Xilinx, 2012

The power comparison of all oscillator forms is also


performed using Xilinx Xpower analyzer as shown in
table 2. Modified couple form oscillators have been
found to perform marginally better than biquad and
coupled form oscillators.
Table 2: Spectral Purity and Total Power Comparison

IV. CONCLUSION
The four recursive oscillator forms is discussed and a
performance comparison is performed among them using
ZYNQ FPGA and Xilinx tools for output frequency of
4Mhz. Each has its own merit and demerits. Coupled
form of oscillator is found having maximum sampling
frequency whereas biquad form occupies least area.
Further, amplitude oscillations problems arise in such
oscillators due to accumulation of quantization errors,
which can be corrected by available techniques in
literature.

References
[1] P. Symons, Digital Waveform Generation,
Cambridge University Press, December 2013
[2] C. Turner, "Recursive discrete-time sinusoidal
oscillators", IEEE Signal Processing Mag., vol. 20,
pp.103 -111 2003
[3] T. Krupski, Digital complex sinusoidal oscillators
with outputs in quadrature, Signal Processing
Algorithms,
Architectures,
Arrangements
and
Applications, Poznan, pp75-80, 2007
[4] T. Krupski, E. Hermanowicz, Novel designs of
recursive discrete-time sinusoidal oscillators, Research
www.ijaert.org

You might also like