information to users or - university of toronto t-space · 4.3.2 spreader and despreader ..... 64...
TRANSCRIPT
INFORMATION TO USERS
This manuscript has been reproduω from the microfilm master. UMI films the
text d i r d y from the original or copy submitted. Thus, some thesis and
dissertation copies are in typewriter face, mi le others m y be from any type of
cornputer pn'nter.
The quality of this reproduction is dependent upon the quality of the copy
submitted. Broken or indistinct print, cdored or poor quality illustrations and
photographs, @nt bleedthrough, substandard margins, and improper alignment
can adversely affect reproduction.
In the unlikely event that the author did not send UMI a complet0 manuscript and
there are missing pages, these will be noteû. Also, if unauthorized copyright
material had to be removed, a note will indicate the deletion.
Oversize materials (e.g., maps, drawings, charts) are reproduced by sectioning
the original, begiming at the upper left-hand corner and continuing from left to
right in equal sections with srnall overîaps. Each original is also photographed in
one exposure and is induded in reduced fom at the back of the book.
Photographs incîuded in the original manuscript have been reproduced
xerographically in this copy. Higher quality 6 x 9" black and white photographie
prints are avaiiable for any photographs or illustrations appearing in this copy for
an additional charge. Contact UMI diredly to order.
Bell & Houdl Information and Leaming 300 North M Road, Ann Arbor, MI 48106134û USA
-521-
WIRELESS CYCLICALLY PERMUTABLE CODE
BASED EMG SYSTEM FOR ASSISTIVE DEVICES
Raphael C. Wong
A t hesis submitted in conformity with the requirements
for the Degree of Master of Applied Science,
Department of Electrical and Cornputer Engineering,
and The Institute of Biomedical Engineering,
at the University of Toronto
@ Copyright by Raphael C. Wong 1999
National Library Bibliothèque nationale du Canada
Acquisitions and Acquisitions et Bibliographie Services services bibliographiques
395 Wellington Street 395, nie Wellington Ottawa ON K1A ON4 Ottawa ON K1 A ON4 Canada Canada
The author has granted a non- exclusive Licence allowing the National Library of Canada to reproduce, loan, distniute or sell copies of this thesis in microfom, paper or electronic formats.
The author retaias ownership of the copyright in this thesis. Neither the thesis nor substantial extracts fiom it may be printed or otherwise reproduced without the author's permission.
Your fib Votre riYmce
Our fi& Narre roiémw
L'auteur a accordé une licence non exclusive permettant a la Bibliothèque nationale du Canada de reproduire, prêter, distribuer ou vendre des copies de cette thèse sous la forme de microfichelfilm, de reproduction sur papier ou sur format électronique.
L'auteur conserve la propriété du droit d'auteur qui protège cette thèse. Ni la thèse ni des extraits substantiels de celle-ci ne doivent être imprimés ou autrement reproduits sans son autorisation.
Wireless Cyclically Permutable Code Based EMG System for Assistive Devices
Raphael C. Wong
Master of Applied Science
Department of Electrical and Computer Engineering
and The Inatitute of Biomedical Engineering
University of Toronto
1999
Abstract
The problem of transmitting an EMG (Electromyogram) on a wireless channel, in a multi-
user environment, is addressed in this thesis. The use of CPCs (Cyclically Permutable Codes)
as channel accessing protocol sequences is investigated as a solution. The main objective is
to design a CPC such that, when it is used as a multiple access protocol with asynchronous
users and without feedback, reliable communications is possible. Furthermore, the CPC must
be suitable for the intended application, which requires the transmission of measured EMG
for communications with and control of assistive devices. Cornparison of nine families of
CPCs, as well as results from a programmed microcontroller using a CPC, wili demonstrate
that they are an effective solution to the problem. A secondary objective is to illustrate the
feasibility of using CPCs in a system solution to the problem. This wiil be demonstrated
by the specification of al1 relevant communications parameten of a myoelectric transceiver
system. The CPC that is used in the system, is a CPC(N = 272, Mc = 17, d, = 28) which
are respectively the Iength, family size and cyclic Hamming distance of the code.
Acknowledgement s
1 would like to thank my supervisors Elvino S. Sousa and Stephen Naumann for their support
and guidance. I would dso like to thank Isaac Kurtz, Gilbert Chau, John Bishop and Edward
Mah for their helpful suggestions.
Most of d though, to my parents who have always supported my decisions and given
me strength through theù love and encouragement.
Lastly, this research was made possible through financial assistance provided by the
Natural Sciences and Engineering Research Council of Canada.
Contents
Abstract
Acknowledgement s
List of Figures
List of Tables
iii
vii
List of Acronyms x
1 Introduction 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Biotelemetry 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 Myoelectric Signai 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 MultipleAccess 4
. . . . . . . . . . . . . . . . . . . . . . 1.2.1 Time Division Multiple Access 5
. . . . . . . . . . . . . . . . . . . 1.2.2 F'requency Division Multiple Access 6
. . . . . . . . . . . . . . . . . . . . . . 1.2.3 Code Division Multiple Access 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.4 Random Accessing 8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.5 Myoelectric System 8
. . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Cyclicdy Permutable Codes 9
. . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Motivation and Application 12
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Objectives 13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Assumptions 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7 Thesis Ovenriew 14
Protocol Sequence Construction 16
2.1 Preliminaxy Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2 Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.1 CPC Construction from a Reed-Solomon Code . . . . . . . . . . . . . 18
2.2.2 Construction Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.3 Performance Cornparison . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3 CPC Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3.1 MS Transmit Functions . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.3.2 BS Receive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.4 ChapterSummary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3 System Design 37
3.1 Data Link and Medium Access Control . . . . . . . . . . . . . . . . . . . . . 37
. . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Medium Access Control 37
3.1.2 Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.1.3 Reverse Link and Forward Link Framing . . . . . . . . . . . . . . . . 40
3.1.4 Cal1 Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2 Physical Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Source Coding 44
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Channel Coding 45
3.2.3 bIodulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.2.4 Chip Rate and Received Power . . . . . . . . . . . . . . . . . . . . . 48
3.2.5 System Efficiency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.3 Channel Mode1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.3.1 Path Loss and Shadowing . . . . . . . . . . . . . . . . . . . . . . . . 53
3.3.2 Multipath Propagation . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.3.3 Antenna Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.4 LinkBudget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5 Chapter Surnmary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4 Circuit Design 61
4.1 MS Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Anaiog Processing 63
. . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Instrumentation Amplifier 63
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.2 Filters 63
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Digital Processing 63
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Microcontroilers 63
. . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 Spreader and Despreader 64
. . . . . . . . . . . . . . . . . . . . . . . 4.3.3 Modulator and Dernodulator 64
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4 Antenna 65
. . . . . . . . . . . . . . . . . . . . . . . . 4.4 Layout and Printed Circuit Board 65
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Power Consumption 66
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Chapter Summaxy 69
Conclusions 70
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 CPC Design 70
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 System Design 71
. . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Schematic and Circuit Layout 71
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 FutureWork 72
References
A Cyclically Permutable Codeword Data
B Assembly and C Code 82
. . . . . . . . . . . . . . . . . B.l Microcontrol~er Code for the MS Reverse Link 82
. . . . . . . . . . . . . . . . . B.2 Rflicrocontroller Code for the BS Forward Link 93
. . . . . . . . . . . . . . . . . . B.3 Reed Solomon to CPC Conversion Program 99
List of Figures
. . . . . . . . . . . . . . . . . . . . . . 1.1 Neuron and Muscle Fibre Innervation 3
1.2 Time Division and F'requency Division Multiple Access . . . . . . . . . . . . 6
1.3 Code Division Multiple Access . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Partial Packet Collisions with Asyochronous Users . . . . . . . . . . . . . . . 10
1.5 Application Scenarios in the System Design . . . . . . . . . . . . . . . . . . 13
2.1 Performance of CPCs Based on RS codes . . . . . . . . . . . . . . . . . . . . 24
2.2 Transmission Rate of CPCs Based on RS codes . . . . . . . . . . . . . . . . 26
2.3 Histogram of Cyclic Cross-Correlations for CPCs . . . . . . . . . . . . . . . 28
2.4 Flow diagram of MS Transmit Algorithm . . . . . . . . . . . . . . . . . . . . 31
2.5 Flow diagram of BS Receive Algorithm . . . . . . . . . . . . . . . . . . . . . 33
2.6 Microcontroller Output for One Protocol Sequence Cycle . . . . . . . . . . . 34
2.7 One Time Slot of the Protocol Sequence Cycle . . . . . . . . . . . . . . . . . 35
3.1 Fonvard and Reverse Link Frequency Allocations . . . . . . . . . . . . . . . 39
3.2 Data Framing for the Foverse Link . . . . . . . . . . . . . . . . . . . . . . . 40
3.3 Data Framing for the Forward Link . . . . . . . . . . . . . . . . . . . . . . . 41
3.4 Demodulator Decision Regions . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.5 Probability of Error vs . SNR . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.6 Mobile and Indoor Propagation Environments . . . . . . . . . . . . . . . . . 52
3.7 Path Loss with Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.8 Multipath Simulations with Varying LOS and Mobile Speed . . . . . . . . . 57
4.1 Circuit fiom Advanced Schematic . . . . . . . . . . . . . . . . . . . . . . . . 62
4.2 Physical Size of Myoelectric Transceiver PCB . . . . . . . . . . . . . . . . . 66
vii
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Top Signal Layer 67 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Top Sihcreen Layer 67
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Bottom Signal Layer 68
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Bottom Silkscreen Layer 68
List of Tables
. . . . . . . . . . . . . . . . . . . . . . . 2.1 Non-zero Field Elements of GF(17) 19
. . . . . . . . . . . 2.2 Codeword and Information Coefficients for RS(16.3. 14) 22
. . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Reed-SolomonCode Parameters 25
. . . . . . . . . . . . . . . . . . . . 2.4 Mean Cyclic Cross Correlation for CPCs 27
. . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Selected Elements of GF(~'O) 46
. . . . . . . . . . . 3.2 Path Loss Exponent and Shadowing Standard Deviation 54
. . . . . . . . . . . . 3.3 Parameters Used For Determining the Radiated Power 55
. . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Systern Parameter Summary 60
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.1 CPC Data 78
List of Acronyms
ALS ........... Arnyotrophic Lateral Sclerosis
AMPS ........ Advanced Mobile Phone System
A P . . .......... Action Potential
BC H .......... Bose-Chaudhuri-Hocquenghem
BER.. ........ Bit Error Rate
BPSK. ........ Binary Phase Shift Keying
BS ............ Base Station
CDMA ....... Code Division Multiple Access
CELP ......... Code-Excited Linear Prediction
CNS .......... Central Nervous System
CPCS ......... Cyclically Permutable Codes
CSMA/ CA ... Carrier Sense Multiple Access/Collision Avoidance
DECT ........ Digital European Cordless Telephone
EMG ......... Electromyogram
ERP .......... Effective Radiated Power
FD D .......... Frequency Division Duplexing
FDMA.. ...... Fkequency Division Multiple Access
X
GS M . ......... Global System for Mobile Communications
IS M ........... Industrial, Scientific and Medical
LO ............ Local Oscillator
LOS .......... Line of Sight
........... ME Myoelectric
MS ............ Mobile Station
MUAP.. ...... Motor Unit Action Potential
PCB .......... Printed Circuit Board
PHP .......... Japanese Personal Handy Phone
P N . . .......... Pseudonoise
RF. ........... Radio Frequency
RS ............ Reed-Solomon
SNR .......... Signal to Noise Ratio
TACS ......... Total Access Communication Systems
TDD .......... Time Division Duplexing
TDMA ....... Time Division Multiple Access
Chapter 1
Introduction
Biomedical engineering is a field that applies engineering practice to design and develop
devices for use, primarily in the medical and rehabilitative industries. Several well known
examples are computer tomogaphy, the pacemaker, and human prostheses. Biotelemetry,
or the wireless transmission of physiological signals is another example, with a history span-
ning several decades. The common property that al1 these devices share, is that they were
designed for the purpose of solving a specific problem, or fulfilling a need. For exarnple, some
of the first applications of biotelemetry, were created to overcome the problem of tracking
animal species in their naturai habitat. More recently, biotelemetry has been used in hospi-
tais, to permit doctors and nurses to conveniently enter data into a computer remotely, using
wireless hand held terminais. In this thesis, a solution is sought to the problem of trans-
mitting a muscle electromyographic EMG signal between two points, on a wireless channel.
Using a comrnon communications term, the first point will be called the MS (Mobile Sta-
tion). As suggested by the name, the MS is not h e d and is permitted to move about freely.
The second point will be called the BS (Base Station). Our use of the term here, differs
fiom the conventional meaning in that, the BS is also free to move about. The purpose of
using separate terms, is that the BS will be considered the point which is not limited in
power, complexity and size, whiie the converse is tme for the MS. Returning to the prob-
lem, an additional requirement is imposed such that multiple MS-BS pairs be permitted to
cornmunicate sirnultaneously. This f o m of communication is known as multiple accessing.
The objective now becomes that of transmitting an EMG between a
multiple access protocol. There are several methods for implementing
MS-BS pair, using a
multiple access corn-
munications, which generally belong to one of four categories: FDMA (Frequency Division
Multiple Access) , TD MA (Tirne Division Multiple Access) , CDM A (Code Division Multiple
Access) and Random Accessing. Although it is possible to irnplement any one of these in
order to meet the objective, this thesis focuses on a f o m of Random Accessing as a solution
to the problem. The following now, is a summary of these concepts and ideas.
1.1 Biotelemetry
Many of the first applications of wireless techniques to biological systems were in the field of
biotelemetry. The most widely used method of transmission has been modulation of an RF
(Radio Frequency) carrier wave, and is more accurately classified as radiotelemetry. However,
there have been numerous attempts at using other techniques as well. For example, several
devices have been developed, that use infrared, inductive loop, and ultrasonic transmission [l,
21. Biotelemetric systems are used in a wide variety of fields by people such as biologists, field
scientists, biomedical engineers and medical personnel. Field scientists were among the first
to employ biotelemetry because of the significant benefits it offered, for example, in tracking
many types of animal species, including insects as srna11 as locusts [3]. Wireless transmission
also permits more effective recording of movement, habitat patterns, health, and population
counts of endangered species. For medical personnel, the use of biotelemetry has primarily
been in the remote measurement of patients' physiological parameters. One novel application
is described by Hofmann [4] where, at the scene of an accident, patients' vital signs are
immediately transmit ted back to the hospital for preliminary diagnoses. O ther modern
applications in the hospital include patients who may have their heart rate continuously
monitored at a central station while they are fiee to move about. In biomedical engineering,
biotelemetry has also been used to evaluate patient movement, such as gait analysis, during
rehabilitation [5-71.
For some applications such as animal tracking, biotelemetry is considered almost a neces-
sity to solve a specific problem. In others, its use must be justified and is often determined
on the basis of a cost-to-benefit ratio to the user and/or operator of the device. For example,
one of the possible benefits is safety. Many types of equipment which are not mobile use
a conventional AC (Alternathg Current) energy source. The high voltages (greater than
11OVAC) and currents used pose a potential hazard that could be caused by equipment
Muscle Fibre
Spinal Cord
Figure 1.1: Neuron and Muscle Fibre Innervation [8]
failure. Conversely, transmi tters that are battery powered usually operate at low voltages,
and thus the currents involved pose minimal to no danger. Another safety concern is the
danger from tripping or being entangled in loose wiring. Persons are no longer tethered to
equipment , t hereby increasing t heir fieedom of movernent . W ireless devices are also more
aesthetic, which is important in their use in rehabilitative and assistive technology. For the
operator there may be potential disadvantages such as initiai implementation costs, how-
ever, these may eventually be offset by other savings. For example, in the hospital more
patients may be continuously monitored by fewer staff, and overall costs may be lowered by
a reduction in patient safety issues. These advantages and disadvantages are factors when
considering the use of biotelernetry. For the specific problem addressed in this work though,
it is the only choice available, since a wireless solution is desired. Next, it is necessary to
have a basic understanding of the EMG signal itself, to appreciate the issues involved with
transrnitting it.
1.1.1 Myoelectric Signal
The physiological parameter of interest is known as a MUAP (Motor Unit Action Potential).
A motor unit is composed of a neuron and d l of the muscle fibres that it innervates, which is
illustrated in Figure 1.1. The initiation of a muscle contraction begins in the CNS (Central
Nervous System), which includes the spinal cord. When adequate stimulation from the
CNS occurs, a wave of depolarization known as an AP (Action Potential), begins at the ce11
body, travels dong the axon and ends at the axon terminais. This AP, through a chernical
messenger, changes the permeability of the muscle fibre to certain ions. It is the subsequent
movement of these ions through the fibre membrane that eventuaily creates the MUAP.
These steps describe the conditions in a single fibre, but as Figure 1.1 illustrates, a motor
neuron is made of many innervated muscle fibres. It is the cumulative effect of all these
motor neurons that creates the EMG signal, which may be measured at the surface of the
skin, or subcutaneously. EMG is also different fiom the action potentiais created by other
muscle types, such as cardiac muscle.
Although the amplitude of a recorded EMG signal and the amount of muscle fibre re-
cruitment is a non-linear relationship, its value still provides an indication of the strength
of contraction. As a result, it is often used to control, for example, closure and opening of
a prosthetic hand. ME (Myoelectric) signals are measured using two broad classifications of
electrodes; needle and surface. Because of their close proximity to the fibres they innervate,
needle electrodes produce recordings frorn a small group of motor units. Surface electrodes
however, measure the cumulative effects of a larger group of motor units. Surface electrodes
are widely used in prostheses and other assistive devices because of their ease of application
and non-invasive nature. It was previously stated that the EMG would be transmitted be-
tween a MS and BS pair. To be concise, we now restrict the EMG to originate only from the
MS. Furthemore, the term MS will be used interchangeably with the term surface electrode,
or simply, electrode.
Once measured, the ME signal must usually undergo some signal processing before usage.
As a time domain signal, the surface EMG may be analyzed similar to any voltage V(t) or
current I(t) signal. It is both non-periodic and non-linear, with fluctuations similar to that
of a random signal. In the frequency domain however, it has been detemined that the
majority of signal power falls between 10-400 Hz (21.
1.2 Multiple Access
In order to solve the problem addressed in this thesis, a sufficient solution would consist
entirely of the description of a suitable multiple access technique. For a biotelemetric device
to be usefùl, however, it must be designed fiom the perspective of a complete system. In this
work, a complete system will incorporate other elements in addition to multiple accessing.
Some of these are the frequency of operation, the designed distance between a MS-BS pair,
device size, power and complexity. Each of these factors adds a constraint to the overall
system, which in turn, will make some multiple access solutions more attractive than others.
Multiple access situations occur when two or more users transmit over a cornmon trans-
mission medium. The medium may be wired or wireless, and some examples are copper,
fibre optic cable, and free space. When multiple access occurs, some forrn of mediation or
protocol must be used to resolve the issue of contention [9]. For example, what would happen
if two identical transceivers were to operate at the same time, within close proximity to each
other? In al1 likelihood, the communications would become unreliable due to interference.
Fortunately, this problem has existed in the communications field since its very beginnings,
and thus, solutions exist. A multiple access protocol rnay be thought of as a r d e which al1
transmitten in the system must follow. Each transmitter rnay not know (or even care) about
the presence of other users; what it does know is the rule specifying when or what it may
transmit. The details of how the protocol works are also unimportant to the transmitter
Information is simply transmitted from point A to point B. To the designer however, these
details are critical, thus we now present the four main protocols in use today.
1.2.1 Time Division Multiple Access (TDMA)
A very common method for multiplexing usen is called TDMA. TDMA divides a period of
time (a frame) into non-overlapping time slots, which are then assigned to individual users.
Figure 1.2a illustrates this with respect to several active transmitters. There is no restriction
on the duration of each slot, but they are normally equal. TDMA is an effective solution
to the multiple access problem, but it requires the synchronization of users. Precise timing
is very critical because, without perfect synchronization, slots from different users would
overlap, causing errors to occur. One limitation of TDMA is evident when transmitting
data that are bursty in nature. By bursty, it is meant that the information to be sent tends
to be generated in clusters, with varying periods of (sometimes lengthy) silence in between.
During these periods of silence, a dot is still assigned to the user, even though it has nothing
to transmit. This results in an overall reduction in the system efficiency. The practicd upper
limit as to how many users may be accommodated in a frarne depends on the maximum bit
Time Slots Frequency [MHz]
Figure 1.2: (a) TDMA frame with 4 slots. (b) FDMA with 1 MHz/channel allocation
rate of the individual transmitters and the channel capacity. The maximum bit rate of a
transmit ter is generally a function of its hardware processing speed. The channel capacity,
meanwhile, is a theoretical limit on the maximum bit rate that may be transmittable without
error, and is a function of the medium used.
1.2.2 Frequency Division Multiple Access (FDMA)
FDMA permits multiple users to communicate within the same geographic area by assigning
a distinct channel (frequency bandwidth) to each. The amount of bandwidth assigned does
not necessarily have to be equal, but it is usually convenient to do so. Figure 1.2b is
an example of a %MHz bandwidth, divided into lMHz channels. FDMA is familiar to
anyone who has used a conventional cordless phone. When the quality of the conversation is
degraded, one usually changes channels in hope of avoiding interference. One advantage of
using FDMA, is that it does not require the synchronization of users. It also has the same
disadvantage as TDMA, in regards to transmitting bursty data. Once allocated to a user,
the channel resources are held for the duration of the transmission, even if it is punctuated
by long periods of silence. The limit as to how rnany users may be accommodated in a
total bandwidth is only dependent on bandwidth occupied by each user. As the individual
requirements decrease, additional bandwidth becomes available for new users.
S y nchronous:
User 1 1 9-1 II r
Asynchronous:
User 1 1 user 1
(a) (b)
Figure 1.3: (a) Spreading by Code Division (b) Synchronous vs. Asynchronous Transmission
1.2.3 Code Division Multiple Access (CDMA)
Another multiple access technique currently used is called CDMA. We begin by introducing
two concepts, the Brst of which is white noise. As a function of time, it has an amplitude that
is both continuous and random. When plotted as a function of frequency, its random nature
causes the amplitude spectrum to be relatively Bat and also very wide. The second concept
is that of PN (Pseudonoise). A PN sequence is a sequence of 1's and 0's that has no obvious
pattern and thus appear randorn. In actuality, however, the sequence is deterrninistic since
it may be generated mathernatically, giving rise to the term pseudorandom. If, in a given
bandwidth of interest, the rate at which these 1's and 0's are generated (called the chip rate)
is sufficiently high, then the amplitude spectrurn will appear to be very much like that of
noise.
Now, begin with a data sequence, i(t), of 1's and 0's at a fked bit rate, and a PN
sequence, c(t), with a chip rate that is greater than the data bit rate. The operation of
multiplying these two sequences in time will produce a third sequence, r(t) , that occupies a
larger bandwidth with lower average power spectral density than the original data sequence.
This increase in bandwidth is called the processing gain. The greater the chip rate, relative
to the original data bit rate, the higher the processing gain will be, and the more the third
sequence will appear to be noise like in the frequency domain. This expansion of bandwidth
is illustrated in Figure 1.3a, and is the reason for CDMA being classified as a spread spectnun
technique. It is this spread noise-like signal that is transmitted. At the receiver, we assume
the original chip sequence c(t) used by the transmitter is known and, with proper phase
alignment, multiplying this received signal by c(t) and filtering, allows the original data
sequence i(t) to be restored.
Multiple users are accommodated by assigning different PN sequences (also called spread-
ing codes) to each. Furthermore, CDMA may be either synchronous or asynchronous. These
two situations are illustrated for the case of two usen in Figure 1.3b. The limit as to how
many users rnay transmit concurrently is dependent on the amount of interference at a given
receiver. Each additional user adds to the totai amount of interference at the receiver which
at some point, will prevent the correct restoration of the orignal data sequence. A good
reference on CDMA is by Viterbi [IO], or for general spread spectmm techniques, Peterson
et al. [Il]
1.2.4 Random Accessing
As mentioned earlier, al1 multiple access techniques have mles which govern when or what
users may transmit. This is also true for random access methods despite what its narne
suggests. Random accessing is usually used when the transmitted data are bunty in nature.
Furthermore, it is cornmon to transmit these type of data in the form of packets. A packet
contains the information bits to be transmitted, as well as additional bits for identification
and possibly other functions. For a random access technique to be effective, it must use a
strategy of prevention, recovery and/or avoidance of collisions between the packets sent by
users. The Ethernet is a packet oriented protocol used between networked computers that
is a random access technique. In Ethernet, the strategy is not to avoid collisions, but rather
detect them when they occur and then retransmit with a random delay [9]. Synchronous
transmission is also possible using random accessing. One example is that of Slotted Aloha.
In this technique, a single system clock known to al1 users is used to determine the boundaries
of time slots, and every packet transmitted must fa11 exactly within a time slot.
1.2.5 Myoelectric System
The first step in meeting the objective of this thesis is to specify a suitable multiple access
technique. This multiple access method must then be designed within a complete system.
We now justify this choice by the following facts. The EMG to be transmitted fiom the
MS to BS will definitely be bursty in nature. Even if one purposely intended to create a
sustained EMG, it would be impossible to maintain it for any reasonable duration of tirne
due to muscle fatigue. Furthemore, this situation should never occur if the device is used as
intended. It is also desirable to remove the requirement for user synchronism in the system,
since it would substantially increase the complexity of the design. Another advantage would
be if feedback, to acknowledge successfully received packets or to request a retransmission,
was not necessary. In the ideal case, the transmission would be completely unidirectional
and the design complexity would be reduced since reception capability would not be required
in the MS. It should also be noted that these constraints are set in hope of reducing the
design complexity, size and power of the MS. h o m these requirements, the approach used
is a fonn of random accessing based on cyclically permutable codes.
1.3 Cyclically Permutable Codes
As noted, any randorn access technique must have a rule for transmitting information from
point A to point B. Our approach is based on sequences of 1's and 0's that will be called
protocol sequences. A '1' means that transmission is allowed, while a 'O' means that the
transmitter must be silent. Let us begin with the case of two users who each wish to transmit
a single packet over the same channel. Since both can transmit at any time, we must be
resigned to the fact that if both transmit at precisely the sarne moment, then a collision will
cause both packets to be lost. This is unavoidable. Next, consider the case if both users
send their single packet twice, but we now require that they each transmit according to the
rule:
User 1: [l 1 O 01 User 2: [î O 1 O]
Using these two d e s , it is cleax that the first packet sent by both users will collide, but
the second packet will be collision fiee. Next, let us allow each rule to repeat indefinitely
in t h e ; in other words, cyclically. We also permit users to be asynchronous, therefore, the
actual d e s folIowed by user 1 and user 2 above, may be shifted in time. Thus, the following
User 1:
User 2:
Output:
Figure 1.4: Partial Packet Collisions wit h Asynchronous Usen
are the remaining possible cyclic shifts of the above sequences:
User 1: [O 1 1 O]
User 2: 11 O 1 O]
In every case, at least a single packet from user 1 and 2 will be collision free. We now consider
the case in which each packet represents a group of bits, that are of equal tength. In this
case, there now is the possibility of partial collisions. Using the sequences from Equation
1.1, this situation is illustrated in Figure 1.4. Although both of the packets from user 1 are
involved in a partial collision, the total nurnber of bits that are uncollided is equal to the
number of bits in a single packet. This will be true in al1 possible cyclic shifts. Summaxizing
this result; a nile has been illustrated that allows two asynchronous usen to guarantee that
a single packet will always be transmitted collision fiee by each. This is achieved with 100%
probability and without the need for acknowledgement or negative acknowledgement of the
transmit t ed packe t , by the int ended receiver.
Based on the above example, we now assume the existence of other protocol sequences.
Specifically of interest axe sequences that support more than two users. The requirement
now is a forma1 construction method and also a method of evaluating their performance.
Rom the literature, the majority of research into protocol sequences has been fiom the
area of error control coding theory, due to its sirnilarities. For example, returning to the
first sequence, it may be viewed as the transformation of a single bit [ 1 ] into four bits
[1 1 0 O] by the addition of redundancy. In error contml coding, redundancy is added
to source (information) bits to produce codewords. Thus, what has been previously referred
to as a d e may now be considered a code, and protocol sequences may now be considered
as codewords of the code. The following is now a summary of the research into produchg
codes with properties that make them highly suitable for use as protocol sequences in an
aspchronous multiple access environment.
One of the first researchers to study the problern of asynchronous transmission without
feedback was Gilbert [12]. His work was primarily in the area of cyclically permutable
codes. Such a code is by definition, a binary block code of block length N, such that each
codeword has cyclic order N (i.e., has N distinct cyclic shifts) and such that the codewords
are cyclically distinct (i.e., no codeword can be obtained by the cyclic shifting, one or more
times, of another codeword). In this paper a construction technique for these codes using shift
register sequences is developed. Following Gilbert's work, many researchers have atternpted
to improve on the performance of the codes in t ems of successful packets per transmitted
sequence. Others have viewed the performance in t ems of optimizing the total number of
codewords available, which is equivalent to maximizing the family size.
In the mid 80's, Mathys and Massey formally examined the asynchronous channel and
aptly named it the collision channel without feedback. This paper provides a good back-
ground into the mechanisms of how protocol sequences function and also provides some
simple constructions. Their aim was to define and determine the capacity of this channel.
They determined that when al1 users were signaling at the same rate (symmetricaily), the
capacity of the system was [13]:
where, Cs, = symmetric capacity ( packe ts/slot )
e = 2.718
M = number of users
This maximum capacity is very similar to the results of Huber and Shah [14]. In their work,
their calculations for the probability of a packet not colliding was e-L in the case of many
asynchronous t ransmitters.
The next usage of CPCs was as a class of sequences that permitted M-choose-T com-
munications. In other words, a random selection of T users fiom a total of M users, which
would be able to simuitaneously transmit over a common channel. Some constructions are
provided by Plotnik, Mathys and Bar-David et al. [E-l7]. It is exactly this type of commu-
nications that we axe interested in, since the codes are not constructed under the assumption
that every codeword from the family d l be used sirnultaneously. Unfortunately, Plotnik's
charnel accessing algorithm requires a feedback link to notify users of transmission failures,
while the latter two require synchronism between users.
Although not the first paper to provide construction techniques, the M-choose-T methods
developed by Nguyen et al. [18] are clear and are not constrained by requiring synchronism
between transmitters. Six different constructions are described in their paper, and are the
basis of the CPCs used in this thesis. More recently published work bas focussed on the
construction of optimal CPCs [19,20]. They are optimal in the sense that the maximum
nurnber of sequences is approached as the length of the sequences tends towards infinity.
Lastly, a brief cornparison of some of the better known constructions is provided by Lundqvist
[211*
1.4 Motivation and Application
The main motivation for this thesis was an observation that significant benefits in applica-
tions involving assistive devices could be achieved by using wireless communications. Fur-
thermore, these improvements could be directly applied to applications in use at Bloowiew
MacMillan Centre. The primary usen of such a device would be persons with extremely lim-
ited muscle control such as persons with ALS (Amyotrophic Lateral Sclerosis). In extreme
cases, they may have control of only their facial muscles. Among the applications envisioned
were, control of computer progams that provide a verbal communication link through single
click interfaces (such as on screen keyboards) and and the remote operation of devices such
as robotic arms. In addition to these applications, there would be additional benefits such as
portability and minimal invasiveness, arising £rom an unobtrusive design. Thus, there was
an overall need to design an electrode that would permit the transmission of raw rnyoelectric
signals by wireless means.
An illustration of possible application scenarios is shown in Figure 1.5. The figure also
contains three important characteristics of the assumed operating environment for the sys-
tem. These are:
1. Point to point links will be used between a BS and MS. In other words, at no point in
tirne will the MS be transmitting or receiving fiom two BSs simuItaneously.
Figure 1.5: Application Scenarios in the System Design
2. Transmission between the MS and BS will be largely LOS (Line of Sight). However,
the system is not limited to such situations, and will function without the presence of
a LOS.
3. Neither the BS or MS is required to remain stationary. However, it is expected that
considering the applications, a BS will typically be stationary, while the MS will be
stationary or moving slowly (i.e. less than 3m/s). The latter situation could occur, for
example, if the user needed to momentarily reposi tion him/herself, while continuing
to transmit.
1.5 Objectives
The main goal of this project is to solve the problem of transmitting a myoelectric signal
between two points on a wireless channel in the presence of other transmitters. hirthermore,
In order to demonstrate their implementability the results should be developed within the
cont ext of a wireless bioteleme t ric syst em.
An additional objective is to design the ME transmitter such that it may be fabricated
within dimensions of 25 x 18 x 9.5 mm (L x W x H). These dimensions correspond to
the Myobock 133125 electrode manufactwed by the Otto Bock corporation, which has been
designed to function within prostheses, and thus is not a wireless design.
1.6 Assumptions
Because the performance and design of a system is highly dependent on the hardware upon
which it is based, the following constraints are assumed hereafter. The majority of signal
processing is to be performed in software using a microcontroller(s) capable of 10 MIPS, with
1 kilobyte of EPROM for program storage, and 128 bytes of M M . These values are chosen
based on one of the fastest microcontrollers available fkom Microchip Corporation, which is
easily purchasable by the public. It is assurned that, in multiple access situations, users will
be transrnitting in a room approximately 300rn2. This size is based upon the foreseeable
usage of the device as a lineof- sight myoelectric transmitter. Assuming a circular coverage
area of 300m2, this corresponds to a maximum separable distance of approximately 10m
between the transmitter and receiver.
1.7 Thesis Overview
Following this chapter, the rest of the thesis is as follows.
Chapter 2 is devoted to the method and construction of the cyclically permutable code-
words, which are the basis of the multiple accessing scheme. Numerous codes and their
performances are examined with a focus on how various parameters may affect their imple-
mentation in a practicd system.
Chapter 3 provides the design details of a system consisting of a mobile station (the
eiectrode), and a base station (the desired control application). The design uses a CPC
for multiple accessing, however, many other parameters must be specified for a complete
system description. For each of these parameters the rationale behind its choice and, when
necessary, the theory involved will be explained.
Chapter 4 discusses a sample hardware construction based upon the designed system.
Each processing fùnction is described in a sequentiai manner, fkom the original information
source to its transmission hom the device. A printed circuit board is also designed, to
illustrate the practicality of the system with respect to size and cost.
Chapter 5 concludes with a summary of the results obtained and their consequences. Also
discussed are possible future enhancements and avenues of research which may be beneficial
in improving the performance of the biotelemetric system.
Chapter 2
Protocol Sequence Construction
Following the example given in the introduction, this chapter describes the method and steps
taken in constructing the CPCs used in the system design. Cornparisons are made between
the designed codes based on their weight, family size, codeword distance, cross-correlation
and ot her properties.
2.1 Preliminary Definitions
In the previous chapter, the concept of collisions between two users using protocol sequences
was introduced. This was extended to the transmission of packets and partial collisions. In
this chapter, we will restrict the discussion to collisions that completely overlap. For example,
it is not clear how a partial collision would be represented using two protocol sequences, but
in the case of a complete collision there is no ambiguity. The results, however, will be
applicable to both cases as proven by Mathys and Massey [13]. We now introduce the
following definitions:
Let the number of 1's in a protocol sequences be defined as the Hamming weight (w)
of the sequence. We assume that al1 users are assigned protocol sequences of equal
weight .
a For any two binary sequences, let the Hamming distance (d ) between them be dehed
as the number of positions in which they differ.
For any two protocol sequences, let the cyclic Hamming distance (d,) between them
be defined as the number of positions in which they differ.
0 For any two protocol sequences, let the correlation (p) , be defined as the number of
positions in which both contain a '1'.
When more than one user is simultaneously transmitting, let the total number of users
be defined as M .
For any two b i n q sequences of equal weight, the number of places in which both contain a
one is bounded by [la]:
For two protocol sequences of equal weight, this guarantees that less than w -dc/2+ 1 packet
collisions will occur. Given ll1 protocol sequences of equal weight, and selecting one, the
maximum number of collisions caused by the other (M - 1) sequences is (M - 1) (w - dJ2).
Considering the situation with M users each transmitting according to a unique but equal
weight w, protocol sequence; if we let cr represent the number of collision free packets each
user is guaranteed in one traversal of its protocol sequence (in which it transmits w packets),
then clearly, o = w - ( M - 1) (w - dJ2).
2.2 Cyclic Codes
The problem of random accessing without feedback using protocol sequences has been ex-
amined with the rnajority of literature focusing on Cyclically Permutable Codes. CPCs have
the following usehl properties, some of which are inherited from the linear cyclic codes from
which they are created:
m By a cyclic code, it is meant that all possible cyclic shifts of a codeword are also mem-
bers of the code. When used as a protocol sequence, this property allows transmission
to begin anywhere within a selected codeword.
rn All sequences are of equal weight. In this case, the Hamming weight (or number of
non-zero elements) is used. This allows 'faimess' in the sense that each electrode has
an equal number of opportunities to transmit.
The codes are designed to have a low cross-correlation. The correlation of two sequences
provides an indication of how (dis)similar they are in time. This property is beneficial
when the codewords are used to control multiple access to a channel. Although different
definitions for the periodic and cyclic cross-correlation between two sequences exist,
the following will be used for the remainder of this work:
where, A.,&) = the periodic cyclic cross-correlation between sequences a and b
as a function of r
T = the delay (or offset) between the sequences
n = the length of the sequences
It should also be noted that if in Equation 2.2 a and b are equal, then it represents the
autocorrelation of the sequence, and that the addition is performed modulo n.
2.2.1 CPC Construction fkom a Reed-Solomon Code
As evident €rom the introduction in Chapter 1, many authors have provided construction
methods for CPCs (1 2,13,19-2 11. The CPCs that will be used here, were originally developed
by Nguyen, Lisdo, and Massey [18]. This paper was used specifically because it provides
a method for choosing codewords from different equivalence classes. An equivalence class
consists of a codeword and al1 of its distinct cyclic shifts. In our application, only codewords
which are not from the same equivalence class may be chosen as protocol sequences. If this
were not the case, then any users from the same equivalence class, synchronized to the same
position within their protocol sequence, would invariably have their packets colliding 100%
of the time.
In this thesis, various performance measures of 9 CPCs constmted from 9 Reed-Solomon
codes were compared. We now illustrate the method of construction using an example. Based
on the parameten from Table 2.3 we choose RS9, a (n = 16, k = 3, d = n - k + 1 = 14) RS
code. First, in order to calculate the generator polynomial, the non-zero elements from Galois
Field GF(q=17) are needed. These are listed in Table 2.1. The general design criteria is
that the generator polynomial for a t-error correcthg code must have as roots 2t consecutive
-- -
Table 2.1: Non-zero Field Elements of GF(17)
powers of a [23]. Furthermore, the dimension of this code is k = q - 2t - 1 = 3. The
calculation for the generator polynornial g(x ) is as follows:
Element a8 a9 alo Cd1
Value 16 14 8 7
Element a0 a1 a* û3
Now that the generator polynomial for our RS code has been determined, we may proceed
to the next step in our CPC construction. Following Construction V by Nguyen et al. [18],
let V be our (16,3,14) RS code.
1. Choose an information vector u = [ua, ui, . , uk-11 such that uo = O and u1 = 1.
Value 1 3 9 10
Element a l2 al3
al4 al5
For example, using u = [ O 1 5 ] corresponding to an information polynomial of i ( x ) =
Value 4 12 2 6
O + x + 5x2, the codeword generated is given by:
Element a4 û5
a6 û7
Each RS codeword will eventually be used to produce a single unique protocol sequence.
Value 13 5 15 11
In other words, there is a one-to-one correspondence between RS codewords and the
protocol sequences. Furthermore, by forcing the first two coefficients of the information
polynomial to be O and 1 respectively, the effect is that each of the protocol sequences
belongs to a different equivalence class. The number of codewords in a RS code is
normally qk, however, Our restriction on the first two coefficients allows only qk-2
codewords to be generated. For RS9, this means that 17(~-*) = 17 unique codewords,
and hence, 17 unique protocol sequences wu be created.
2. Next we place the coefficients of c(x) into a row vector:
~ = [ ~ ~ c ~ ~ ~ ~ ~ ~ ~ ] = [ 0 1 0 1 0 1 2 2 1 5 1 6 0 2 1 6 1 1 1 5 1 1 8 f 2 5 ] (2-5)
We then construct a q-by-n matriv -4 such that the ith column of -4 has dl zeros except
for a 1 in position q-1 + 1. For example, using c above, column 1 of A is al1 zeros
except for a 1 in position co + 1 = 1, and column 16 of A is al1 zeros except for a 1 in
position cl5 + 1 = 6. Thus, the A matrix is given by:
3. The A mat& may now be used to produce a single codeword (protocol sequence)
B = [ bo bl - - - hwndI ] h m the CPC. Each element of A is placed in B as such:
When the last row of A is reached, r e t m to row 1 but continue to increment the
colwnn of A, and vice versa. This is also equivalent to performing the operation:
bi-l = A(i mod q, i mod n) 1 1 < i < (q x n) ( 2 4
The above A thus produces the codeword given by:
4. The above vector B represents a cyclically permutable codeword of length 272, weight
w = 16 with a cyclic distance of d, = 28 from al1 other codewords generated by the
same g (x) .
The previous calculations may be repeated to create al1 of the codewords in the CPC family.
The set of RS codewords used to generate the complete CPC family is listed in Table 2.2.
In order to automate this calculation, a C program was written which, when given an RS
codeword over the appropriate Galois Field, automatically creates the CPC code and writes
the result to a file. The program listing is provided in Appendix B.3.
2.2.2 Construction Method
The theorems and proofs Ieading to the development of the construction methods are exten-
sive and will not be reproduced here since they are available from the original paper [18].
Briefly, the methods begin with RS (Reed-Solomon) error correcting codes, from which the
CPCs are created. CPCs may also be created from other codes as well, such as BCH (Bose-
Chaudhuri-Hocquenghem) codes [22]. The foilowing sumrnarizes the three main steps used.
Information 1 Codeword 1 - - -
- Table 2.2: Codeword and Information Coefficients for RS(16,3,14)
1. Construct a (n, k, d = n - k + 1) Reed-Solomon code over a Galois Field of size p
where, n = length of a codeword
k = the number of information symbols in a codeword
d = Hamming distance of the code
2. Use the RS code to produce a family of CPC(N, Mc = T, d,) codewords
where, N = length of a codeword from the code
AlC = number of codewords in the CPC code
d, = minimum cyclic Hamming distance fiom a codeword to one of its own
distinct cyclic shifts or that of another codeword
3. The CPC(N, 1CI, = T, d,) code is then equivdent to a (T, M, N, O) protocol sequence
set. hrthermore, let w be the Hamming weight of each protocol sequence
where, N = length of each cyclically permutable codeword, also equivalent to the
length of each protocol sequence
T = the number of codewords in the CPC code, also equivalent to the
number of unique protocol sequences in the set
a = the number of collision free packets each user is guaranteed, upon a
single traversal of the protocol sequence
M = the number of simultaneously active users as a hinction of o and u
2.2.3 Performance Cornparison
Based on the above procedure, nine sets of possible CPCs were tabulated. These nine
candidate sets were not chosen arbitrarily, but based upon an a priori knowledge of their
codeword length. In other words, the product of the RS codeword length n, and the Galois
Field size p of the RS code, is equal to the CPC codeword length. It was estimated that
given the memory available on the microcontroller, codewords longer than 1000 would not be
implementable. The resulting data for the oine sets are listed in Table A.1 of the Appendix
while Table 2.3 lists the RS code parameters associated with their construction. The final
choice of CPC to use for the system was based on three performance measures.
The first was the success rate (alu), which is the ratio of guaranteed collision fiee
packets transmitted to the total transrnitted per user, per sequence iteration. The number
of guaranteed packets (O) depends partially on the total number of users simultaneously
transmitting (hl), while (w) is the weight of the protocol sequence. The maximum number
of permissible users may be determined using the following [18]:
Figure 2.1 is a plot of the success rate as a function of M. This figure may seem odd at first
because the number of data points for each CPC code is not necessarily equal. The proper
way to interpret the cuves is to first choose the number of simultaneous users that would be
transmitting. Next, any codes which do not extend to this value are automatically eîiminated
since their distance and weight properties would not guarantee even a single uncollided packet
for this many users. The remaining codes may then be cornpared. From the figure, it can
be seen that the highest performing code is produced by RS4. This code hm the highest
percentage of guaranteed packets per number of users sirnultaneously transmitting. Thus,
1 2 3 4 5 6 7 8 9 IO Users Sirnultaneously Transmitting
Figure 2.1: Performance of CPCs Based on RS codes
R-S Field Length of RS Information Cyclic Distance Length of Generated Code GF(p) RS Codeword (n) Symbols (k) of CPC (d,) CPC codeword (N) RSl 13 12 4 18 156
Table 2.3: Reed-Solornon Code Parameters
using this as the only measure of performance it would seem a rational choice to use this
code. Unfortunately, this performance cornes at the price of codeword length. This has
two consequences. First, for a software implementation, there is a practical upper bound
on the codeword length which a CPC should not exceed. The second and more important
consequence of the CPC code length is its effect on transmission rate.
Using this as the second performance measure, let the transmission rate be defined as [18]:
where, R,, = the transmission rate [% packets /slot]
M = the number of simultaneously active users, each using a unique codeword
from the same CPC
a = the number of collision free packets each user is guaranteed per fmme of
N slots. This is a lower bound assuming every user transmits continu-
ously.
N = the length of the CPC codeword
The tenn transmission rate, is somewhat misleading and does not directly refer to overall bit
rate of a system, as one might suspect. It is more accurate to consider Rsum as an indication
of how efficiently the communication Channel is utilized and as such, will zndirectly &t the
system bit rate. For two transmitters using different CPCs and operating at the same bit
rate, the one with the lower transmission rate will take a longer amount of time to transmit
1 2 3 4 5 6 7 8 9 Users Simultaneously Transmitting
Figure 2.2: Tkansmission Rate of CPCs Based on RS codes
the sarne amount of data as the system with the higher transmission rate. Alternatively,
the system with the lower transmission rate must transmit at a higher bit rate to take the
same amount of time as the other system. Again considering the software implementation
of a CPC, the maximum bit rate is generally limited by the processor speed. The data from
Appendix A.1 are again used to compare the CPCs and the result is illustrated in Figure
2.2. As the graph illustrates, for three to six simultaneous users, RS9 has by far the highest
transmission rate. For seven simultaneous users, only four of the codes (RS9, RS4, RS8
and RS7) d l guarantee even a single uncoliided packet in a frame, with the latter two only
doing so at a low transmission rate. Based on these results, RS9 and RS4 are the highest
CPC Created Idormation Information Mean Cyclic From Poiynomid 1 Polynomial 2 Cross Correlation RS1 x + lx2 + l0x3 lx + 5x2 + 7x3 0.92307 RS2 lx + 16x2 + 3x3 lx + 4x2 + 10x3 0.94117 M3 lx + 18z2 + 3x3 lx + 14x2 + i5x3 0.94736 RS4 lx + 27x2 + 15x3 lx + 4x2 + 8x3 0.96774 RS5 lx + 12x2 12 + 33x2 0.12359 RS6 l x + 15x2 l x + 3x2 0.47368 RS7 Ix + 50x2 lx + 28x2 0.24590 RS8 lx + 25x2 lx + l l x 2 0.48387 RS9 lx + 15x2 12 + 5x2 0.94117
Table 2.4: Mean Cyclic Cross Correlation for CPCs
perf'oming codes.
A third measure of the performance of CPCs for multiple access is the periodic cross-
correlation between family members for al1 cyclic shifts. It provides one measure as to
the 'uniqueness' between members of a CPC, which (will be seen) to be beneficial when
identifying different protocol sequences in the system design. There are several methods
of calculating the cross-correlation between two binary sequences. The one used in the
following result is given by Equation 2.2. The CPC families were compared by first creating
two codewords from each, using the Reed-Solomon codes RSI to RS9. The choice of which
specific codeword to create is unimportant, since every member has the same distance, weight
and length properties and thus will produce the same result. The correlation between these
two codewords was then cdculated for every possible cyclic shift. The results were then
cornpiled to produce a histogram in Figure 2.3 of the number of shifts that produced a
given correlation. In other words, bar O represents the number of shifts that produced zero
correlation, bar 1 represents the number of shifts that produced a correlation of 1, and so
on. Desirable properties for this distribution are a high ratio of zero correlation to non-zero
correlations as well as a low vanance about the zero point. Graphically, the ideal distribution
would be a single bar at point O. From the figure, it is evident that the CPCs created from
RS5 and RS7 axe the best, using this measure of perfo~mance. The lunitation of using the
histogram is that it does not take into account the fact that each CPC may not be of equal
length. The CPCs may be directly compared by using the mean cyclic correlation over ail
possible shifts. The results for this calculation are listed in Table 2.4, and reconfirms that
the CPCs created from RS5 and RS7 do in fact have the lowest average cross-correlation
over all cyclic shifts.
Summarizing the performance measures used, the following generalizations can be made
regarding the most appropriate choice of RS code:
1. It produces a CPC with a codeword length that may be implemented practically, based
on the system constraints. See Table 2.3.
2. It produces a CPC supporting enough multiple access users for the intended environ-
ment, at a high packet success rate relative to the other CPCs. See Figure 2.1.
3. The transmission rate of the CPC is high enough so that, when used as a protocol
sequence, the required bit rate is implementable. See Figure 2.2.
4. The CPC has a low mean cyclic cross-correlation, such that when its codewords are
used as protocol sequences for multiple access, they are easily identified. See Table 2.4.
In deciding which RS code to use, the performance measures from most important to
least were points 2, 3, 4 and then 1. Based on these observations, the decision was made
to use RS9 in the system design. Although, its cross-correlation, relative to the other codes
is high, it is acceptable when considering how well it compared with respect to the number
of users supported and the transmission rate. While this method of choosing the most
appropriate Reed Solomon code is acceptable for small groups (fewer than IO), a systematic
method should be applied when comparing many CPCs. One possible method would be by
assigning relative weights to the performance measures in order to calculate a single figure
of merit from which the highest performing code could then be chosen.
2.3 CPC Generation
Following construction of the CPC, an efficient real-time algorithm for traversing the protocol
sequence was required. Although, simpler to implement in hardware (using a linear feedback
shift register), a softwaxe solution was sought with the goal of reducing the physical size of
the MS. The resulting program is listed in Appendix B.1. Similarly, a second program was
also required for receiving the packets transmitted by the MS. This is listed in Appendix
B.2. The following sections briefly describe the a l g o f i t h used in the MS and BS.
2.3.1 MS Transmit Functions
The basic algonthm for the transmit functions of the MS is illustrated through a flow diagram
in Figure 2.4 and proceeds as follows:
1. The Microcontroller setup hinctions involve specifying the direction of the I/O pins,
choosing the Analog-to-Digital (A/D) pin, and configuring the rate of A/D conversion.
2. Variables used within the program are either cleared or set to an appropriate initial
value. Two special M M locations are defined. The first is seven consecutive memory
addresses which are used to store samples once they have been acquired and converted.
A buffer size of seven was chosen arbitraxily to ensure that the buffer would never
become empty even if several transmissions occurred within a short time. The second
is used to store the coefficients that are used to generate the CPC sequence. These are
the RS codeword coefficients produced by the product of the generator and information
polynomials as previously de tailed.
3. The duration of the CPC loop is precisely equivalent to a single time slot of the protocol
sequence. Furthemore, since the weight of the codeword used is 16 (equivalent to 16
transmit opportunities), sampling occurs at 16 regular intervals within one cycle of the
protocoi sequence.
4. As the algorithm traverses the protocol sequence, the value of the sequence indicates
whether data may be transmitted. When it is not allowed, (sequence is O), the algo-
rithm must essentially waste CPU processing cycles in order to maintain the periodicity
of the CPC loop.
The algorithm is not restricted to a single family of CPC codes (i.e. the ones used in the
system), subject to two constraints. The first is the amount of microcontroller RAM which
must store the initialization sequence for CPC generation. This is essentially a limitation
on the maximum weight of the code. The second limitation is the processor speed. As the
performance of the code increases, this usually cornes at the expense of the data rate. This
maximum rate, however, is determined by how many instructions are required to output the
data symbol on the microcontroiler pin and the CPU instruction cycle tirne.
Functions
I
Yes
4.
Wai t One Time Slot
A
Figure 2.4: Flow diagram of MS Tkansmit Algorithm
2.3.2 BS Receive Functions
The logical progression through the receive algorithm for the BS is illustrated in Figure 2.5.
1. The Microcontroller setup functions involve s p e c m g the direction of the I/O pins
and configuring the prescaler, which modifies the number of instructions to execute
between each unconditional interrupt (S tep 4).
2. Vanables used within the program are either cleared or set to an appropriate initial
value. One special RAM location is defined; it is seven consecutive memory addresses
which are used to store the received data symbols.
3. The main loop involves polling the data input pin until the correct MS header symbols
are received. It then stores the remaining symbols from the frame in memory. After
storing the frame, the algorithm resumes polling for header symbols.
4. Incoming data frarnes do not arrive at h e d intervals, but the baseband processing
blocks (such as Digital-to-Analog conversion) require the input data to be periodic.
This is the reason data are stored in rnemory rather than being output immediately
for further processing. The BS receive algorithm branches unconditionally to an inter-
rupt service routine after a fixed period of time to retrieve previously saved data for
further processing. This time period is currently set to the analog sarnpling rate of the
transmitting MS.
Following programming, the output from the transmitting MS was displayed on a logic an-
alyzer. Figure 2.6 is a screen capture of the analyzer for one complete cycle of the protocol
sequence. Rom the figure, each spike corresponds to a '1' in the protocol sequence. Ad-
ditionally, in Figure 2.7, the capture time has been reduced in order to illustrate a single
occurrence of a '1' in the protocol sequence. As illustrated, a single time slot is approxhately
24us in duration.
2.4 Chapter Summary
In this chapter, three measures of CPC performance were applied to 9 different codes. Using
these performance measures, the best overall code was chosen for the system design and a
/ Variable \ Initialization v
. - - - - - - - - - - - - - - - - - - - * - - - - i - i - - - - - - - a
. - * - - - - - - - - - - - - - - - * )_ - - * - - * - - - - - - - - - - . I
8
L
1
+ 8
: 4. Intempt Service 8
I
t
rn Routine 1
I
I
1
t
1
1
1
t
1
*
I
I
t
t
1
8
t
8
8
t
t
L
8
l
I
8
8
8
I
l
I
8
1 I l
1
1
I
8
l
.------------*----+-L----i--i---------+-riii----r,------,,---L----i--i---------+-riii----r,------,,--L----i--i---------+-riii----r,------,,----*--,,-------*-------------*
Figure 2.5: Flow diagram of BS Receive Algorithm
1 tlarkersl O f f Connect d o t s 1 On 1 1 Sample p e r i o d = 10.00 us s / ~ i v 1 1.000 ms 1 Delau 1 O s i Grid
Figure 2.6: Microcontroller Output for One Protocol Sequence Cycle
1-1- ~lsveforiis ( Autoscole ) ( , lu to-tîeosure ) ~ a r k e r s 1 O f f 1 Display -1 C o n n e c t d o t s I ~ I Sample p e r i o d = 40.0 ns s/DLv 1-1 D e l a y 1-1 Grid
2.50 V
I I
. , * , * * . I
f I 1 I 1 1 t 1 k
Figure 2.7: One Time Slot of the Protocol Sequence Cycle
full CPC farnily set was created for it. hrthermore, an algonthm for generating a protocol
sequence, while simultaneously performing analog-to-digital conversions, was designed and
implemented in a microcontroller. Lastly, an algorithm for receiving the packets of data wes
also designed and implemented.
Chapter 3
System Design
The purpose of this chapter is to specify the design parameters of a system for the control
applications described in Chapter 1. This design uses the Cyclically Permutable Code de-
signed in Chapter 2 to control multiple access to the channel. Rirthermore, enhancements
are described which permit robust communication and intelligent power usage. Using a
mode1 common to many data communications systems, the architecture may be partitioned
into, and defined in terms of a Data Link layer and a Physicd layer. It is also important to
investigate the channel in which the systern will operate in, because the channel is fixed and
cannot be altered by the designer.
3.1 Data Link and Medium Access Control
While the Data Link layer in general encompasses a broad range of parameters applicable
to many different systems, for our purposes only the framing of bits, the messaging involved
with the initiation and takedown of a MS-BS link, and the method of medium access control
are relevant.
3.1.1 Medium Access Control
The mechanism for sharing of the channel is based on a form of random accessing. The main
dinerence, however, is that feedback is not provideci by either the acknowledgment or negative
acknowledgement of transmitted data. A family of cyclicaliy permutable codes are used as
protocol sequences to control access. Furthemore, for reliable communications, each BS-MS
pair must be assigned a unique codeword from the CPC family. Once communications is
established between a MS and BS pair, the MS may transmit at will (while following its
protocol sequence). There is dso no requirement that a MS be synchronized in time with
ot her MSs simultaneously transmit ting; as a result, the communication is asyncbronous.
By removing the necessity for synchronization and feedback, the design (and consequently
hardware) complexity of the MS is reduced. The main limitation of using this CPC/protocol
sequence technique is that the capacity of the system is strictly lirnited.
The performance (in terms of total capacity) is highly dependent on the CPC family
used. The CPCs that may be used are in turn dependent on the available hardware/software
processing power. Following the initial constraints as set out in the introduction, the CPC
used in this system is a CPC(N = 272,1M, = 17, d, = 28). In other words, the family size
is 17, the length of the codewords is 272, the minimum cyclic Hamming distance is 28, and
by definition, each codeword belongs to a different equivalence class. This CPC(272,17,28)
is then used as a (T = 17, M = 7, N = 272, O = 4) protocol sequence. In other words,
for a maximum capacity of 7 simultaneous MS-BS pairs (from a total family size of 17)
that transmit 4 information packets per 272 slots in a single frame, 100% of the packets are
guaranteed to arrive uncollided at the intended receiver. To be precise, however, 4 packets
out of a total maximum of 16 are guaranteed uncollided and thus, a channel coding technique
is needed to code the 4 information packets into 16 transmitted packets. If the system is not
operating at full capacity (i.e. 7 MS-BS pairs), then the percentage of guaranteed packets
per kame increases. This may be seen from the CPC data tabulated in Table A.1 of the
Appendix. The coding details will be explained further in Section 3.2.
The CPC for a particular BS-MS pair is used only on the reverse link. The reverse link
is used primarily for t r a c (i.e. the EMG), while the forward link is used for initialization
and control commands. Rirthermore, initialization is only required at the beginning of a
BS-MS link and control commands are sent infrequently compared to the reverse link trafic.
Therefore, using a CPC (or TDMA, or FDMA) for multiple access on the forward link
would result in a significant amount of wasted processing effort. Thus, the decision was
made to use another form of random accessing called CSMAICA (Carrier Sense Multiple
Access/Collision Avoidance). When the BS wishes to transmit, it will first listen for activity
on the channel. If it detects another BS, it will wait for a period of tirne equal to the sum of
a fixed and random time. This technique uses the channe1 efficiently for low rate data that
may tolerate possible delays.
902 908 914 . -------- 926 927 928
3.1.2 Multiplexing
Reverse Li&
For the system in this work, there were two main choices for multiplexing the forward and
reverse channels. They were FDD (Requency Division Duplexing) and TDD (Tirne Division
Duplexing). FDD is used in many wireless systems such as CDMA, GSM (Global System
for Mobile Communications), AMPS ( Advanced Mobile Phone Sys tem) and TACS (Total
Access Communication Systems). TDD is used in the DECT (Digital European Cordless
Telephone) and PHP (Japanese Personal Handy Phone) systems. FDD is currently the
more popular solution for several reasons. One reason is a simpler frequency allocation
scheme in mobile systems, since a block of frequencies is simply assigned to each direction
of transmission. TDD is beneficial since the forward and reverse links use the same band,
however, additional issues involving timing must be handled in the design.
The decision to use FDD was made primarily to reduce the system complexity, especially
since the available bandwidth was not a primary constraint. The reverse channel is allocated
12 MHz of bandwidth between 902-914MHz, while the forward channel is allocated 2 MHz
between the 926-928MHz band. This is illustrated in Figure 3.1. It should be noted that
the designed centre frequencies need not be fixed to these particular values, as long as the
forwaxd and reverse bands do not overlap and remain between 902-928bfHz. The amount of
bandwidth in each direction was chosen to allow for sufficient spreading of the information
bandwidth. The 902-928MHz fiequencies are designated for unlicensed operation by Industry
Canada and the FCC. While the issue of licensing fees is unrelated to the system design,
saving the end-user any unnecessary additional cost is always beneficial. One constraint,
however, is that a spreading technique (FH or DSSS), is mandated by Industry Canada
and the FCC, to reduce interference to preeltisting ISM (Industrial, Scientific and Medical)
Figure 3.1: Fomard and Reverse Link Frequency Allocations
- - - - - - - - - Forward Link
272 Time Slots 4- 1 Information Symbol
160 Bits LU) Bits 40 40 40
-- -. 1 4 Info. Symbols 14 Redundancy Sym. 1 4 Redundancy Sym. 14 ~ e d u n d a n c ~ Sym. 1
4 Info. Symbols - 40 Bits 8 Bits 8 8 8 8 10 Bits
1 1 Redundancy Sym 1
Figure 3.2: Reverse Link. (a) 272 dot Protocol Sequence. (b) Framing of 160 Transmitted
Bits into Information and Redundancy Symbols
equipment. Details of the spreading are given in Section 3.2.3
3.1.3 Reverse Link and Forward Link Framing
The following are the details of the reverse link frame. The CPC used in the system has
a length of 272, thus, a single traversal through the protocol sequence consists of 272 fixed
length slots. The weight of the CPC code is 16, therefore, there are 16 opportunities to
transmit within the sequence. When data is transmitted, it is sent as a packet of 10 bits.
These 10 bits may be either information or redundancy, depending on its position within
the sequence. The reason for this is that the data are transmitted systematically, with the
first 4 transmitted slots occupied by information symbols and the remaining 12 occupied by
the redundancy symbols. A 10-bit information symbol is produced as foliows. Since it is
not necessary to send the &bit MS ID together with every &bit data sample, it is grouped
with four 8-bit samples to produce 40-bits of information. These 40-bits are then further
divided into four groups of IO-bit information symbols. These h e s of data are illustrated
5 5 3 8 10 Bits
Figure 3.3: Data Frarning for the Forward Link
in Figure 3.2.
The Framing for the forward link has a different structure. This is because of the difberence
in the multiple accessing scheme and the type of data transmitted. The BS uses a Frame
consisting of its BS ID bits to indicate the CPC code it is currently expecting to receive, as
well as control bits. The control bits are further divided into command identifier and the
actual command value. The use of a command identifier will allow new commands to be
added wit hout significant redesign. Lastly, redundancy is added by a BCH(31,21) double
error correcting code, which uses the 21 information bits to produce a 31 bit codeword. This
€rame is illustrated in Figure 3.3.
Redundancy
3.1.4 Call Processing
BS DD
Call Processing refers to the states in which the MS and BS progress through, as well as
the messaging involved between the initiation and end of a communications cycle. Some
of the various functions that are performed are synchronization, CPC selection and power
management.
CMDID CPC ID
Init ialization State
CommandValue
When power is first applied to the BS, it enters the Initialization state and the following
actions are performed. The BS fint listens to the channel to determine which CPCs are
currently being used by other local MS-BS pairs. This is aided by sequentially checking for
each code within a stored list. This list contains the information necessary to recreate each of
the protocol sequences in the family. F'urthermore, this search phase cannot be left until an
unused CPC is found, thus the BS could indefmitely cycle through the list. Once an unused
CPC is found, the BS will transmit packets on the forward iink with this CPC ID in order to
indicate that it is searching for a MS. Next, the BS will attempt to synchronize with a MS
that provides the correct reply. Since the protocol sequences have a low cross-correlation,
synchronization is achieved when a sequence of packets with a matching MS ID and CPC
ID arrive with a correlation exceeding a set threshold. The BS will then transmit a packet
t O indicat e successful synchronizat ion.
When the MS is first powered on, it also enters an initialization state. First it listens on
the forward link for any packets that arrive with a BS ID matching its own. Furthermore,
the command bits must indicate that they are synchronization packets. This is necessary in
order to distinguish them from packets sent by other BSs already engaged in a link (with
possibly the same BS ID). Once found, the MS will begin transmitting packets using the
protocol sequence indicated by the received CPC ID. Lastly, it listens for another packet with
matching CPC ID, BS ID and command bits to indicate that synchronization was achieved.
Once synchronization is achieved, the BS will know exactiy when the MS is allowed to
transmit due to the detenninistic nature of a given protocol sequence. This is important
because there is a probability of a second (or more) MS-BS pair transmitting nearby (and
possibly with the same ID). However, the first MS-BS pair ignores any packets that do not
amve in the slots specific to their protocol sequence. This technique aïIows the user capacity
of the system to be independent of any physical configuration of MS-BS pairs.
Negotiation State
Once synchronization is achieved, the MS-BS pair enter the Negotiation state. One purpose
of this state is to allow the MS-BS pair to set their initial power levels. This will prevent the
occurrence of a large number of power control packets from the BS when the Srafnc state is
first entered. If desired, the MS-BS pair may also choose to switch CPCs as determined by
the BS. Once (if) these two actions are taken, the BS will transmit a packet indicating to
the MS to enter the T r a c state.
During the Traffic state, the majority of the communications between the MS-BS pair is on
the reverse link. Packets from the MS are transmitted according to the CPC protocol without
acknowledgement. The MS must also monitor the forward Iink for control commands from
the BS.
Termination of Link
Termination of the MS-BS link may occur through several mechanisms. First, normal termi-
nation occurs when the MS no longer transmits packets for a period of time geater than a
set threshold. The appropriate threshold is, in part, dependent on the actual application and
thus is not currently fixed. Normal termination may also occur if the MS is powered down.
In both cases, the BS will revert to the Initialization state after the threshold is exceeded.
The MS will similarly consider the link to be terminated if no packets from its BS arrive
during a set period of tirne. In this case the MS will also revert to its Initialization state.
Abnormal termination may occur when, for example, a roaming MS (which was initially
too far to be detected) using the same CPC and perfectly synchronized approaches. Nor-
mally, the increasing interference would have been detected by the first BS, and this pair
would have dynamically chosen a new CPC code through the control command mechanism.
In the case, however, that all the other CPC codes are already in use, the pair would be
unable to switch and thus the collisions would eventually make it appear that the MS had
ceased transmitting. The original pair would both eventually be forced to revert to their
Initialization state. This situation is simi1a.r to a dropped cal1 in a cellular system.
Power Management
The purpose of power management is twofold. First, the MS must transmit at a level such
that the received SNR (Signal to Noise Ratio) is sufficient for decoding at a prescribed
BER (Bit Error Rate). However, it is also desirable to increase or reduce this transmit level
if the received SNR changes during the course of communications. The primary motivation
of this is to increase the battery life of the MS. A second important reason is to increase
the total user capacity of the system. Note that this is different than the capacity earlier
referred to and is similar to the cellular concept, in which two cells rnay transmit at the
same frequency if they are sufliciently far apart. Thus, two MS-BS pairs may also use the
same CPC code provided they are suffciently far apart. One difference fkom a conventional
cellular system is that the cells in this system are not fixed in size, and grow and shrink
in proportion to the transmitted MS power level. This will in most cases be a huiction of
distance between the MS and BS.
In order for the above mechanism to be intelligent, two saiient features are implemented.
First, power control is not used unless it is necessary. If the channel is relatively static, then
periodic commands would represent wasted bandwidth and processing tirne. Thus, the BS
is insensitive to minor fluctuations of the received SNR and wiil not send any commands
unless it is necessary to increase or decrease the MS transmitted power, in steps of IdB.
Secondly, since other control commands such as changing the CPC have a higher priority, it
is desirable to prevent excessive power control packets fiom monopolizing the channel. As a
result, the BS uses the CSMA protocol previously mentioned, with the modification that it
must wait a minimum of 5 seconds before transmitting a subsequent power control packet.
For a given BS-MS pair, the channel may be considered relatively symmetric and thus,
the BS may also use its transmitted power intelligently by matching the MS transmit level.
This exact value is aiways known to the BS, since the MS always begins transmission at a
fived value and cannot change without being issued a power command.
3.2 Physical Layer
3.2.1 Source Coding
The analog EMG signal is sampled at 1250Hz, with each sample quantized to an 8 bit
resolution. This produces an uncoded bit rate of lokbps. Following A/D conversion, it is
common in many digital mobile systems to apply compression to the sampled data, using a
vocoder to reduce the information rate. While there are many benefits to reducing this bit
rate as much as possible, source coding is not implemented in the system for two reasons. The
first, is the additional hardware required for such compression algorithm which are typically
implemented on fast Digital Signal Processing (DSP) chips, or Application Specific ICs
(ASICs). The second is that many of the vocoders used for compression are highly optimized
to the human vocal tract, therefore their performance on an EMG signal is unknown. Thus,
there is the specific problern of efficient source coding for an EMG signal, which is beyond
the scope of this work.
3.2.2 Channel Coding
Channel coding is primarily used to add redundancy to the transmitted information, which
then may be used by a decoder to detect and/or correct errors. It was seen from the results
of the previous chapter and Section 3.1.1 that the CPC used could guarantee collision fiee
packets 100% of the tirne, for 7 users and 4 packets in a frame of 272 slots. The one additional
requirement, however, is that these 4 information packets must be coded into 16 transmitted
packe ts.
A single information packet consists of 10 bits (as was illustrated in Figure 3.2). Thus, our
coding scheme will consider a single information packet to be a 10 bit symbol. Furthermore,
the use of a Reed-Solomon code is a natural solution when it is desirable to code symbols
rather than bits. Thus, an RS code is constructed with symbols from the field GF(2lo) and
generated by the prime polynomial p(z) = 1 + z3 + zI0. Furthermore, a is a primitive
element of G F (2'') and a root of p( z ) , therefore, the generator polynornial of this code is:
with the equivalent representation of the powers of a listed in Table 3.1. The natural tength
of this RS code is n = 21° - 1 = 1023 10-bit symbols. The number of information symbols is
normally, k = 1011, and the distance of this code is n - k + 1 = 1023 - 1011 + 1 = 13. The
code may be modified to suit our application by a process called shortening. Details as to
the modified coding and decoding hardware for shortened codes is provided in [27, pg.1161.
Reduced to its simplest form, the effect of shortening is that fewer information symbols are
used in the encoding process, which will reduce the codeword length while maintainhg the
distance of the code. Applying this process to the above RS(1023,1011,13) code produces
an equivalent, shortened (16,4,13) RS code. This code may now be used to code the 4
information packets into 16 transmitted packets.
There is a well known relationship between the distance of a linear block code and its error
and/or erasure correcting ability. It is given by [26]: d 3 2v + 1 + p. This states that a code
with a minimum distance of d c m correct any pattern of v errors and p erasures. Whenever a
'Tables of prime polyno~ds over various fields are found in many texts such as Blahut [26, pg.791.
45
1 Ex~onential 1 Polynomial Representation 1
Table 3.1: Selected Elements of GF(21°)
packet collision occurs, it is assumed that our receiver structure is able to detect this collision
and thus the dot in which it occurred is marked as an erasure. Under this condition the
decoder will be able to correctly recover al1 4 original information packets. When fewer than
the maximum (12) erasures consistently occur, the BS may safely assume that the system is
not operating with 7 simultaneous users. To take advantage of this situation, the BS may
perform one of two actions. First, if the channel is noisy (as determined by the received bit
error rate), then the minimum distance of the RS code will allow it to also correct random
bit errors, assuming the relationship in the above equation is maintained. If the channel
is not noisy, then the BS rnay issue a control command dynamically changing the channel
coding scheme to allow for an increase in the number of information packets sent. For
example, based on the data from the Appendix, if only one MS-BS pair were transmitting,
16 information packets could be sent and no channel coding would be required. For two
users, a maximum of 14 information packets could be transmitted by each, and a channel
coding scheme based on coding 14 information packets into 16 transmitted packets would
be used, and so forth. This relationship between the total number of users and number of
guaranteed collision free packets was also illustrated in Figure 2.1.
3.2.3 Modulation
The modulation used for both the fornard and reverse channels is OOK (On-OfF Keying).
The main advantage of using OOK is that the carrier may be directly modulated by the
digital output levels of many ICs, and, in particular, the microcontroller used in this design.
For reception an extremely simple detector may be built for this form of modulation, which
aiso reduces the hardware complexity. OOK does have the disadvantage that it is relatively
bandwidth inefficient, however, its pulses may be shaped prior to modulation. Furthermore,
its performance in ternis of the probability of error in the presence of white Gaussian noise,
is inferior to that of many other modulation techniques such as BPSK (Binary Phase Shift
Keying) . As previously mentioned, non-ISM transmitten must use a spread spectmm technique as
their final modulation. Furthermore, to meet the minimum requirements, a spreading factor
of at least lOdB is necessary [28]. To meet this requirement, a similar spreading sequence
as that employed in the IEEE 802.11 standard for wireless LAN [29] is used. The 802.11
standard is similar to our system in that multiple accessing is based on a random accessing
technique, and spreading is also for the purpose of reducing interference to existing ISM
equipment [30]. There are differences however, for example, 802.11 uses BPSK rather than
OOK as the primary modulation scheme. This is in contrast to systems such as CDMA,
where spreading sequences are used for both multiple accessing and interference reduction.
The sequence is an Il-chip Barker sequence given by:
which in a monopolar system is equivalent to,
This sequence has good autocorrelation properties (similar to that of m-sequences) and its
short length is advantageous when considering the time required to achieve synchronization
Demodulation
It was assumed in Section 3.2.2, that the demodulator structure
be able to mark erasures (collisions) as input to the decoder. In
(for the reverse link) would
a hard limiter the demodu-
Figure 3.4: OOK Decision Regions. (a) Hard limiting. (b) Soft limiting
lator outputs a '1' if the sampled signai is greater than a given threshold q, and '0' otherwise.
To note erasures, however, additional thresholds must be used and may be considered soft
limiting (i.e. the demodulator uses more than two decision regions). The decision regions
for OOK, using these two demodulator structures are illustrated in Figure 3.4, where Eb is
the energy of the received pulse. Using (b) in the Figure, and assuming that the noise (n)
present is Gaussian with mean O and variance No/2, and that a O was transmitted, an error
will occur if the noise is greater than q = 3 a / 4 . Therefore, the probability of error (P,)
is equivalent to:
Similar functions may be calculated for other modulation schemes. For cornparison, the
function for BPSK is Q ( d m ) , and for OOK with hard lirniting it is Q ( J E ~ / ~ N ~ ) . Al1
three are plotted in Figure 3.5. At this point, the desired bit error rate is chosen to be 1 0 ~ ~ .
This value is typical of many cellular mobile systems, that carry voice traffic and is also
a standard value used for transmitting from an analog source. In compaxison, many data
communications systems require a bit error rate on the order of 10-~ to Again, using
the P, function, the minimum SNR required to achieve a bit error rate of 10-~ is 9.29dB,
using OOK with soft Limiting.
3.2.4 Chip Rate and Received Power
The peak bit rate for the reverse channel is calculated as follows. Refemng back to Figure
3.2, there are 272 time dots in the protocol sequence. During one cycle of the sequence,
sampling must occur a minimum of 4 times to produce the 4 information symbols. The
sampling frequency is 1250Hz, which is equivalent to a period of 800us/sample. Therefore,
2 4 6 8 10 12 SNR per bit [dB]
Figure 3.5: Probability of Error vs. SNR
the duration of one cycle of the protocol sequence is 800 * 4us = 3200us. Dividing 3200us
by 272 slots, each slot is 11.76~s. There axe a total of 160 coded bits which must be
transmitted into 16 siots, thus the unspread bit rate is 160/(16 * 11.76~s) = 850.34kbps.
Before this sequence is transmitted, each bit is spread by each of the 11 chips in the Barker
sequence, thus the final chip rate is R=9.354Mcps.
From the previous section, it was calculated that the minimum Eb/No ratio required was
9.29dB to maintain a bit error rate of 10-~. This value is also valid for an equivalent chip
error rate, since the modulation method remains the same. The relationship between the
received power and bit (chip) error rate is given by [31] :
w here, PR = the received power
No = noise power spectral density (PSD)
R = the chiplbit rate [(c/b)ps]
Eb = the energy of the received pulse or equivalently the energy per bit
Using R = 9.354Mcps and Eb/No = 9.29dB, the ratio of received power to noise power
spectral density is PR/No = 69.71dB Hz.
3.2.5 System Efficiency
In order to calculate the efficiency of the present system (l), the following comparison is
made against a TDMA system (2) using the following assumptions. First, both systems
operate with 7 simultaneous MS-BS pairs. Second, both systems transmit at the same bit
rate. Third, the TDMA system differs with respect to each transmitted slot, in that the &bit
MS ID must be sent dong with the &bit sample for identification. This is unlike system (1)
in which the 8-bit MS ID is sent only once for every four &bit samples.
The calculation is as follows. In a single traversal of the protocol sequence there are 272
slots, with each slot possibly containhg 10 bits of information or redundancy. Therefore,
a maximum of 2720 bits may be transmitted in one protocol sequence cycle. In system
(1) a maximum of 4, 8-bit samples are transmitted per user, in one cycle. In system (2),
272017 bits may be used per user and thus a maximum of = 24.3 &bit samples may
be transmitted during the time equivalent to a single cycle, for x = 7 users, y = 8 bits per
sample, and z = 2 to account for the MS ID bits.
If the efficiency of system (2) is taken as 1, then the efficiency of system (1) is 4124.3 * 100 = 16.5%, that of system (2). A second comparison may be made against another random
accessing technique known as Aloha, which utilizes packet retransmission during a collision.
The maximum channel utilization of Aloha has been determined to be 1/2e * 100 = 18.4% 191.
Summarizing, this reduction in the amount of information transmitted per user is a
result of several factors. Fint, it is the penalty for impiementhg multiple accessing without
acknowledgement. Secondly, al1 MSs are permitted to be asynchronous. Lastly, a worse
case scenario of 7 simultaneous users and 12 packet erasures per sequence was assumed; this
will not likely be the situation in normal operating conditions. In this strict comparison of
channel efficiency, other important factors such as the complexity of implementation have
been ignored.
3.3 Channel Mode1
In the following sections, the propagation models that characterize the system will be dis-
cussed. These models will be the bais upon specifying several key system parameten such
as transmit power and maximum bit rate. The outdoor mobile and indoor channels are
hostile to the propagation of radio waves due to three main causes: these are path los ,
shadowing, and multipath [32]. These phenornena are highly dependent on the environment
and, for mobile communications, dineremes exist between outdoor and indoor transmission.
Thus (while there are exceptions), the following generalizations are made regarding outdoor
traffic: rarely does a Lineof-Sight (LOS) between transmitter and receiver exist, the dis-
tance traversed by the signals are on the order of kilometres and the MS may be moving
quickly (Le. in a vehicle). Generalizations for indoor tranic are: LOS as well as non-LOS
communications exist, signals traverse distances on the order of metres, and mobiles are
generally slow moving, or stationary people. Figure 3.6 is an illustration of these differences.
For the remainder of this chapter only the indoor mode1 will be considered, since it closely
approximates the intended operating environment for the system design4 in this work.
Figure 3.6: (a) Ou tdoor mobile propagation. (b) Indoor propagation.
Figure 3.7: Power law path loss with Gaussian distributed shadowing [32]
3.3.1 Path Loss and Shadowing
Path loss is a distance related effect and refers to the ratio between the average power radiated
from an antenna to the average power received. It is generally accepted that the received
signal power decays with the square of the path length in free space [32]. Unfortunately,
land transmissions are not under the condition of free space and, as a result, this decay must
be modeled statistically using actual measurements. While the above power law provides a
mean value for the path loss, there is often a variation about this mean due to shadowing
effects. Shadowing occurs when an object, or atmospheric condition (in the case of signals
at tens of GHz), refracts the transmitted signal causing it to travel an indirect route to the
receiver. Shadowing is generally modeled as a random variable with a zero mean log normal
(in dB) distribution and a parameter an called the shadowing standard deviation [32]. The
combination of these two effects is illustrated in Figure 3.7. Many studies of the path loss in
the indoor environment have been conducted under varying conditions. These range from
factories to grocery stores with LOS and non-LOS paths. Table 3.2 contains these measured
path losses summarized kom various sources [32-341.
LOS heavy clutter LOS dong wall
Obstruction light clutter
LOS, open area NLOS
Obstruction, walls Obstruction, floors
Retail Stores Grocery Stores
Office, hard partition Office, soft partition Office, soft partit ion
Obstruction heavy clutter ;I
Table 3.2: Pat h Loss Exponent (n) and Shadowing Standard Deviation (on)
Building Topography [ Frequency (MHz) LOS light clutter 1 1300
It is interesting to note that the majority of recorded mean path loss values do not Vary
significantly from that of free space, and in five of the cases are actually lower. This is
intuitively satisfjkg for the case of LOS, in which one would expect a large proportion of
the received average power to arrive unreflected. Using these data, a conversative value for
the expected path loss in our operating environment is n = 2.3, using the mean value of the
15 measurements in the table. The data further suggest that the measured path loss is also a
function of the carrier frequency. In general, the effect of the carrier hequency is a decrease in
the building penetration loss as the frequency increases 1321. Since the travenal of RF energy
into other rooms and floors within a building does not generally apply in this application,
the effect of frequency will be ignored. The value of the shadowing standard deviation is
highly dependent on the physical layout of the environment, but tends to increases with
more obstacles as seen fiom the data. Since it cannot be foreseen whether Our environment
will be cluttered or relatively obstacle free, the mean value of the measurements from the
table will be used. Thus, on = 7.03.
Using the above estimated d u e s for path loss and shadowing standard deviation, it is
possible to calculate the ERP (Effective Radiated Power) required for the received power to
-
n 1.79
an (dB) 1 4.55
-
Table 3.3: Parameten Used For Determining the Radiated Power
Explanation Standard value from [35, pp. 1081 See Section 3.2.4 Path loss exponent fkom Section 3.3.1
Parame t er PSO so n on d X
be above a given PR/No ratio at a given probability [34,35, pg.1167,pg.105]:
Value 0.7
69.71dB Hz 2.3
where, P,, = the probability that the received power is 2 so
so = the required PR/Na at the receiver [dB Hz]
n = the path loss exponent
C = the sum of the ERP and receiver antenna gain [dB Hz]
d = the distance between the transmit and receive antennas [ml
OQ = the shadowing standard deviation
X = the wavelength of the carrier [ml
7.03 IOm .33m
Now using the values from Table 3.3, the value of C for the received PR/No to exceed 69.71dB
Hz with 70% probability, at a distance of 10m is 128.01dB Hz. For now, it is noted that C dB
Hz is equivalent to Prad + GT + GR (dBW) which are respectively the radiated power, and
transmit and receive antenna gains. The conversion from dB Hz to dBW requires knowledge
of the noise PSD. Thermal noise has a relatively Bat power spectrum up to about 10I2Hz.
Thus, from Proakis [31, pg.3191, a typical value is No = 4.1 x 10-21 W/Hz, or, equivalently
-203.9dBW/Hz. The required radiated power is thus, C = 128.01dB Hz +(-203.9)dBW/Hz
= -75.89dBW. This value includes the effect of the antennae gain, therefore, the fuial
required radiated power is deferred to the end of this chapter, once the gains have been
determined.
Shadowing standard deviation from Section 3.3.1 The maximum distance between BS and MS from Section 1.5 Wavelength of a 908MHz carrier from Section 3.1.2
3.3.2 Mult ipat h Propagation
If a signal is radiated in the presence of scatterers, then these scatterers will cause reflec-
tions and deact ions creat ing multiple versions of the original signal. At the receiver these
multiple versions from different paths will in general have varying amplitudes and phases.
They d l add construc tively and destructively causing the amplitude of the received power
to vary; this is called multipath fading. Using this model, the cornplex, low-pass channel
response is given by [31]:
where, r ( t ) = the received signal
ak = the attenuation of the kth received path
,Bk = the phase of the kth received path
cik = the propagation delay of kth received path
Multipath fading is sometimes called fast fading in order to distinguish it from path loss
and shadowing (slow fading). It is called fast fading because the amplitude and phase of
the received signal can Vary significantly over short distances. Two main probability density
funçtions have been used to model multipath fading in the literature. These are the Rayleigh
and Ricean distributions. The Rayleigh distribution agrees well with measurements in the
rnacrocellular mobile environment [32], and is usually applicable in cases where there is
no LOS between the BS and MS. In cases where there is a LOS component, the Ricean
distribution is typically used and is thus assumed for our system.
Using a multipath propagation simulator program by Hess [35], data modeling the effect
of a varying LOS component on the fading amplitude were generated. The data were then
used to create plots, each of which contain three uncorrelated branches of the received signal
strength. Furthemore, the software also simdated 100 arriving paths with random phases
for each branch. AU the runs used a carrier at 908MHz; the same as the reverse link in the
system. The first three plots in Figure 3.8 are of a slow moving mobile (3 m/s) with LOS
strengths of O (thus essentidy Rayleigh fading), 3 and 6. Clearly the trend is that, with
increasing LOS component strength, the magnitude and frequency of the fades decreases.
The fades also vary in amplitude between approximately 6 to 20dB over the three plots. The
fourth plot in Figure 3.8 is for cornparison purposes, and illustrates the severity of muitipath
(a) 3 mis, Direct Component = O . . . . . . ... . . . . . . . " . . . . . . . . . . . . . . . . . . . . . . . . . .
(b) 3 m/s, Direct Component = 3 m
. . . . .;. . . . . . . .:. . . . . . . . r . . . . . . . .;. . . . . . . . :
Elaosed Time lmsl Elaosed Time fmsl (c) 3 m/s, Direct Component = 6 (d) 30 m/s, Direct Component = O
1 , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 , . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . .
1041 A 1 051 I
O 20 40 60 80 100 O 20 40 60 80 100 Elaosed Time lmsl Elaosed Time hsl
Figure 3.8: Multipath Simulations with Varying LOS and Mobile Speed
fading in the outdoor environment with a mobile at 30 m/s modeled by Rayleigh fading.
The fades are deeper (many over 20dB) and occur very frequently. As previously mentioned,
however, the Ricean mode1 is more appropriate for our systern. This is fortunate suice Ricean
channels require a much smaller fading margin [33]. From these results, a value of lOdB is
used for the fading margin. Since the exact operating environment of the system cannot be
predicted, this is reasonable assuming that both a direct LOS and multipath components
will ex&.
3.3.3 Antenna Design
The antenna is the interface between the guided wave and free space. A thorough un-
derstanding of electromagnetic theory is necessary to fully understand the operation of an
antenna. However, for the purpose of this work, the losses and gains (in dBi) of the antenna
on the system design may be analyzed through two considerations. These are antenna type,
and transmit and receive antenna gain [36].
Type and Matching
The most popular antenna type for cellular applications used by MSs is the whip antenna.
It may be implemented as a quarter-wave monopole antenna. For al1 antenna types, the
maximum efficiency is attained when it is at resonance [37]; the resonant point may be
calculated using the following function:
where, 2 = resonant length of antenna (m)
c = the speed of light on a transmission line (m/s)
f = carrier frequency of operation (Hz)
It is important to realize (for implementation purposes), that the quarter-wave monopole
must radiate against a ground plane in order to be effective. The gound plane foms the
other quarter-wave, creating in essence a half-wave dipole [38]. In addition to having the
correct resonant length for the frequency of interest, the antema should also be impedance
matched to the line feed. This concept is well known in transmission line theory; only an
exact match will allow al1 the transmitted power to be delivered to the antema without any
of it being reflected back. At the resonant point the antenna is a purely resistive load. The
value of 37Q is an approximate value for the quarter-wave and will be our assumed design
d u e [37].
Effective Gain
The antenna characteristics are usually referenced to an ided antenna. This reference is the
isotropic (rneaning it radiates power equaily weil in d l directions) antenna, which is also
fictional and physically unrealizable. Actual antennae focus the radiated power into main
lobes and side Lobes. This results in an antenna gain (GT) specified in dBi (with respect to
isotropic). The effective radiated power (ERP) is defined as the sum of the antenna gain
and radiated power [36].
where,
ERP = GT + PRAD
ERP = effective radiated power (dBW)
GT = antenna gain (dBi)
PRAD = radiated power (dBW)
The peak antenna gain for the quaxter-wave monopole is 5 dBi, which will be the assumed
value for the transmitting antenna. The actual value however, is usually dependent on
additional factors such as the ohmic losses previously mentioned [36]. It is also assumed
that the receiving antenna has the same gain, thus GR = 5dBi.
3.4 Link Budget
Throughout this chapter, various data link and physical layer design issues have been exam-
ined. The h a l parameter to be determined is the required radiated power to meet the BER
constraints at the maximum designed receiver distance. The parameter C = Prad + GT + GR was calculated in Section 3.3.1 to be -75.89dBW. Using the values GT = GR = 5dBi, the
required PRaD is -65.89dBW. In the case of muitipath fading, it is customary to add an
additional loss called the fading margin. An appropriate fading margin for the channel was
determined in Section 3.3.2 to be 10dB. Thus, the final required output power is -75.89dBW
Multiple Access Method of Multiplexing Forward Link Frequencies Reverse Link Frequencies Maximum Bit Rate Chip Rate Primary Modulation Secondary Modulation Maximum Transmit Power Operating Range Reverse Link FEC Forward Link FEC Error Probability
[ Parameter I Value Cyclically Permutable Codes FDD 926-928 MHz 902-914 MHz 850.34 kbps 9.354 Mcps On-Off Keying (OOK) Direct Sequence S pread Spectrum -75.89 dBW O - 10 m. (16,4) Reed Solornon Code (31,21) BCH Code IO-^
Table 3.4: System Parameter Summary
(25.76nW). For the relatively short coverage distance (compared to many other wireless
systems) required, this low value of output power is not surprising. We now complete the
picture with a systern summary in Table 3.4.
3.5 Chapter Summary
In this chapter, an intelligent wireless system using a cyclically permutable code as the main
channel accessing method was designed. The system efficiency in terms of channel utilization
was also calculated and compared against both a TDMA system and Aloha system. Lastly,
critical system operating parameters were specified, such as channel coding, modulation and
transmit power.
Chapter 4
Circuit Design
In this chapter, a brief description of the major components necessary to implement the
system specified in Chapter 3 is provided. The physical connections between individual
components define the schematic, which will be illustrated at a high level. By high level,
it is meant that some processing functions are not directly related to a specific hardware
component(s) and therefore, are represented by a block diagram. It is assumed that the BS
is not restricted in power, size or complexity; thus, only the MS will be described in order
to meet the objectives listed in the introduction.
4.1 MS Schematic
The main piece of software used for schematic entry and PCB (Printed Circuit Board) design
was Prote1 EDA 3.5 (391. Within this package, the Advanced Schematic program was used
to design the electrode at the component levef. Most of the specialized RF components,
however, were not part of the standard schematic library and thus had Co be individually
created. The program could also perform preliminary d e checking of the circuit for items
such as unconnected pins and improper connections (such as two output pins connected
together) . The circuit for the MS forward and reverse link are illustrated in Figure 4.1, and
wil l be referred to throughout this chapter.
Figure 4.1: Circuit from Advanced Schematic
4.2 Analog Processing
4.2.1 Instrumentation Amplifier
As the schematic illustrates, the ME signal is first measured by a pair of surface electrodes
and passed differentially to an instrumentation amplifier. The electrodes are actuaiiy me-
chanical structures, therefore, only their connecticns to the circuit are shown. The instru-
mentation amplifier used was the Burr-Brown INA118. It was chosen, for its low power
usage, high Common-Mode Rejection Ratio (CMRR), and ease of use. Only a single resistor
is necessary to set the gain, which was chosen to be 1000. This value was chosen based on
the approximate amplitude for a surface EMG signal (0.1-5mV) [2, pg.101. The specification
sheet for this device contains al1 of its detailed operating characteristics [40].
4.2.2 Filters
The EMG signal is bandpass filtered between 10-500Hz. This circuit is implemented by
cascading two high p a s filters (HPFs) and two low pass filters (LPFs). From the circuit,
components Cl0 and R2 fom a 20dB/decade HPF, and are cascaded with components R3-
R6,C8,C9 and U2A, which form a 40dBldecade HPF. This provides a maximum attenuation
of GOdBJdecade below the 3dB frequency fLo = 15.9Hz. The first LPF consists of C11, C12,
R7, R8, R11, R12, and UZB, while the second LPF consists of Rl4, R15, C16, Cl7 and U2C.
Each is a second-order filter, thus when cascaded, they produce a maximum attenuation of
80dB/decade above the 3dB frequence fHO = 300Hz. In the passband region the gain
provided by the filters is k = 2. Combined with the gain provided by the instrumentation
amplifier, the total gain before sampling the analog signal is 2000. The subcircuits used are
modifications of those found in Franco 141, Ch.31.
4.3 Digital Processing
4.3.1 Microcont rollers
Following the analog processing of the signal, Analog-to-Digital conversion is applied. The
microcontroller used, was the PIC16C711. Its full capabilities are documented in Microchip's
technical literature [42]. The on-chip converter is capable of quantizing to an &bit resolution.
The actual A/D conversion first requires acquisition of the signal. In other words, the holding
capacitor must be allowed sufficient time to charge to the voltage present on the analog input
pin. A typical value for the acquisition tirne is laps, and is one factor limiting the maximum
rate of conversion.
Following acquisition, conversion is performed by successive approximation. The pro-
grammer is responsi ble for set t ing the microcont roller conversion dock in software. This
value is chosen such that the time of conversion is not less than 1.6ps, otherwise, an incor-
rect value may be obtained 1421. Once conversion is complete, the result is automaticdy
stored in a pre-defined register narned ADRES.
After the resulting 8-bit value is obtained, channel coding according to the shortened
RS(16,4,13) code of Section 3.2.2 is applied. Following coding of the information symbols,
they are then transmitted using the protocol sequence specific to a MS. Although it may
be possible to use a single controller for the A/D conversion, coding and protocol sequence,
the programming would become quite complicated. Thus, it is assumed that a second
microcontroller is used to implement the last function. The assembly code demonstrating
traversal of the protocol sequence is listed in Appendix B.1.
4.3.2 Spreader and Despreader
The operation of spreading the transmitted symbols and despreading the received symbols
is represented in the schematic by blocks designated as a 'Barker chip'. Since spreading is
based upon the XOR operation, this may be performed either in software or in hardware
using a shift register and delay elements. Examples are provided by Peterson [ll].
4.3.3 Modulator and Demodulator
The modulator for OOK is represented by the last block prior to the antenna. The modulator
consists of a LO (Local Oscillator) which is either on or off depending on the output level fiom
the Barker chip. It is also assumed that moderate power amplification of the transmitted
waveform is also available. Demodulation is perfomed by the two components foilowing the
antenna dong the forward link path. The k t chip perfonns amplification of the received
signal amplitude, and downconverts it to baseband. A third PIC16C711 microcontroller then
demodulates this signal, while synchronization to the received signal is aided by the Barker
chip, to which it is connected. E'urthennore, there is a connection from the demodulator back
to the OOK modulator that is used to signal increases and decreases in the transmitted
power according to the power management scheme previously described. Lastly, there is
a connection from the demodulator to the PIC16C711 chip used to implement the CPC
protocol; it is used to signal dynamic changes in the CPC protocol, when necessary.
4.3.4 Antenna
As shown in the circuit, the same antenna is used for the forward and reverse link. As it
was stated in Section 3.3.3 that the antenna would be rnatched to the circuit, an impedance
conversion block consisting of an inductance, capacitance and resistance is used. The com-
ponent values listed are only an example, since at high frequencies, factors (such as PCB
trace lengths) add uncertainty and fine tuning is usually performed after prototype testing.
4.4 Layout and Printed Circuit Board
Using the circuit schematic, a netlist was generated; this is a text file listing al1 of the
components as well as their interconnections. The netlist also specifies the footprints used by
each component. Footprints are necessary in the circuit construction because they indicate
the diameter and placement of holes for through-hole components, and the size and placement
of pads, for surface mount components. This netlist was imported into the Advanced PCB
program of Protel. This program is used for the PCB layout of components, which at
this level are now represented as ICs and discrete elements rather than symbols. Although
the program supports the automatic placement of components, the results are generally
unsatisfactory if a compact result is desired. Thus, the general tactic used was to place
components connected schernaticalIy as physicaliy close together on the PCB as possible.
Fùrthermore, a double sided PCB was used, on which components were placed both on the
top and bottom sides.
Following component placement, it was necessaxy to 'route' the board. In other words,
the logical connections between components are transformed into physical copper traces on
the PCB. The software used was called Advanced Route, and is also a part of the Prote1
Figure 4.2: Physical Size of Myoelectric 'Ikansceiver PCB
software suite. Unlike component placement, manual routing is virtually impossible for a
circuit of even minor complexity. Fortunately the software uses a complex neural networking
algorithm to reduce this operation to a relatively painless procedure. The final PCB is
illustrated in Figure 4.2 and represents the actual physical size of the electrode. The precise
dimension of the PCB based on the outer boundary region is 32.512mm x 32.258mm. The
desired size based on the original objectives was 25mm x 18mm. While this particular
size was not achieved, it should be realized that the overall goal of demonstrating that the
wireless system designed in this work may be constructed in a small package using common,
inexpensive components was met. Since the details of Figure 4.2 are not visible at this size,
the PCB has been magnified and separated into the top and bottom trace and component
layers. These are illustrated in Figures 4.3 to 4.6.
4.5 Power Consumption
In order to estimate the duration of time the MS will operate before needing replacement of
its battery source, the several assumptions will be made. Fint, we use a lithium type battery
because it has a Bat Supply Voltage us. T h e curve, that drops off sharply at the end of its
lifespan. To be specific, we use a lithium-carbon monoflouride based battery with a supply
voltage of 2.N, rated at 1200mA H, at a cost of $1.00 each [43, pg.9-41. Based on the data
sheets, each PICLGC711 microcontroller will consume approximately 20mA of current when
operated at 20MHz. The INA118 Instrumentation Amplifier operates at a quiescent value
of 350uA. The TL084 OpAmp draws a nominal value of 2mA of supply current. Assuming
that the Barker Chip and OOK Modulator each draw 5mA, then based on the schematic
fiom Figure 4.1, all the operating components will draw approicimately 80mA. The amount
Figure 4.3: Top Signal Layer
Figure 4.5: Bottom Signal Layer
Figure 4.6: Bottom Silkscreen Layer
of current needed for radiating the signal is based upon the calculated maximum transmitter
power of 25.76nW through a 37R load. This is approximately 700pA. This neg-iigibly adds
to the total, thus, we assume that the total amount of current drawn by the MS is 80m.A.
Using two batteries to produce an operating voltage of 5.4V, their total rated capacity
is 2400mA H. Therefore, transmitting continuously, the MS should operate for 30 hours.
4.6 Chapter Summary
In this chapter, a circuit schematic based on the work from Chapters 2 and 3 was ciesigned.
F'rom this schematic, the purpose and function of each major processing block was explained.
A PCB layout complete with routed signal traces was also created based on the components
used in the schematic. Lastly, an estimate on the battery life of the device was calculated to
be 30 hours. These results should be construed as a demonstration that the overall system
may be implemented.
Chapter 5
Conclusions
In this thesis, the problem of transrnitting a myoelectric signal between two points on a
wireless channel in the presence of other transmitters was examined. The approach taken to
solving this problem was to use a cyclically permutable code as a protocol sequence to control
multiple access to the channel. Nine different CPCs were compared using three performance
measures. With respect to these measures, the best CPC was then used as part of the design
of a biotelemetric EMG system. This system was designed in order to produce a complete
solution to the original problem.
5.1 CPC Design
The upper bound on the system capacity (in terms of simultaneous MS-BS pairs) was found
to be directly related to the distance (n - k + 1) of the RS code, frorn which a CPC was
created. By choosing RS codes with large distances, a correspondingly high capacity is
guaranteed, but this cornes in general at the expense of a longer codeword length (n).
The implementation of a CPC is limited by the required output bit rate, or equivalently,
the microcontroller speed. This bit rate increases alrnost lineady as a function of increasing
RS codeword length n (which also increases the protocol sequence length). This result,
combined with the one above, leads to the conclusion that the capacity of the system may
be increased by increasing n until the required bit rate exceeds the speed of the hardware
to transmit the bits. It is implicit that the bits are uncoded; if a maximum coded bit rate
is specified, then the uncoded rate WU be lower.
An efficient real-the algorithm for traversing the CPC using a PIC16C711 microcon-
troller was also designed. Implementation of the algorithm and recorded output fiom the
microcontroller demonstrated its operation.
5.2 System Design
For the desired applications, the communications mode1 was primarily point- to-point . These
applications include the transmission of raw EMG signals for the purpose of communication
with cornputers and other assistive devices. As a solution to this problem, a wireless sys-
tem using the cyclically permutable codes as the primary channel accessing method in a
multi-user environment was designed. F'urthermore, the system has the capability to use its
radiated power intelligently through power control, thereby increasing the battery life of the
mobile (electrode). The estimated lifetime was calculated to be 30 bours of continuous o p
eration. The system also uses a dynamic CPC allocation scheme for the purpose of reducing
interference caused by roaming mobiles and other events. The efficiency of the system, in
terms of usage of the channel, was calculated to be 16.5% that of a TDMA system. Com-
pared to the unslotted Aloha system (18.4%), this is very good considering that feedback
from the receiver to acknowledge received packets nor synchronism between usen is required
in our system. The value of 16.5% efficiency, however, was calculated for 7 users operating
concurrently and may be different for other cases.
5.3 Schematic and Circuit Layout
For almost any mobile device, physical size is a design constraint. One objective was to
demonstrate that the mobile electrode, as designed in the system, could be fabricated using
common components within dimensions of 25mm x 18mm. The designed printed circuit
board was 32mm x 32mm. Although this specific goal was not met, its purpose was to
simply set a target. More importantly, the overd goal of demonstrating relatively small size
and low cost (through easily obtainable components) was achieved.
5.4 Future Work
The system currently uses codewords kom a single CPC b i l y for all users in the system.
CPCs however, were shown to have performances that were a function of the total number
of usen. Thus, a CPC which performs well at one point, may not perform as well at another
and an improvement may be made by implementing a mechanism by which MS-BS pairs
could dynamically switch CPCs, depending on the operating environment.
It was stated that the andysis and implementation of EMG source coding was beyond
the scope of this work. This problem may be extended, and a solution sought for a general
class of biological signals, including ECG and EEG. Alternatively, if source coding is applied
to a voice signal to reduce its bit rate to below lOkbps with additional modifications to the
forward link, the system codd aiso be used for voice communications.
In the system implementation, three microcontrollers in total were used to perform al1 of
the digital operations for both the forward and reverse link. Presently, the processing speed
of DSP (Digital Signal Processing) chips makes them an extremely attractive alternative. A
single DSP could replace al1 three rnicrocontrollen, thereby possibly decreasing the size of
the device. Furthermore, convolutional codes for channel coding could be implemented since
they are typically decoded using the processing intensive, Viterbi algorithm. Furthermore,
as an alternative to the algorithm used for traversing the protocol sequence in software, a
Field Programmable Gate Array (FPGA) may be used to implement the algorithm through
digital Iogic.
The channel coding mechanism on the reverse link will protect against al1 information
packet collisions up to the point of the system capacity. At this capacity, however, the coding
is unable to protect against random bit errors due to thermally generated noise. Thus, a
stronger coding scheme is desirable, that can correct for both events when operating at the
system capacity.
Lastly, given the current point in this work, and the results obtained, a project to design
the circuitry for the base station, and to implement the system intelligence is needed.
References
[l] A. Hof, G. Bonga, F. Swarte, and L. de Pater, "Modular PPM telemetry system with
radio, infra-red and inductive loop transmission," Medical €4 Biological Engzneering €9
Computing, vol. 32, pp. 107-112, January 1984.
[2] J. G. Webster, ed., Medical Instrumentation Applicaton and Design. Boston: Houghton
Mifflin Company, second ed., 1992. page 322.
[3] H. Fischer, H. Kautz, and W. Kutsch, "A radiotelemetric 2-channel unit for transmis-
sion of muscle potentials durhg free flight of the desert locust, Schistocerca gregaria,"
Journal of Neuroscience Methods, vol. 64, pp. 39-45, January 1996.
[Il B. Hofmann, "General purpose telemetry for analog biomedical signais," IEEE Engi-
neeBng in Medicine and Biology Magazine, vol. 14, pp. 772-775, 1995.
[5] J. Fernandez Merono, J. Roca Dorda, L. Roca Nieto, and J. Toledo Moreo, "Move-
ment evaluator system via R.F. transmission," in Proceedings of the 1995 First IEEE
International Caracas Conference on Devices, Circuits and Systems, pp. 94-97, 1995.
[6] C. Alvarado, L. Leija, P. Hernadez, and D. Elias, "Telemetry system for continuous mea-
surement of vertical foot forces during wdking," in Integmting Intelligent Instrumen-
tation and Control. 1995 IEEE Instnimentatàon/Measurement Technology Conference.,
pp. 581-583,1995.
[7] G. E. Harris, D. C. Jeutter, B. C. Bergner, D. V. Matesi, and N. J. Pelc, "A multichannel
PWM telemetry system for kinematic gait analysis," Medieal Instrumentation, vol. 21,
pp. 304-313, December 1987.
[8] L. Sherwood, Human Physiology From Cells to Systems. St. Paul, Minnesota: West
Pubiishing Company, 1989.
[9] E. A. Lee and D. G. Messerschmitt, Digital Communication Second Editzon. Norwell,
Massachusetts: Kluwer Academic Publishers, 1994.
[IO] A. J. Viterbi, CDMA: principles of spread spectrum communications. Reading, Mas-
sachusetts: Addison-Wesiey Publishing Company, 1995.
[Il] R. L. Peterson, R. E. Ziemer, and D. E. Broth, Introduction to Spread Spectrum Com-
munications. Englewood Cliffs, New Jersey: Prentice Hall, 1995.
[12] E . N. Gilbert, "Cyclically permutable error-correct hg codes," IEEE ~ansactzons on
Information Theory, vol. IT-9, pp. 175-182, July 1963.
[13] J. L. Massey and P. Mathys, "The collision channel without feedback," IEEE Tkansac-
tions on Infonnation Theory, vol. IT-31, pp. 192-204, March 1985.
[14] J. Huber and A. Shah, "Simple asynchronous multiplex system for unidirectional low-
data-rate transmission," IEEE Transactions on Communications, pp. 675-679, June
1975.
[15] E. Plot nik, "Code constructions for asynchronous random multiple-access to the adder
channel," IEEE Transactions on Information Theory, vol. 39, pp. 195-197, January
1993.
[16] 1. Bar-David, E. Plotnik, and R. Rom, "Forward collision resolution - a technique for
random multiple-access to the adder channel," IEEE Transactions on Information The-
ory, vol. 39, pp. 1671-1675, Septernber 1993.
[l?] P. Mathys, "A class of codes for a T active users out of N multiple-access communication
system," IEEE Ilfnnsactions on Information Theory, vol. 36, pp. 1206-1219, November
1990.
[la] N. Q. A., L. G y M , and J. Massey, "Constructions of binary constant-weight cyclic
codes and cyclically permutable codes," IEEE ansa actions on Infonnation Theory,
vol. 38, pp. 940-949, May 1992.
[19] S. Bitan and T. Etzion, "Constructions for optimal constant weight cyclically per-
mutable codes and difference families," IEEE Transactions on Infomation Theory,
vol. 41, pp. 77-57, January 1995.
[20] 0. Moreno, Z. Zhang, P. V. Kumar, and V. A. Zinoviev, "New constructions of opti-
mal cyclically permutable constant weight codes," IEEE Tkansactions on Information
Theory, vol. 41, pp. 448-455, March 1995.
[2 11 A. Lundqvist, "On the construction of constant weight cyclically permutable codes using
cyclic codes," in 1994 IEEE International Symposium on Infomation Theoy, p. 285,
Insti tute of Electrical and Elec tronics Engineering, 1994.
[22] L. Gyorfi and 1. Vajda, c constructions of protocol sequences for multiple access col-
lision channel without feedback," IEEE 7kansactions on Infornation Theory, vol. 39,
pp. 1762-1765, September 1993.
(231 S. B. Wicker and V. K. Bhargava, eds., Reed-Solomon Codes and Thezr Applications.
New York: IEEE Press, 1994.
[24] J. Stmyf, 'Galois fields." Located at: http://ace.ulyssis.student.kuleuven.ac.be/ jea
ns/st udy/tai/gaiois/galois. html.
[25] S. C. Yang, CDMA R F System Engineering. Boston: Artech House Publishers, 1998.
[26] R. E. Blahut, Theory and Pmctice of Ewor Correcting Codes. Reading, MA.: Addison-
Wesley, 1984.
[27] S. Lin and D. J. Costello, Jr., Error Control Coding: Fundumentuls and Applications.
New Jersey: Prentice-Hall, Inc., 1983.
[28] Industry Canada, Low Power Licence-Exempt Radiocommuncatzon Devices, ch. RSS-210
Issue 2, Rev 1. Industry Canada Publications, February 18, 1998. http://spectrum.ic.-
gc.ca.
[29] IEEE, Wireless LAN Medium Access Control and Physicol Loyer SpeczJieBtzons, ch. Part
11. IEEE, 1997.
[30] M. P. Fuente, Y. Guo, and S. Barton, "A new scheme for direct sequence spread spec-
trum radio LANs," in Proceedings IEEE Fourth Interantzonal Symposium on Spread
Spectrurn Techniques & Applications, vol. 3, pp. 1320-1324, 1996.
[31] J. G. Proakis, Digital Communications. McGraw-Hill, third ed., 1995.
[32] G. L. Stüber, Principles of Mobile Communication. Norwell, Massachusetts: Kluwer
Academic Publishers, 1996.
[33] T. S. Rappaport, "Indoor radio communications for factories of the future," IEEE
Communications Magazine, pp. 15-24, May 1989.
[34] C. Perez-Vega, J. L. ~ a r c h G, and J. M. L6pez Higuera., "A simple and efficient mode1
for indoor path-loss prediction," Measurernent Science and Technology, vol. 8, pp. 1166-
1173, October 1997.
(351 G. C. Hess, Handbook of Land-Mobile Radio System Couerage. Boston: Artech House
Inc., 1998.
[36] F. Losee, R F Systems, Cornponents, and Circuits Handbook. Nonvood, MA.: Artech
House Inc., 1997.
[37] Linx Technologies Inc., Application Note A N-00500 Antennas: Design, Application,
Performance. ht tp://www.linxtechnologies.com.
[38] Linx Technologies Inc., Application Note: Llsing Linx l /& Wave Wh2p Antennas.
ht tp://www.linxtechnologies.com.
[39] Pmtel Technology Inc. 4675 Steven's Creek Blvd, Suite 200, Santa Clara CA 95051-6764.
ht tp://www.protel.com.
[40] Burr-Brown Corporation, INA118 Precision, Low Power Instmrnentation Amplifier.
http://www.burr-brown.com.
[41] S. Franco, ed., Design With Operational Amplifiers and Analog Integrated Circuits. New
York: McGraw-Hill Inc., 1988. pages 125-129.
[42] Microchip Technology Inc., PIC1 6C7l X 8- Bit CMOS Microcon trollers with A/D Con-
troller. http://www.rnicrochip.corn.
[43] T. R. Crompton, Baltery Reference Book. Oxford: Butterworth-Heinemann Ltd., sec-
ond ed., 1995.
Appendix A
Cyclically Permutable Codeword Data
Table A . l : CPC Data
Total Users Packets Packets Succeas Code X m i t Users X m i t t ing Sent Guaranteed Rate Length Rate
Table A. 1 : cont inued
il. 11% 16.67% 22.22%
Table A . 1 : cont inued
Table A . l : continued
Appendix B
Assembly and C Code
B.l Microcontroller Code for the MS Reverse Link
;*******+****** Protoc01 Sequence Algor i th ******************** ;Protoc01 sequence is a CPC code generated from a (16,4) RS code ;generator -> g(x)= 2 + 12% + 6xn2 + 151'3 + 4xa4 + 1 5 x 3 + 3x-6 + . * 14xa7 + 9xa8 + 6rn9 + 7xa10 + 4xa11 + xa12 ;information -> i(r)= O + x + 3xa2 + 4xn3 ; sequence -> ;*************************************************************** * ;Ti t le "Multiple Access Protocol Sequence EMG Transmitter" * ; A/D ose. = Clock divided external crystal ; A/D Interrupt = O f f ; A/D Charnels = 1 (ADO) . * ; Program: WEMG. ASM
; Version ; Ver. 1.0 ; Ver. 1.1 #
; Ver. 1.2 .. * I
; Ver. 1.3
Date Conmient 1-26-98 Using MPLAB 3.11 1-26-98 Increase chip period by removing
looping between each b i t 1-29-98 Get rid of sleep mode except fo r the
very f i r s t sample. The chips must be equaZ1y spaced in t h e .
1-30-98 Bug fixes. Some chipa were not exactly equal in period. Added an extra NOP t o make the chip period 5 us. (Needed fo r l a s t Goto-211s)
; Ver. 1.4 . #
; Ver. 1.5 . #
; Ver. 1.6 #
; Ver. 1.7
D
; Ver. 1.8
. 1
; Ver. 1.91
; Ver. 1.92 D
; Ver. 1.93
; Ver. 1.94 ; Ver. 1.95 ; Ver. 2.0 P
; Ver. 2.01 ; Ver. 2.02 ?
; Ver. 2.03 ; Ver. 2.1 ; Ver. 3.0
; Ver. 4.0 ; Ver. 4.1
; Ver. 4.5
#
; Ver. 4.6
Disable a l1 intermpts. Major bug because an i n t e m p t service routine vasnJt ur i t ten Modify code fo r PIC16C711 t e s t microcontroller. 1k code l i m i t . Add code so pn sequence ha8 a period length that is a multiple of 80chips. Another bug. Have t o disable the DIE *BüT* enable MIE otherwise the A/D won't vake up from sleep and continue operation at PC+1 Change A/D timer t o use Fosc/8 instead of interna RC since ve are using a 4 Mhz external crystal . Add a dunnuy interrupt service routine. We donJt need interrupts but the microcontroller may be generating them. Comment the sleep out, t o see i f that is why the program doesn3t seem to be nianing Add --config directive t o set the configuration bits. Propainned on ITU PIC*. Fixed e n o r in l i s t processor directive. Add ,,idloc directive. For ITü PIC+ compatibility Fix A/D conversion clock Fosc/32. Using MPLAB 3.4. Many updates t o code. Clean up code and f inish ECC and protocol sequencing. More fixes t o timing of Xmit and sample periods Add more t h e t o the xmit t o reduce the b i t rate for increased compatibility with more modulators D a m , fotgot t o configure TRISA a t beginning. Fixed. Bug f i x in moving ADRES into Vxx bi ts . Major optimizations on ECC and MIT vhich have been merged into one single subroutine. New real-time algorithm riritten. Removed ECC. Updates t o code. Presampling i s no longer done. B i t period hcreased t o 5 cycles (2 usQ1OlIHz) See if the xmitter/receiver pair v i l 1 vork vithout synchronization and phase alignment algorithm. Receiver vil1 only look a t the I D b i t s . Go to 20 Mhz, and add a few cycles fo r proper b/D conversion t h e
LIST P-PIC16C711
; Code protection off ,HS (20 Ilbz) oscillator ,üDT disabled, ; PVRT enabled, BODEN disabled
,,conf ig H' 3FB2 ,,idlocs H'0003J
#
include "pl6c711. inc" LIST
; *** Give RAM locations meaningful names *** ; Note that these memorp locations are highly dependent on the processor used.
ROM EQU Ha12) ROWSIZE W U HJ13' COLUMN EQU HJ 14' COLSIZE EQU H' 15'
IDBITS EQU HJ40J
;*+*++******* DO NOT USE MEMORY LOCATIONS 18h t o 1Fh *******************
; They are reserved for the samples ***********+*******
;s~ss*******s+ DO NOT USE MEMORY LOCATIONS 20h to 2Fh ***********+*******
;+*********** They are reserved for the CPC Code *******************
;On reset al1 intetrupts are disabled (GIE=O) . ORG 0x00
goto start
ORG Or04 return
s t a r t
bs f STATUS , RPO ;select bank 1 movlw BJOOOOOOOO~ movuf TRIS0 ;make port B al1 output8 movlv B ' 000000il' mowf TRISA ;make M O - 1 inputs, AN2-4 output on port A
Init ializeAD
movlw BJO0000O1OJ movwf ADCONl bcf STATUS , RP0 movlv BJ1OOOOOO1~
movwf ADCONO
clrf PORTA clrf PORTB
MAIN
; Initialize the CPC array movlw H 20 ' mowf FSR movlw D O movwf INDF incf FSR,i movlv DJ 10' movwf INDF incf FSR,I movlw DD4' movwf INDF incf FSR, 1 movlw D'2' movwf INDF incf FSR ,1 movlw D '4 ' rnovrrf INDF incf FSR, 1 movlw D 14 mowf INDF incf FSR, 1 movlv DJ12# movwf INDF incf FSR ,1 movlw D'7' movuf INOF incf FSR, 1 movlw D'lJ movwf INDF incf FSR ,1 movlv Dr13' movwf INDF
;ch04 as analog inputs ;ch203 as digital I/O, A/D ref M D ;select Bank O ;bit O - turn A/D on ;bit 1 - A/D conversion status ;bit 3-5 - select chamel O ; b i t 6-7 - A/D Fosc/32 clock
; clear al1 the latches ; c h a r a l l the latches
incf movlw mowf incf movlw mowf incf movlw mowf incf movlw movwf incf movlv movwf incf movlw movvf
FSR, 1 DJ13' INDF FSR, 1 DJ12' INDF FSR, 1 DJOJ INDF FSR, 1 D J 2 ) TNDF FSR, 1 D'iO' INDF FSR, 1 D' i ' INDF
; end of CPC array initialization
; in i t ia l ize the sample locations t o O
movlw movuf clrf incf clrf incf clrf incf clrf incf c lr f incf clrf incf clrf incf clrf movlw mowf
H' 18 ' FSR INDF FSR, 1 INDF FSR, 1 INDF FSR, 1 INDF FSR, 1 INDF FSR, 1 INDF FSR, 1 INDF FSR, 1 INDF H W Y SAMPLOC ; begin storing samples here .
; in i t ia l ize the other variables clrf ROW clrf COLUEIN movlw D 17 >
movuf ROUSIZE
movlw D ' 16 ' mowf COLSIZE
movlw B J O O O O O O O l ~ movwf IDBITS
movlw H 4 movwf TEMP2 movlw HJ 18 mowf FSR ; indirect ly aùàress memory location 18h mowf XMITLOC ; th i s is where we will begin sending samples from
; end of i n i t i a l i z a t i ons
; This is the main loop. Basically CPCloop v i l 1 produce the ptotocol sequence ; in mal-the. ühen the sequence is Y, then se vi l1 transmit a sample. ühen ; > O s , the transmitter is silent. The loop also maintains a constant sampling ; rate of approximately 1250 Hz from the analog signal at pin ANO.
CPCloop
movf xorlw btf SC bsf
movlw addwf movwf movf
x o d btf ss goto
bsf movf
momf mowf rrf mvf NOP NOP NOP NOP NOP NOP -
ROW, O Q STATUS , Z ADCONO , GO
H'20J COLUMN , O FSR INDF , O
ROU , O STATüS , Z DONOTHING
PORTA, 2 IDBITS , O
PORTB COUhlTER COUNTER, I c o m , O
;if the ROW=O then ve must sample
; i f CPC [column]=Rou then xmit , else silence
;skip s, i . e . equal t o rov -> xmit
; turn on the modulator, 127 cycles t o the ENDMIT ;get id bits and output
NOP
movwf rrf movf NOP NOP NOP NOP NOP NOP NOP NOP
movwf movf movyf movf NOP NOP NOP NOP NOP NOP NOP
movwf movwf rrf movf NOP NOP NOP NOP NOP NOP NOP
mowf rrf movf NOP NOP NOP NOP NOP
PORTB COUNTER, 1 COUNTER, O
PORTB XMITLOC, O FSR INDF , O ;retrieve the sample in W
PORTB COUNTER COUNTER, 1 COUN'mt, O
PORTB COUNTER, I COUNTER, O
; LSB
NOP NOP NOP
movwf rrf movf NOP NOP NOP NOP NOP NOP NOP NOP
movwf rrf movf NOP NOP NOP NOP NOP NOP NOP NOP
mowf rr f movf NOP NOP NOP NOP NOP NOP NOP NOP
movwf rrf movf NOP NOP NOP NOP
PORTB COUNTER, 1 COuNTER, O
PORTB COUNTER, 1 COUNTER, O
PORTB COUNTER, 1 COUNTER, O
PORTB COUNTER, 1 corn, O
NOP NOP NOP NOP
movvf rrf movf NOP NOP NOP NOP NOP NOP NOP NOP
mowf incf andlw iorlw NOP NOP NOP NOP NOP NOP NOP
bcf movwf
goto
PORTB COUNTER, 1 COUNTER, O
PORTB ; MSB XMITLOC , O BJOOO1llllJ ;these tvo instructions vil1 reset the BJOOO1lOOOJ ;pointer to 18h when it reaches 20h
PORTA, 2 XMITLOC
ENDXMIT
DONOTHING ;vaste t h e slot because protocol sequence i s zero at this point. ;cheu 126 cycles
movlv Hr03 ' ; 3 movvf COUNTER movlw W C J ;12 -- each radix is 9 instruction cycles. cal1 DELAYCODE ;120 instructions NOP NOP NOP
movf xorlv btf ss goto movf mowf movf moW
incf movf andlv ior lv mowf goto
cont 1 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP
cont2 incf movf xorwf btf SC
clxf
incf movf x 0 N f
btf SC
clrf
goto
ROW , O O STATUS , Z cont i SAMPLOC, O FSR ADRES, O INDF
FSR , 1 FSR , O B'00011111' B ' 0001 1000 ' SAMPLOC cont2
ROW, 1 ROW , O ROWSIZE, O STATUS , Z ROM
COLUMN ,1 COLUMN , O COLSIZE , O STATUS , Z COLUMN
CPCloop
; i f the ROW-O then we Save the sample
;store sample in next address
;these two instructions w i l l reset the memory ;pointer t o 18h when it reaches 20h
;uhat are these NOPS here for? ; to ensure that CPCloop takes the same t h e ; regaraes8 of progam branches. ; indegant but very important that it is done.
; This code v i l 1 delay a set nimber of instruction cycles dependent on the ; values of COWTER and TEMP vhich are se t before this routine is called. ; Total delay including c a l 1 and ra tura is given by ; (COUIYTER-1) (l+inner+l+2)+1*(1+~er+2) + 2 + 2 ; where imer is given by (TEllP-1)(1+2)+1*2
; For COüNTER=3 thia simplifies t o -> 9TEMP + 8 + 2 + 2 -> + 12 cycles
DELAY CODE movwf TEMP
Il'nuER decfsz TEMP,I goto INNER
decfsz COUNTER,l goto DELAYCODE return
B.2 Microcontroller Code for the BS Forward Link
;****i***+***+* Protocol Sequeace Algorithm ******r*++i****++***
; Protocol sequence i s a CPC code generated from a (16.4) RS code ;generator -> g(x)= 2 + 12x + 6xe2 + 15x-3 + 4xn4 + 15xa5 + 3xn6 + . 8 14~-7 + 9xe8 + 6xe9 + 7xe1O + 4xn11 + fi2 ;information -> i(x)= O + x + 3xn2 + 4f3 ; sequence ->
;Ti t le "Receiver code for Asynchronous Multiple Access Transmitter"
; Version Date ; Ver. 1.0 8-26-98 ; Ver. 1.5 8-28-98 . a
; Ver. 2.0 8-29-98 a
; Ver. 2.1 8-30-98
Conment Receiver algorithm Modif ied algorithm t o simply look a t the I D b i t s t o identify sender and output sampled b i t s . Needed t o increased clock frequency t o 2OMhz in order for the algorithm t o have enough time t o vork correctly. Add an interrupt routine because the samples are not begin output at regular intervals.
LIST P=PIC16C711
; Code protection off ,HS (20 Mhz) oscillator ,YDT disabled, ; PWRT enabled, BODEN disabled
,,config HJ3FB2' ,,idlocs HJ0004'
. a
include up16c711.incu LIST
; *** Give RAM locations meaningful names *** ; Note that these memory locations are highly dependent on the processor used.
ORG Or00
goto start
ORG 0x04 mowf W-TËMP swapf STATUS , O mowf STAT-TEMP
bcf INTCON,TOIF movf XMITLOC , O movvf FSR movf INDF,O rnovuf PORTB
incf XMITLOC , O a n à l w B800011111~ ;these two instructions u i l l reset the iorlw B80001100O8 ;pointer to 18h vhen it reaches 20h movwf XMITLOC
NOP NOP NOP NOP NOP
movlw D'82' moatf TMRO
awapf STAT-TEMp ,O movuf STATUS swapf W-TEMP , 1 svapf W-TEMP,O
retf ie
s t a r t bcf STATUS , RPO ;select bank O clrf PORTA ;clear al1 the latches
c l r f PORTB ; clear al1 the lat ches
bs f movlv mowf movlv mowf movlw movvf movlw m o w f
STATUS , RPO ;select bank 1 B'00000000' TRISB ;maise port 0 al1 output8 B'OO011111' TRISA ;make port A al1 inputs BJiiO1OO1l~ ; turn on the TMRO module f o r counting cycles and OPTION-REG ;set the prescaler to i:16 B ~ ~ 0 1 0 0 0 0 0 ~ ; c h a r al1 the interrupt f lags and iinm;isk GIE INTCON ; and TMRO iaterrupt .
I n i t iaiizeAD movlv B'00000011' ;MO-RA3 as digital I/O movvf ADCON1 bc f STATUS,RPO ;select bank O again since we need t o read PORTS
MAIN
; i n i t i a l i z e the sample locations t o O
movlv movwf c l r f incf c l r f incf c l r f incf c l r f incf clrf incf c l r f incf clrf incf clrf movlv movwf
H'18' FSR INDF FSR, 1 INDF FSR , 1 IrnF FSR j 1 INDF €SR, 1 INDF FSR, 1 INDF FSR j I INDF FSR, 1 INDF H' iB ' SAMPLOC
; i n i t i a l i z e the variables
;begin storing samples hem.
c l r f SAMPLE c SAMPLE2 movlv B'00000100~ ; th i s is equivalent t o IDBITS=OOOOOOOl in mowf IDBITS ;the traiismitter (only 3 tSB8 used) !
m o v l w H'l8) movwf FSR m o w f XMITLOC
m o v l w D346) m o v w f Tm0 m o v l w B~00000000~
; end of ini t ia l izat ions
POLLID btf sc bs f rlf m o v l v andwf movf x o m f NOP btf ss goto
clrf
GETSAMP btf SC
bs f r rf NOP movf m o v v f NOP NOP NOP NOP NOP
btf SC
bsf Zrf NOP incf m o v f a n d l w iorlw m o v u f
PORTA, O STATüS , C SAMPLE, 1 B'00000111' SAMPLE ,1 IDBITS , O SADLE, O
STATüS , Z POLLID
SAMPLE2
PORTA, O SAMPLE2,7 SAMPLE2,i
SAMPLOC, O FSR
PORTA, O SAMPLE2,7 SAMPLES, 1
€SR, 1 FSR , O B'00011111' B ' 00011000 ' SAMPLOC
;indirectly address m e m o r y location 18h ;this i s where ve w i l l begin sending samples from
;get the received b i t ; i f the bit i s one, then se t the c a n g b i t ;either vay rotate left through carry
;mask out the 3 LSB
;check i f these b i t s are equal t o our IDBITS
; i f equal get sample, else, get next b i t
NOP
NOP
btf SC PORTA, O bs f SAMPLE2,7 1Tf SAMPLEZ ,1 NOP NOP NOP NOP NOP NOP NOP NOP
btf SC bs f rrf NOP NOP NOP NOP NOP NOP NOP NOP
btf SC bs f rrf NOP NOP NOP NOP NOP NOP NOP NOP
btf sc bs f rrf NOP NOP NOP NOP NOP NOP
PORTA, O SAMPLE2,7 SAMPLE2,L
PORTA, O SAMPLE2,7 SAMPLE2,l
PORTA, O SAMPLE2,7 SAMPLE2,l
NOP NOP
btf SC
bsf rrf NOP NOP NOP NOP NOP NOP NOP NOP
b t f SC
bs f NOP NOP NOP movf movwf
movf movwî goto
m
PORTA, O SAMPLES, 7 SAMPLE2 , 1
PORTA, O SAMPLE2,7
SAMPLOC, O FSR
SAMPLE2,O INDF POLLID
B.3 Reed Solomon to CPC Conversion Program
tdef ine Fieldsize 20
double CF; void makecpc (double Barraysize , i n t NewAFieldeize] [Fieldsize] ) ; void aain(void) {
int codevord [Fieldsize] , counter , column, rov, A [Fieldsize] [Fieldsize 1 ; // Find out what t h e size of the Field is pr in t f ("\nUhat Galois Fie ld is t h i s over? ") ; scanf ("%lfU ,&CF) ;
// Fill i n the codeword p r in t f (I1\nEnter the % . O l f elements of the codevord: " ,CF-1) ;
f o r (cou.nter=O;counter<GF-l;counter++) scanf ('@%i" ,&~odew~rd[counterl);
p r i n t f ( \n\nl' ;
// I n i t i a i i z e the A array
f o r (row=O; row<GF; rov++) f o r (coluum-O ; colunni<GF-1; column++)
A [row] [column] =O ;
// F i l l in the A array f o r (count ers0 ; count er<GF-1; counter++) f o r (columnt0; columa<GF-1; columu++)
A [codevord [column] 1 [column] =1;
/*for (row30; roucGF; row++) ( pr in t f ("\nu) ; f o r (colum-O; column<GF-1; colun++)
p r int f ( " Xi " , A [rov] [column] ) ; 1 */
// create the CPC codeword
void makecpc (double arraysize , int Acopy [Fieldsize] [Fieldsize] ) {
// define B as an array of arraysize int B [400] , counter ; FILE *cpclist ;
cpclist = fopen(%pc. txt" , tta+u) ; fprintf (cpclist , "\n\nU) ; for (countero; countercarraysize; counter++) {
B [cornter] = Acopy [fmodkounter , CF)] [fmod(counter, CF-i)] ; fprintf (cpclist , "Xi " ,B Ccounter] ) ; >
f close (cpclist ) ;