and GFSK demodulation. ..... The MFSK demodulator demodulates the signal ... Frequency hopping. FM Demodulator. FH-FM. Demodulator. Dis-assemble.
Design and Simulation of a Bluetooth Communication System Kevin Mhlanga, Matiko Mafumo, Prosper Sotenga, Thato Phate, Thomas Olwal Department of Electrical Engineering F’SATIE/Tshwane University of Technology Pretoria 001, South Africa Abstract—Bluetooth is a technology developed for short range communications between Computers, Mobile Phones, Personal Digital Assistants (PDAs) and other devices. It was developed to replace the proprietary cables which interconnect devices together. In this paper we have designed a Bluetooth digital communication system (DCS) by making use of Frequency Hopping at a data rate 1 Mbps with 1600 hops per second in order to prevent interference with other devices operating in the same unlicensed band. We have designed the DCS consisting of the transmitter, receiver and the channel models. In particular, the transmitter has been uniquely designed by employing channel coding and Gaussian Frequency Shift Keying (GFSK) modulation, the channel has been modelled by applying Additive white Gaussian Noise (AWGN) to the propagated signal and the receiver has been uniquely designed by using channel decoding and GFSK demodulation. In order to validate the performance of the designed system, Bit Error Rate (BER) measurements were taken against Signal to Noise Ratio (SNR) using an enhanced computer Simulink. Keywords—Bluetooth; Gaussian; Frequency-Hopping; Hops; GFSK;
I. INTRODUCTION Bluetooth is a short range (0 m - 10 m) wireless personal area network (WPAN) technology aimed at replacing noninteroperable proprietary cables that connect phones, laptops, PDAs and other portable devices together. Rather than competing with Wireless Local Area Networks (WLANs) for spectrum and applications, WPANs are intended to intensify many of the usage scenarios and operate in conjunction with WLANs [1]. Bluetooth technology uses frequency hopping to switch the carrier signal several times in a second. In Bluetooth technology, a process called pairing is established to bond the devices involved [2]. This process is of great necessity for both parties to know the specific hopping code used for the modulation. This bonding creates some form of security as the transmitted information can only be decoded by the bonded devices. As a matter of interest, we looked into the processes involved in a digital modulation scheme that provides security at a physical level within the Bluetooth technology. This motivates the study of a modulation scheme that provides high security and low interference for future networking applications. II. FUNDAMENTALS OF A BLUETOOTH SYSTEM The Bluetooth communication system was implemented to enable reliable communication over short distances. The radio interface relatively has many features. The Bluetooth radio
978-1-4799-7707-9/15/$31.00 ©2015 IEEE
interface supports a large number of channels and different power levels, as well as using reliable forms of modulation. A. Bluetooth Digital Communication system The frequency range of Bluetooth communication system is divided into 79 channels with 1 MHz gap in between for some countries. This starts at 2402 MHz and finishes at 2480 MHz. This can be calculated as 2401 + n, where n varies from 1 to 79 [3]. 1600 hops are made per second from one channel to another [4]. Each frequency hop is a time slot spanning 625us during which data packets are transferred [5]. Any Bluetooth device can be a master or a slave, depending on the application scenario. The master sets the hopping sequence, and the slaves synchronize to the Master [6]. In this paper, a binary cyclic encoding (BCE) technique was used to enhance the performance of the DCS by introducing robustness to the channel impairments. The BCE is a linear block code which provides simplicity during implementation. By using this type of coding, code-words are generated using cyclic shifts of a generator matrix. Such encoder can practically be implemented using Shift Registers which makes computations less complex and faster. Since Bluetooth transmits data in packets, we analysed the effects of the delay caused between the binary cyclic encoder, through to the decoder. We then identified a way to compensate the receiver section in order to eliminate the effects caused by the cyclic encoding delay and the encapsulation delay. The classes of Bluetooth radio operation specify the maximum range to which a device can transmit information [3]. Class 1: these devices can transmit up to a maximum distance of 100 m with maximum output power of 20 dBm. Class 2: devices in this range can transmit up to a range of 10 m with maximum output power of 6 dBm. Class 3: The maximum distance of transmission is 10 cm with maximum output power of 0 dBm. B. GFSK Modulation Gaussian Frequency Shift Keying (GFSK) is a digital modulation technique used in communications systems. This technique is found in standards such as Bluetooth, Digital Enhanced Cordless Telecommunications (DECTS) and WAVENIS. GFSK is a variant of Frequency Shift keying (FSK) which conveys information by decreasing the carrier frequency for the duration of a 0 bit and increasing the frequency for the duration of a 1 bit. The term Gaussian comes in place due to the fact that Gaussian filtering is applied to the
employ cyclic encoding to the system to detect any possible errors along the communication link. A (15, 10) linear block code is used. We represent an arbitrary message polynomial as in equation (2);
baseband square-wave signal that is used to modulate the carrier frequency [7]. When GFSK is used for the Bluetooth modulation, the frequency of the carrier is shifted. A binary one is represented by a positive frequency deviation and a binary zero is represented by a negative frequency deviation. The modulated signal is then filtered using a filter with a Gaussian response curve to ensure the sidebands do not extend too far either side of the main carrier. By doing this the Bluetooth modulation achieves a bandwidth of 1 MHz [3].
Tx _Symbols
Transmitter
This paper contributes in designing a simulation model in which all the fundamental blocks of a typical physical layer of a Bluetooth communication system are integrated and the resulting system is then simulated using MATLAB Simulink. We also analysed the performance in terms of BER, noise in the frequency domain, and Link Budget in order to demonstrate the system’s capabilities in the physical layer.
Assemble Packets of 625 bits at 1Mbps
FH-CPM Modulator
Hop _Index
Frequency hopping GFSK Modulator 1600 hops per sec
Hop _Index
randint (1,100 ,78 )
u-39 Hop Frequency in MHz
Fig. 1. Simulink Implementation of a Bluetooth Transmitter
mሺxሻ= c0 +c1 x+…+c9 x9
A. Transmitter Figure 1 illustrates the transmission concept of the Bluetooth technique as implemented in a Simulink. The process of formatting is excluded in this work since the data to be transmitted is already in a digital format representing ones and zeros. Formatting involves the whole process of converting non-digitized information to a format that is suitable for digital circuitries to handle. This format is usually binary ones and zeros that are generated stochastically with a Bernoulli Binary Generator in Simulink. The Binary Data Source in Figure 1 depicts the digital information to be transmitted. These are binary ones and zeros. This is implemented by using a Bernoulli Binary Generator block in Simulink which generates random binary numbers using Bernoulli distribution. Bernoulli distribution is the probability distribution of a random variable which takes value 1 with success probability p and value 0 with failure probability q=1-p [6]. The probability mass function of the distribution is indicated in (1). Generally this defines the probability of obtaining two discrete figures which could be ‘1’ or ‘0’. if k=1, if k=0.
Shortened Hamming (15 ,10 ) Encoder
Frequency hopping code , 1/1600 sec
By emulating data communication over a radio channel, a maximum capacity of 1 Mbps is considered in the design. In the design, communication channels are divided into 625ms slots, with a new hop frequency being used for each slot. A bandwidth of 79 MHz is employed in the frequency hopping system in order to reflect the generalized model of a digital communications system.
p 1-p
Cyclic Encoder
Binary Data Source
Frequency Hopping Code Generation
III. DESIGN AND IMPLEMENTATION
fሺk;pሻ= ൜
Bernoulli Binary
(2)
A generator polynomial as indicated in equation (3) is also used; gሺxሻ=x5 +x4 +x2 +1
(3)
Using equation (2) and (3), we create a code-word cሺxሻ of length N=15 as depicted as: c(x)= m(x)g(x)
(4)
Furthermore, we convert g(x) systematically to form a generator matrix as follows: 5 4 2 5 ( ۍx +x +x +1) ( ۍ ېx +x4 +x2 +1) ې 5 4 2 ێxሺx +x +x +1ሻ ێ ۑሺx6 +x5 +x3 +xሻ ۑ ێx2 (x5 +x4 +x2 +1)( ێ ۑx7 +x6 +x4 +x2 ) ۑ ێx3 (x5 +x4 +x2 +1) ێ ۑ8 7 5 3 ۑ ێ ( ێ ۑx +x +x +x ) ۑ 4 5 4 2 (x +x +x +1) x ێ ( ێ ۑx9 +x8 +x6 +x4 ) ۑ G= ێ5 5 4 2 ێ = ۑ10 9 7 5 ۑ x (x +x +x +1) (x +x +x +x ) ێ6 5 4 2 ێ ۑ11 10 8 6 ۑ ێx (x +x +x +1)( ێ ۑx +x +x +x ) ۑ ێx7 (x5 +x4 +x2 +1)( ێ ۑx12 +x11 +x9 +x7 ) ۑ ێ8 5 4 2 (ێ ۑx13 +x12 +x10 +x8 )ۑ ێx (x5 +x +x +1) ێ ۑ14 13 11 9 ۑ ۏx9 (x +x4 +x2 +1)(ۏ ےx +x +x +x )ے
(1)
The probability at which a zero output occurs is set to 0.5. The binary bits generated however are encapsulated into frames of 10 bits to represent an alphabet. This makes it possible to apply the second stage of the design which is channel encoding. In Figure 1, the channel encoder’s purpose is to add redundant bits to the information to be transmitted for a more robust communication link. This is implemented in Simulink using a Cyclic Encoder. As the name depicts, we
8
(5)
Simulink using M-ary FSK which is set to 79 symbols and a separation of 1 MHz.
By combining equations (2) and (6), we have: cm =mG
(6) 1
It should be noted that this entire procedure is implemented in a Binary Cyclic Encoder which generates a cyclic code with message of length K = 10 and code-word length N = 15. This indicates the number of redundant bits as 5. The redundant bits are added to the 10 bit framed output from the Bernoulli binary source.
2
To Frame
Out
79 -FSK
In 2 Generate 79 possible carriers -39 MHz to 39 MHz
Fig. 2. Continuous Phase Modulation and Frequency Spread Spectrum generation in Simulink
If a hop index is generated as 0 then a -39MHz complex sinusoid is generated. If 1 is generated as the hopping index, a 38 MHz complex sinusoid is generated and the process continuous until +39MHz. The base baseband signal generated from the Continuous Phase Modulation (CPM) is used to modulate the carrier signal for the duration of each hopping index generated which is 625us. Technically the carrier frequency is offset by a margin corresponding to the baseband signal frequency generated at that point in time to represent a specific bit.
The modulation of the carrier frequency is designed by using GFSK for the baseband modulation. This is because GFSK narrows the width of the baseband pulses. The Passband modulation employs FHSS technique in order to provide security due to the generation of a pseudorandom carrier signal. The band pass is modulated using a Gaussian low pass filter and the degree of filtering is expressed by multiplying the filter’s 3dB bandwidth by the bit period which is called the BT product. As BT is lowered the amount of inter-symbol interference introduced increases because the symbol width becomes broader. In this design a BT equivalent to 0.5 is utilised which makes it fit efficiently into a smaller frequency band. For that matter representing a digital one and zero will fit into a small frequency band. The impulse response of the Gaussian filter is provided as follows [8].
B. Channel A wireless channel is a free space medium used for propagating transmitted messages to the receiver. Due to the presence of many other signals in the air, a transmitted signal gets mixed with these ‘noise’ signals, thus becoming distorted. Also, signal fading and scattering due to obstacles between the transmitter and receiver affect the performance of the communication system. These effects have a significant impact on the ability of a communication system to receive the exact transmitted message.
2ʌBT
1 2ʌBT 1 ൬t- ൰൱ - Q ൭ ൬t+ ൰൱ 2 2 ξln2 ξln2
1 GFSK Modulation
To easily accommodate the frames from the channel encoder, frame based processing in the Simulink is used, large frames of samples at each simulation time are easily processed which makes the simulation of the model faster as compared to sample based processing. After channel encoding, the bits are encapsulated into 625 bits at a rate of 1Mbps using a buffer block. Hence the entire packets are processed within a time frame of 625us.
hሺtሻ=Q ൭
CPM
In 1
We model the channel effect on the transmitted message signal with limitations to the effects of Additive White Gaussian Noise (AWGN) in order to simplify the functional demonstration of the system.
(7)
The 625 packets of bits are used to modulate a based signal using GFSK at a rate of 1Mbps. The GFSK which is implemented using a Continuous Phase Modulator (CPM) is used to transmit a +150 kHz signal relative to a carrier for a digital ‘1’, and a -150 kHz signal for a digital‘0’. This is shown in Figure 2, by reducing the bandwidth at the expense of increased inter-symbol interference and is indicated by the BT product parameter. The modulator outputs a narrow bandwidth complex baseband signal centred around 0 Hz. The frequency hopping code generation depicted in Figure 1 produces 100 samples of pseudorandom integers of the range 0 to 78. Each sample is generated at a rate of 625us.
In MATLAB, Simulink has a model for simulating the available channel noise. Figure 3 illustrates the AWGN module. To simulate the effects of noise on the transmitted signal, the module is added between the output of the transmitter module and the input of the receiver module. The module adds white Gaussian noise to the transmitted signal, which in turn introduces impairments. In a communication system, thermal noise is present at all levels, and the AWGN is used at the detection process to model noise introduced in the transmitted message signal. The AWGN model is characterised by a zero-mean and a variance, which can be specified by the symbol to noise power spectral density (Es/No) as indicated by the (8). This makes it useful for optimising the design of receivers for different random noises that are present in free space transmission.
For better simulation purposes, encapsulation of each integer sample into frames of 100 elements is done. This makes the entire duration of the frame equal to 62.5ms. Each sample integer value within the frame is used to generate different carrier frequency slot. The carrier signal is generated in
9
Receiver
AWGN
Channel
Channel
Hop _Index
FH-FM Demodulator
Cyclic Decoder
Frequency hopping FM Demodulator
Dis-assemble Packet
Rx_Symbols
Shortened Hamming (15 ,10 ) Decoder
Channel Frequency Hopping Code Generation
Fig. 3. Wireless Communcation Channel model using Simulink
Hop _Index
randint (1,100 ,78 ) Frequency hopping code , 1/1600 sec
u-39 Hop Frequency in MHz
Noise Variance ሺı2 ሻ=
Signal Power ×Symbol Period sample time ×10
(8)
EsΤNo 10
Fig. 4. Simulink Implementation of a Bluetooth Receiver 1
The maximum possible data rate that can be transmitted along the AWGN channel can be determined using a model which is a function of the noise variance (ı2 ), signal bandwidth (B) and the input signal power (P). The channel capacity is calculated in terms of maximum possible bits per symbol using the expression indicated in (9).
2-FSK
In 1
2 In 2
1 Out
To Frame
M -FSK Demodulator Baseband 79 -FSK
u
Generate 79 possible carriers -39 MHz to 39 MHz
Fig. 5. Simulink Implementation of FH Demodulation and FSK Demodulation
1 P CAWGN = log ൬1+ 2 ൰ 2 ı
De-capsulation is done on data packets so as to attain individual bits from the 625 bits of packets. The encapsulation into packets of 625 bits performed at the transmitter introduces a delay in the transmission. Similarly at the receiver, delay is introduced during de-capsulation of the 625 packets into frames of 15 bits. This delay that is created is sample based and is be modelled as;
(9)
To implement the AWGN module in Simulink based on the formulae presented in equation (8), the module requires the value of the variance. We use the signal-to-noise ratio (Es/No) to determine the variance. We use different signal-to-noise ratios to analyse the error probability performance of the Bluetooth system.
ds = tec +tbf +tad
C. Reciever A communication system should have a receiver component to complete the communication process. The Receiver structure includes Digital demodulation, Source decoding, Channel encoding, and formatting. This is practically done in reverse to the transmitter structure. The implementation is illustrated in the Figure 4.The demodulation process uses the same pseudorandom hopping sequence in synchronisation with the transmitter to de-hop the sequence and generate a co-related frequency for demodulating the received composite signal. In the process, the same set of frequency slots as the transmitter is generated, which serves as the centre frequency or local oscillator to demodulate the received signal. Each generated centre frequency is convolved with the received signal to down convert the signal back to a baseband signal. Prior to convolving the two signals the complex centre frequency is converted into a real signal by taking the conjugate. By doing so the phase is nullified as it is not used in this case for demodulation hence this process employs non-coherent demodulation. Although the amplitude is also altered it does not affect the information transmitted.
(9)
where, ds is the total delay at the receiver in samples tec is the delay during encapsulation into 625 in samples tbf is delay caused by deǦcapsulation buffer tad is the added delay The delay between the cyclic encoder and the decoder is equal to tdc =tec +tbf =640samples. The decoder takes 15 samples per frame up to 43 times, however the 43rd frame only consists of 10 samples. This implies that the 43rd sample has a wrong code word. Hence we delayed the time by 5 samples so that the decoder can sample exactly 43 frames with each frame having 15 bits or samples. This process is implemented in Simulink as illustrated in Figure 6. The process of decoding is used to detect possible errors thereby improving communication performance by increasing robustness against channel impairments. The received code word in polynomial form is given by (10):
In detail, the output baseband signal is fed to an MFSK demodulator using multidimensional non-coherent detection, parameters. The MFSK demodulator demodulates the signal back to 625 bit packet at a rate of 1Mbps. This is shown in Figure 5.
10
-5 z
1
through to the decoding of the receiver. The theoretical BER curve is included for comparison.
1
0
10
Buffer
Integer Delay
Theoretical BER Simulated BER(5 Sample Dalay) Simulated BER(0 Sample Delay)
-2
10
Fig. 6. De-capsulation Implementation in Simulink
-4
BER
10
-6
10
rሺxሻ=Uሺxሻ+eሺxሻ ,
(10)
-8
10
-10
10
whereǡ rሺxሻ is the received codeǦwordǡ Uሺxሻ is the transmitted codeǦwordǡ eሺxሻ is the error patternǡ
4
6
8 Es/No(dB)
10
12
14
16
B. Frequency Spectrum Visualisation The simulation was paused at an arbitrary time and the frequency domain showed the carrier frequency generated and it’s deviation at that particular moment when the simulation was paused. Here, we illustrate the frequency spectrum with respect to the different Es/No. 20
Magnitude, dB
IV. RESULTS The outcome of the implementation is based on several characteristics. The Frequency domain visualisation is included to view the pseudorandom frequencies and their corresponding magnitude. This also shows the noise level across all frequencies and hence can be used to analyse the effects of the Signal to Noise Ratio (SNR) in the spectrum. For further performance evaluation, the Bit error rate (BER) measurement is incorporated in the design to simulate the performance as this forms a key aspect in evaluating any digital system.
10 0 -10 -50 -40 Frame: 19
-30
-20
-10
0 Frequency (MHz)
10
20
30
40
50
Magnitude, dB
Fig. 8. Frequency Domain at Es/No = 0
A. Bit Error Rate (BER) The results in this section show the BER values of simulated and theoretical experiments versus the known Es/No values taken after every simulation of 19 packets.
20 10 0 -10 -50 -40 Frame: 19
-30
-20
-10
0 Frequency (MHz)
10
20
30
40
30
40
50
Fig. 9. Frequency Domain at Es/No = 5
Magnitude, dB
TABLE I. Bit Error Rate (BER) performance versus Signal to Noise Ratio (Es/No)
Theoretical BER 0.1598 0.1051 0.0573 0.0235 0.0062 0.0008 0 0 0 0 0
20 10 0 -10 -50 -40 Frame: 19
-30
-20
-10
0 Frequency (MHz)
10
20
50
Magnitude, dB
Fig. 10. Frequency Domain at Es/No = 10
20 10 0 -10 -50 -40 Frame: 19
-30
-20
-10
0 Frequency (MHz)
10
20
30
40
50
Fig. 11. Frequency Domain at Es/No = 15
Magnitude, dB
Simulated BER 0.4137 0.3659 0.3166 0.2485 0.1904 0.1125 0.0491 0.0038 0.0008 0 0
2
Fig. 7. Simulated BER (5 sample delay compensation versus 0 delay compensation) and Theoretical BER.
When decoding cyclic codes, both the syndrome and error are obtained. The syndrome is the remainder obtained by dividing the received polynomial by the generator polynomial. The error is estimated using the syndrome and the standard array
Es/No (dB) 0 2 4 6 8 10 12 14 16 18 20
0
Figure 7 shows the BER results obtained when we add a delay corresponding to 5 samples compared to when we do not add a delay after de-capsulation. This is to compensate the effects of the delay caused from the encoding of the transmitter
20 10 0 -10 -50 -40 Frame: 19
-30
-20
-10
0 Frequency (MHz)
10
20
Fig. 12. Frequency Domain at Es/No = 20
11
30
40
50
the margin hence prone signal degradation and attenuation. This practically explains why Bluetooth was developed for short range communication.
C. Link Budget The margin for link budget analysis is computed using MATLAB. The graph shown in Figure 13 shows the margin for link budget analysis computed corresponding to distance.
In conclusion, we have designed and simulated a Bluetooth DCS in this paper. We have learnt that by delaying the transmitted message by 5 samples we achieve an improved BER curve. We also learnt that by delaying the transmitted signal, the link budget margin is compromised because delay is proportional to the separation between the transmitter and receiver.
-45 -50 -55
Margin(dB)
-60 -65
Acknowledgment
-70
The authors would like to thank Stuart McGarrity of ‘The MathWorks Inc.’ for developing a Simulink Bluetooth model which was used as reference guide to design and analyse the modulation technique used in Bluetooth Communication.
-75 -80 -85 -90
0
10
20
30
40
50 60 Distance(m)
70
80
90
100
[1]
Fig. 13. A plot of Distance versus margin for Link Budget Analysis
V. DISCUSSION AND CONCLUSION [2]
From the result indicated in TABLE I, we can assert that the higher the Es/No the better the BER. At Es/No equal 20, we clearly achieve a BER of 0 which indicates that the communication system has a fairly good BER performance. The BER curve shown in Figure 7 shows a drop which indicates the simulated BER approaching 10-10 and lesser as the Es/No increases. Due to the limitation on the logarithmic scale plot, we were unable to indicate the Es/No that corresponds to BER of exactly 0. The curve depicting a delay of 5 samples shows better performance as compared to the curve indicating a delay of 0 samples. This is practically important for both transmitter and receiver to be properly synchronised.
[3]
[4]
[5]
In the spectrum scope depicted by Figure 8 to Figure 12, it is evident that the more we increase Es/No, the better the signal is received without error. According to the results, when Es/No is 0 dB (thus the information signal and the noise is equivalent in energy) it can be observed that the noise is spread over the entire spectrum. However, when we consider Es/No being 20 dB we can observe from the spectrum scope that the information signal is clearly noticeable in the confinement of noise. Figure 13 provides an idea of the gains and losses from the transmitter, through the medium and to the receiver. The figure shows the computed link margin corresponding to distance. Therefore we can indicate that, the larger the separation between the transmitter and the receiver the lower
[6] [7]
[8]
12
REFERENCES N. Golmie, “Performance Evaluation of a Bluetoothth Channel Estimation Algorithm,” in Proceedings of 13 IEEE Symposium on Personal, Indoor and Mobile Radio Communications, Lisbon, Sept. 2002, pp. 5-18. Wikimedia Foundation Inc, “Bernoulli distribution,” 20. [Online]. Available: http://en.wikipedia.org/wiki/Bernoulli_distribution#McCu llagh1989. [Accessed Oct. 12, 2014]. I. Poole, “Bluetooth radio interface, modulation, & channels,” Radio Electronics.com, [Online]. Available: http://www.radioelectronics.com/info/wireless/bluetooth/radio-interfacemodulation.php. [Accessed Oct. 20, 2014]. M. Z. Ullah, “An Analysis of the Bluetooth Technology,” M.S. thesis, School of Computing., Blekinge Institute of Technology, Karlskrona, 2009. S. Sairam, N. Gunasekaran and S. R. Reddy, “Bluetooth in Wireless Communication,” IEEE Communications Magazine, pp. 90-96, June 2002. Understanding Bluetooth, Hewlett-Packard, California, 2002,pp.4-9. S. H. Gerez. Class Lecture, Topic: “Implementation of Digital Signal Processing.” Department of Electrical Engineering, University of Twente, Feb. 7, 2013. National Instruments Corporation, “Pulse-Shape Filtering in Communications Systems,” Nov. 5, 2014. [Online]. Available: http://zone.ni.com/devzone/cda/tut/p/id/3876. [Accessed Oct. 28, 2014].