You are on page 1of 4

FSK Demodulation on DSP

Milan Brejl

Motorola Czech Systems Laboratories,
1. mje 1009, 756 61 Ronov p.Radh., Czech Republic,
E-mail: Milan.Brejl@motorola.com



Abstract: The article discusses FSK [1] demodulation algorithms suitable for an
implementation on a DSP. The algorithms are based on direct DFT (Discrete
Fourier Transformation) values computation. Their behavior in different noisy
environments is simulated. The implementation of this algorithm on a power-line
modem application is briefly described.
I. INTRODUCTION
The power of today's digital signal processors [2] enables implementation of digital
modulation/demodulation algorithms in software. Advanced demodulation techniques require
significantly higher computational power but also bring great improvement to the error ratio in
noisy environments.
The subject of this article is a discussion about FSK demodulation algorithms that are
designed for maximal noise proof and with respect to implementation on a DSP.
II. THEORY
DFT computes the continuous frequency function of a given discrete-time signal. Here,
DFT is used to compute the values F
0
and F
1
of a frequency function at only two discrete
points - at frequencies f
0
and f
1
. f
0
is the frequency of a signal element corresponding to bit 0
and f
1
is the frequency of a signal element corresponding to bit 1.

b
1
0
j
0
0
N
n
n
e n s F
;
, (1)

b
1
0
j
1
1
N
n
n
e n s F
;
(2)
where

s
f
f
0
0
! 2 ; , (3)

s
f
f
1
1
! 2 ; (4)
and s(n) is the signal element sample, f
s
is the sampling frequency.
Comparison of F
0
and F
1
decides if the signal element transfers bit 0 or bit 1. Lets
establish a binary vector MSG as the transmitted message. Then

0 1
F F j MSG (5)
where j is the index of the actual signal element and the corresponding bit.
Further solutions are required to establish synchronization to the signal element within
the incoming FSK signal and to suppress the noise influence.

150 200 250 300 350 400 450
0
0.05
0.1
0.15
0.2
0.25
0.3
Window No.
Spectral
Power
Density

Figure 1. The course of |F
0
|
2
(solid line) and |F
1
|
2
(dotted line) - variant 3:1. The data burst starts approx. at the
window No. 300 where the start sequence is recognizable.
In correspondence with the rule of a digital signal minimal frequency differentiation, the
signal element length T is chosen:

0 1
1
f f
T

(6)
to obtain a maximum bit rate. Than
T f N
s
(7)
The incoming signal is windowed by a rectangular window of length N. The rectangular
window shape and the window length N are necessary to accomplish maximum frequency
differentiation.

