Professional Documents
Culture Documents
FM Modulator-Demodulator
Trio Adiono, Nur Ahmadi, Antonius P. Renardy, Ashbir A. Fadila, Naufal Shidqi
School of Electrical Engineering and Informatics, Bandung Institute of Technology
Jl. Ganesha No 10, Bandung, Indonesia 40132
E-mail: tadiono@stei.itb.ac.id
Abstract— COordinate Rotation DIgital Computer able for such application that need lesser elements usage.
(CORDIC), is an algorithm that is used to perform The rest of this paper is organized as follows: Sec-
trigonometric-related calculations. CORDIC is often uti- tion II describes the algorihm of CORDIC; Section III
lized in the absence of hardware multiplier since this al- presents the architectural implementation of CORDIC al-
gorithm requires only addition, subtraction, bit shifting, gorithm; Section IV covers the use of CORDIC as NCO
and lookup table. This paper provides an implementa- and other modules required in all-digital FM modulator-
tion of CORDIC algorithm using pipelined architecture. demodulator; The implementation of proposed system on
The pipelined CORDIC is then used in an all-digital FM FPGA and its performance evaluation are provided in Sec-
modulator-demodulator. All designs are implemented in tion V; Finally, conclusions are drawn in Section VI.
Verilog and synthesized by using Altera Quartus software
with DE2-70 FPGA target board. The proposed design II. CORDIC Algorithm
consumes 1,103 logic element, latency 33.32 ns, and maxi- CORDIC algorithm is derived from rotation of a vector
T
mum frequency 420.17 MHz. The overall system including [x0 y0 ] in Cartesian coordinate which can be expressed in
(1) where [x y ] is the final vector produced after rotation
FM modulator-demodulator utilizes 3,911 logic elements, T
latency 233.33 ns, and maximum frequency 60 MHz. and θ is the target angle of rotation.
Keywords— CORDIC, Frequency Modulation, Modu-
x cos(θ) sin(θ) x0
lator, Demodulator, FPGA. = (1)
y − sin(θ) cos(θ) y0
0x2000 0x0000
16 16 16 xi+1 yi+1 zi+1
Xi Yi Zi
Quadrant Detector
Fig. 3: Elementary rotational unit of pipelined CORDIC
Xo Yo Zo core
16 16 16
Dx Dy Dz
Input Register
Each pipeline stage is separated by a register in order to
Rst
Qx Qy Qz reduce the critical delay path. This leads to a penalty in
16 16 16
terms of increased latency as the pipeline stage increases.
Xi Yi Zi In total, the latency for this design is 14 clock cycles. Due
CORDIC Core
Xo Yo Zo
Rst to the nature of the architecture, this design is able to
16 16 16 achieve throughput of one.
Dx Dy Dz
Output Register IV. FM Modulator-Demodulator
Rst
Qx Qy Qz
16 We implement our pipelined CORDIC into an All-
16 16
Digital FM Modulator-Demodulator. Frequency Modula-
tion (FM) is used in many applications such as audio and
Cos Sin
video broadcasting systems, telemetry, radar, etc. The
CORDIC is applied in Numerically Controlled Oscillator
Fig. 1: Top level of pipelined CORDIC (NCO), the key component inside FM Modulator and FM
Demodulator block. NCO plays an important role in dig-
CORDIC Core is the realization of CORDCIC’s differ- ital FM to ensure the linearity over the entire frequency
ence equations in pipelined architecture. There are 14 range which analog FM is lack of [3]. The architecture of
stages of pipeline in the core, each comprising the struc- proposed application is described in Figure 4.
ture shown in Figure 3. On each stage, three adders/sub- First, the analog input signal x(t) is sent into our ap-
stractor, two arithmetic right-shifters, one direction block plication system. ADC block is used to convert the input
signal, the input of NCO is,
x(t) x[n] FM m[n] FM r[n] r(t)
step = 1 × 106 × 67.464 = 67464000
ADC DAC
Modulator Demodulator (8)
B. Modulator
signal into digital signal, x[n]. Then, FM Modulator block
will generate frequency modulated signal m[n] using x[n] In the FM modulation technique, which is a kind of an-
as message signal and our pipelined CORDIC as carrier gle modulation methods, instantaneous frequency of the
signal. carrier signal varies linearly with the baseband-modulated
The signal m[n] will be digitally transferred into FM message signal x(t) as follows:
Demodulator block. In this block, we use all-digital phase
locked loop as the demodulation method because it is nor- MF M (t) = Ac cos[2πFc t + θ(t)]
t
mally considered a relatively high performance form of FM (9)
= Ac cos[2πFc t + 2πKf m(n)dn]
demodulator beside its easiness to be applied. FM Demod- 0
ulator block will produce recovered message signal, r[n].
Then, r[n] will be converted into analog signal by passing where Ac is the amplitude of the carrier, Fc is the carrier
it through DAC block. frequency, and Kf is the frequency deviation constant.
The architecture of the FM modulator is as shown in
A. Numerically Controlled Oscillator (NCO) Figure 6.
The fundamental component of our application is a Nu-
merically Controlled Oscillator (NCO). The architecture of
designed NCO block is shown in Figure 5.
Kf
Fig. 8: FM demodulation architecture Based on Table I, Compressor Tree PPA Carry Select
Adder FSA offers the best performance among the other
The input frequency modulated signal can be expressed multipliers in terms of A ∗ T . Because of our target is to re-
as follows: place the area consumption of signed arithmetic multiplier
in(t) = sin[ωi t + θi (t)] (11) operation, Compressor Tree PPA CSA FSA multiplier is
the right choice although its propagation delay (T ) is larger
Feedback loop mechanism of the PLL makes the NCO to
than others.
produce a sinusoidal signal ref (t) with the same frequency
as that of in(t), where V. FPGA Implementation
ref (t) = cos[ωi t + θ0 (t)] (12) A. Simulation
The output of the phase detector, which is the product The verification is performed by comparing results pro-
of these two signals, is found using familiar trigonometric duced from every bit possibilities of the input argument
identity: to sine and cosine function in Microsoft Excel. The cosine
value obtained from CORDIC and Excel computation is
pt = Kd [in(t) + ref (t)]
shown in Figure 10a. The error performance of the pro-
= Kd [sin[ωi t + θi (t)] ∗ cos[ωi t + θ0 (t)] (13)
Kd posed design is plotted as in Figure 10b. The maximum
= [sin[2ωi t + θi (t) + θ0 (t)] + sin(θi (t) − θ0 (t))] of output error obtained from simulation of cosine and
2
sine between −π and π is 8.095 × 2−13 and the average is
where Kd is the gain of the phase detector. The first term in
1.585×2−13 . Figure 11 shows the Modelsim functional sim-
(13) relates to the high frequency component. The second
ulation of proposed pipelined CORDIC. The design has 14
term corresponds to the phase difference between in(t) and
clock cycles latency and throughput of one. This amount of
ref (t). By removing the first term through a loop filtering,
latency results from 14 stages pipelined architecture inter-
the phase difference can be obtained.
stage registers.
The important thing to realize when designing with the
PLL is that it is a feedback system and, consequently, it is
characterized mathematically by the similar equations that 1.0
Cordic 0.0008
Excel
are applied to other conventional feedback control systems. 0.5
0.0006
0.0004
Cosine Value
0.0002
0.0
0.0000
rived to analyze the transient and steady state responses. -0.0002
-0.0006
of the loop in terms of the speed and locking range as com- -1.0 -0.0008
The phase detector is used to discover the phase error Fig. 10: Cosine value comparison (a) and the error perfor-
between modulated message and the output of NCO block mance (b)
as shown in Figure 9.
Fig. 11: Functional simulation showing input and output pipelined CORDIC
Our FM modulator for data modulation is used to verify [4] in term of resource utilization (area) as can be seen in
the FM demodulator block design. The sine-wave data Table III. Our proposed FM modem design is shown to
frequency is 1 kHz, while the bandwidth modulation is ± have better resource utilization which is 1,123 for modula-
3 kHz at 10 kHz center frequency. The result can be seen tor and 1,997 for demodulator.
in Figure 12.
TABLE II: Synthesis results of CORDIC and FM Modem
Parameters CORDIC FM Modem
Total Logic Elements 1,103 3,911
Combinational Functions 1,040 3,666
Registers 649 1,894
Memory Bits 0 6,144
Embedded Multipliers 0 0
PLLs 0 1
Fmax (MHz) 420.17 60
Latency (ns) 33.32 233.33
From the verification result, the first row shows the data 1500
1152
signal that has been inputted manually in testbench file. 1000
1040
such as logic elements, memory bits, and multipliers, and Fmax (MHz)
maximum working frequency can be obtained in compila- Fig. 14: Clock speed comparison
tion report. Latency can be obtained by dividing amount
of cycles needed for processing one frame with maximum
frequency. The synthesis results of the pipelined CORDIC TABLE III: Comparison of FM Modem
and overall system of FM modem are listed in Table II. Blocks Our Design [4]
The proposed CORDIC design is compared to other de- FM Modulator 1,123 6,270
signs including built-in MegaCore function inside Quartus FM Demodulator 1,997 5,934
Altera for several device families. The CORDIC’s area - Trigonometric Unit 1,087 1,510
- Phase Detector 516 616
comparison is shown in Figure 13 while the clock speed
- Loop Filter 40 297
comparison is presented in Figure 14. From both figures, it - Low Pass Filter 335 3,511
can be inferred that our proposed design performes better.
The design of FM modem is also compared to other design
C. On-Chip Verification of the demodulator through digital oscilloscope. Spectral
In our proposed application design, we need 240 kHz analysis was then performed by using Fast Fourier Trans-
clock generator since the PLL in FPGA cannot provide form. To measure the SFDR in dB, the magnitude of the
small frequency. The principal of clock divider block is largest spurious signal was subtracted from the magnitude
to generate binary data (0 and 1) when it reaches certain of the signal at 500 Hz, both were in dB.
value. The V alue = Fclock /2Fout . Thus, for generating a Figure 17a and 17b show the FFT results of the output
240 kHz clock from 50 MHz clock system, the V alue is 104. of NCO and overall system. From these figures, it can be
The designed system was implemented in Altera DE2- inferred that the SFDR is -38 dB for the NCO and -22 dB
70 FPGA board. It has one input (analog signal as the for the overall system.
message to be modulated) and one output (analog signal
resulting from demodulation). The ADC and DAC was
implemented using built-in audio codec with 16-bit wide
digital data and 48 kHz sampling frequency.
For testing purpose, the input signal to the modulator
was given from PC in the form of music and the output sig-
nal was observed using Audacity software (also on PC) as
shown in Figure 15. The output waveform from FPGA
recorded on the Audacity software as well as the input
waveform can be seen in Figure 16. It can be concluded (a) (b)
from inspection of this figure that the designed circuit was
Fig. 17: Spectral plot of NCO and FM demodulator output
able to demodulate the FM input signal back to its origi-
nal form, although some noises was present in the output
signal. The noises came from the steady state error of the VI. Conclusion
output of PLL since the control loop was implemented us-
ing gain control only. This hindered the PLL to completely We have succesfully implemented and verified CORDIC
lock the frequency of the signal to be demodulated, result- algorithm based on pipelined architecture. Its functionality
ing in some errors to the output of the PLL. is verified using ModelSim with accuracy 2−13 and maxi-
mum error of 8 × 2−13 . The proposed pipelined CORDIC
Software :
-Audacity
architecture consumes 1,103 logic element, latency 33.32
-Music
Player
ns, and maximum frequency of 420.17 MHz. While our FM
modulator-demodulator application utilizes 3,911 logic ele-
Output audio
ments, latency 233.33 ns, and maximum frequency 60 MHz.
Input audio The proposed design is compared to other design and of-
fers better performance. The CORDIC serves as NCO for
signal generation. Frequency demodulation is achieved by
Fig. 15: Tools arrangement utilizing digital PLL with NCO for decoding the message
signal. The all-digital FM modem has been successfully im-
plemented and run in Altera DE2-70 FPGA Development
board. The input sound is obtained from the computer and
output sound is sent to active speaker.
References
[1] J. E. Volder, “The CORDIC trigonometric computing technique,”
Fig. 16: Comparison of our application output (upper) and IRE Transactions on Electronic Computers, no. 3, pp. 330–334,
1959.
original audio (lower) [2] J. S. Walther, “A unified algorithm for elementary functions,” in
Proceedings of the Spring Joint Computer Conference. ACM,
May 1971, pp. 379–385.
D. Performance Evaluation [3] I. Hatai and I. Chakrabarti, “A new high-performance digital
fm modulator and demodulator for software-defined radio and
The quality of the system was measured by finding the its fpga implementation,” International Journal of Reconfigurable
Computing, vol. 2011, p. 2, 2011.
spurious-free dynamic range (SFDR) which is the magni- [4] J. P. M. Brito and S. Bampi, “Design of a digital FM demodu-
tude ratio of the fundamental signal to the strongest signal lator based on a 2nd-order all-digital phase-locked loop,” Analog
within the Nyquist frequency of the output. Two measure- Integrated Circuits and Signal Processing, vol. 57, no. 1-2, pp.
97–105, 2008.
ment of SFDR was performed to: (1) measure the qual- [5] T. Wada, “All digital FM receiver (version 1.0),” Sep. 03,
ity of the designed NCO and (2) the overall modulator- 2004. [Online]. Available: http://www.ie.u-ryukyu.ac.jp/∼wada/
demodulator system. The measurement was performed by design05/spec e.html
[6] T. Aoki, “Hardware algorithms for arithmetic modules,” Aug.
taking pure 500 Hz sinewave as the input and observing the 08, 2007. [Online]. Available: http://www.aoki.ecei.tohoku.ac.
output of the NCO+ADC (often called Direct Digital Fre- jp/arith/mg/algorithm.html
quency Synthesizer or DDFS) in modulator and the output