Lets establish an index i for indexing each signal window and the corresponding
variables.
The computation of F
0
(i) and F
1
(i) and consequential comparison is done for each signal
window:
i F i F i b
0 1
(8)
The approximate beginning of the data burst is set from the signal window where the
instantaneous value S
B
(i) crosses the doubled value S
A
(i):
i S i S
A B
2 (9)
S
B
(i) is a short-term sliding average of the sum of F
0
and F
1
. S
A
(i) is a long-term sliding
average of the sum of F
0
and F
1
. The sliding averages S
A
(i) and S
B
(i) are computed in each step
as follows:
( i F i F i S i S
1 0 B B B B
1 1 , (10)
if 1 2
A B
i S i S then
( i F i F i S i S
1 0 A A A A
1 1 (11)
otherwise S
A
is not updated: S
A
(i) = S
A
(i-1).

and

are Forgetting Factors less than but


close to 1.

>

makes the S
A
long-term sliding average and S
B
the short-term one.

In order to achieve synchronization between the window and the signal element, a
synchronization byte is transmitted in the head of each data burst. The synchronization byte is
formed by a bit sequence [1 0 1 0 0 1 0 1]. The transmitter and receiver clocks are supposed to
be precise enough to maintain this synchronization during the whole data burst.
The best fit to the synchronization sequence is computed as the position where the
divergence between sequence b of the F
0
(i), F
1
(i) comparison results and the interpolated
synchronization bit sequence is minimal
SYN min of index idx (12)
where
(

110011 1100110000 XOR b i SYN (13)


in the case of a 50% window overlap (in this case the synchronization bit sequence has to be
interpolated 2:1).

Let's discuss three of possible variants of implementing the FSK demodulation algorithm.

Continuous variant
The signal window is moved by 1 sample. The synchronization bit sequence has to be
interpolated in the ratio N:1. Then, the repeated computation of (12) is very strenuous but the
result of synchronization is very precise. After this synchronization, the signal can be
windowed accurately with the signal element positions and each of the F
0
(i) and F
1
(i)
comparison results can be directly added to MSG.

Variant 3:1
The incoming signal is windowed with a 33% overlap. The synchronization to the
start-bit sequence sets triplets of windows corresponding to 1 signal element. When 2 or 3 of
the comparison results b(i) within this triplet indicate bit 1, bit 1 is added to the MSG output
sequence. Otherwise, (when 2 or 3 indicate bit 0) bit 0 is added.

Variant 2:1
The incoming signal is windowed with a 50% overlap. The synchronization to the start
bit sequence sets pairs of windows corresponding to 1 signal element. When both of the
comparison results b(i) within this pair indicate the same bit, this one is added to the MSG
output sequence. When each b(i) indicates a different bit, the decision if [1 0] will be resolved
as 1 or 0 in MSG and [0 1] as 0 or 1 is based on the following idea: One of the signal windows
within the pair can overlap the neighbor signal element by a minor but significant part. In a
noisy environment this can cause the b(i) of this window to sometimes indicate that the bit was
transmitted by the
neighbor signal element
instead of the
corresponding signal
element. The decision
about which one of the
windows within the pair is
the one more significantly
overlapping the neighbor
signal element, can be
found from the
comparison of SYN(idx-1)
and SYN(idx+1). If
SYN(idx-1) > SYN(idx+1)
then [1 0] is resolved as 0
and [0 1] as 1.
-30 -25 -20 -15 -10 -5 0 5 10
0
10
20
30
40
50
SNR [dB]
b
i
t
-
e
r
r
o
r
r
a
t
e
[ %
]
Figure 2. Bit-error rates of Continues Variant (solid line), Variant 3:1
(dotted line) and Variant 2:1 (dashed line) in comparison to quadrature
demodulator [3] (dash-dot line).


bit
error
rate
[%]
III. RESULTS
The Figure 2 shows simulation results. Three discussed variants of FSK demodulation
based on DFT and the traditional quadrature demodulation [3] were tested during an escalating
signal-to-noise ratio (SNR). The DFT-base demodulation gives a 15dB rise to the SNR.
IV. DATA RECEPTION ALGORITHM MODEL
The model of the whole data reception algorithm is illustrated in Figure 3.
waiting for data burst start
INITIALIZATION
synchronization to start sequence
data reception
decimation to out 1/0 sequence
N
o

d
a
t
a

-

f
a
l
s
e
r
e
c
e
p
t
i
o
n
D
a
t
a

b
u
r
s
t
r
e
c
e
i
v
e
d
No data
No start
sequence

Figure 3. Model of data reception algorithm
V. IMPLEMENTATION
The algorithm is primarily devoted to a power-line modem application with
preconditions f
0
= 100 kHz, f
1
= 110 kHz, f
s
= 500 kHz. Power-lines are a very noisy
environment with heavy impulse interference. The data reception and demodulation algorithm
together with a control application (including bit-error checking, communication routines, etc.)
is running on a single low-cost Motorola DSP 56F801 [2].
VI. CONCLUSION
Three FSK demodulation algorithms based on the DFT were described and discussed.
These algorithms together with the described signal detection and synchronization procedures
form the basis for a single-chip modem implementation on a DSP. This approach has the
following important advantages:
N The number of hardware components is reduced to a minimum, replacing them by pieces of
software,
N The frequency of a signal element can be determined by a mathematical computation (DFT)
that is an ultimate solution for a noisy environment, and
N The output of the algorithm is the transferred message - not only a binary signal.
REFERENCES
[1] Fuquin Xiong: Digital Modulation Techniques. Artech House, 2000. ISBN 0-89006-970-0.
[2] DSP 56800 Family Manual, Motorola, Inc., 2000
[3] FSK Modulation and Demodulation With the MSP430 Microcontroller, Application
Report, Texas Instruments Inc., 1998.

You might also like