• No results found

Software Acoustic Modem

N/A
N/A
Protected

Academic year: 2021

Share "Software Acoustic Modem"

Copied!
73
0
0

Loading.... (view fulltext now)

Full text

(1)

Institutionen f¨

or systemteknik

Department of Electrical Engineering

Examensarbete

Software Acoustic Modem

Examensarbete utf¨ort i elektroniksystem vid Tekniska h¨ogskolan vid Link¨opings universitet

av

Erik Karlsson

LiTH-ISY-EX–13/4740-SE Link¨oping 2013

TEKNISKA H ¨OGSKOLAN

LINK ¨OPINGS UNIVERSITET

Department of Electrical Engineering Link¨opings tekniska h¨ogskola Link¨opings universitet Link¨opings universitet SE-581 83 Link¨oping, Sweden 581 83 Link¨oping

(2)

Master Thesis

Software Acoustic Modem

by

Erik Karlsson

LiTH-ISY-EX–13/4740–SE

2014-04-23

Supervisor: Petter K¨allstr¨om Examiner: Dr. J. Jacob Wikner

(3)

I would like to thank a few people who have helped me during this thesis.

Thanks to my examinater Dr. J Jacob Wikner for sharing his time supervising this master thesis, and for his valuable ideas.

Thanks to my supervisor M.SC. Petter K¨allstr¨om for helping me and taking his time supervising this thesis.

Thanks to Anders Brodin at Aqwary AB for his support and for suggesting this thesis, and thanks to Aqwary AB for providing with the equipment necessary.

Thanks to Emil M˚artensson who helped me review code.

Thanks to Dr. Oscar Gustafsson for reviewing the system and for valuable ideas. Thanks to Fabian Hylin for reviewing this thesis report.

(4)

Contents

Acknowledgements ii

List of Figures vi

List of Tables viii

Abbreviations ix 1 Introduction 1 1.1 Background . . . 1 1.2 Thesis Formulation . . . 1 1.2.1 Transducers . . . 2 1.2.2 Radio Waves . . . 2 1.2.3 Acoustic Waves . . . 2

1.3 Approach to The Problem . . . 2

1.4 Channel . . . 3 1.4.1 Speed of Sound . . . 4 1.4.2 Transmission Loss . . . 4 1.4.2.1 Geometric Spread . . . 4 1.4.2.2 Attenuation . . . 5 1.4.3 Multipath Propagation. . . 6 1.4.4 Channel Model . . . 6 2 Digital Communication 8 2.1 Overview . . . 8

2.2 Modulation and Demodulation . . . 9

2.2.1 Upconversion and Downconversion . . . 10

2.2.2 Linear Modulation . . . 11 2.2.2.1 Hard Decisions . . . 11 2.2.2.2 Soft Decisions . . . 12 2.2.2.3 Modulation Coding . . . 13 2.2.3 Orthogonal Modulation . . . 13 2.2.4 Differential Modulation . . . 14 2.2.5 Pulse Shaping. . . 14 2.2.5.1 Boxcar Function . . . 14 2.2.5.2 Sinc Function . . . 16 2.3 Channel Coding. . . 17 iii

(5)

2.3.1 Overview . . . 17

2.3.2 Most Likely (ML) Decision Rule . . . 19

2.3.3 Low Density Parity Check Codes . . . 19

2.3.3.1 Message-Passing Decoding . . . 20

2.4 Noise. . . 21

2.4.1 White Gaussian Noise . . . 21

2.4.2 Quantification Noise . . . 22 2.5 Synchronization. . . 23 2.5.1 Amplification . . . 24 2.5.2 Phase Compensation . . . 24 2.5.3 Timing . . . 25 2.5.4 Frequency . . . 25 2.6 Adaptive Filters . . . 25 2.6.1 Multipath . . . 26 2.6.2 Feedforward Filter . . . 27

2.6.3 Zero Forcing (ZF) Equalizer. . . 28

2.6.4 Linear MMSE Equalizer . . . 28

2.6.4.1 Least Mean Square (LMS) . . . 29

2.6.4.2 Recursive Least Squares (RLS) . . . 29

2.6.5 Decision Feedback Equalizer. . . 30

3 The Receiver 31 3.1 Overview . . . 31 3.2 Data Package . . . 32 3.3 Signalband . . . 34 3.3.1 Synchronization . . . 37 3.4 Baseband . . . 38 3.4.1 Equations . . . 38 4 Implementation Considerations 42 4.1 Hardware . . . 42 4.2 Data Types . . . 43 4.2.1 Fixed Point . . . 43 4.2.2 Floating Point . . . 44 4.2.3 Usage . . . 44 4.3 Computational Cost . . . 45 4.3.1 Signalband . . . 45 4.3.2 Baseband . . . 47 4.4 Sampling . . . 47 5 Results 49 5.1 Conditions. . . 50 5.1.1 Air test . . . 50 5.1.2 Water test. . . 50

5.2 Air Test (one meter) . . . 51

5.3 Water Test (50m). . . 54

(6)

Contents v

5.5 LDPC . . . 59

6 Conclusions 60

6.1 Future Work . . . 61

(7)

List of Figures

1.1 First test setup . . . 3

1.2 Geometrical spread . . . 4

1.3 Multipath propagation . . . 6

1.4 Channel model . . . 6

2.1 Overview Digital communication system . . . 8

2.2 A modulator . . . 9

2.3 A demodulator . . . 9

2.4 Upconversion and downconversion . . . 10

2.5 Common linear modulation constellations . . . 11

2.6 ML linear modulation . . . 11

2.7 Soft decision example . . . 12

2.8 Gray coding . . . 13

2.9 Differential PSK . . . 14

2.10 Boxcar function. . . 15

2.11 Sinc function . . . 16

2.12 Sinc symbols . . . 16

2.13 Tanner graph (7,4) hamming code . . . 18

2.14 White Gaussian Noise . . . 21

2.15 Quantification. . . 22

2.16 Feedforward filter . . . 27

2.17 Feedback filter . . . 30

3.1 Transducer positions . . . 31

3.2 Receiver modules . . . 32

3.3 Signal package in time-domain . . . 33

3.4 The receiver signalband . . . 34

3.5 Freq.spectrum input energy . . . 35

3.6 Freq.spectrum after mixing . . . 35

3.7 Freq.spectrum after filtering and decimation . . . 36

3.8 Filter frequency response . . . 36

3.9 Overview receiver baseband . . . 38

4.1 Hardware . . . 42

5.1 Test air filt. coef. CH3 . . . 51

5.2 Test air filt. coef. end values . . . 51

5.3 Test air priori error and PLL . . . 52

5.4 Test air output symbols . . . 53 vi

(8)

List of Figures vii

5.5 Test 50m filt. coef. CH3 . . . 54

5.6 Test 50m filt. coef. end values. . . 54

5.7 Test 50m priori error and PLL . . . 55

5.8 Test 50m output symbols . . . 56

5.9 Test 50m output symbols2 . . . 56

5.10 Test 100m filt. coef. CH3 . . . 57

5.11 Test 100m filt. coef. end values . . . 57

5.12 Test 100m priori error and PLL . . . 58

5.13 Test 100m output symbols . . . 58

(9)

List of Tables

2.1 Soft decision example1 . . . 13

3.1 System variables . . . 34

3.2 Filter specification . . . 37

4.1 Computational cost signalband . . . 46

(10)

Abbreviations

ADC Analog to Digital Converter CDMA Code Division Multiple Access DAC Digital to Analog Converter DFE Decision Feedback Equalizer DSP Digital Signal Processing FSK Frequency Shift Keying ISI Inter Symbol Interference LDPC Low Density Parity Check LLR Log Likelihood Ratio LMS Least Mean Squares LSB Least Significant Bit ML Most Likely

MMSE Minimum Mean Square Error

OFDMA Orthogonal Frequency Division Multiple Access OSR Over Sampling Ratio

PLL Phase Locked Loop PSD Power Spectral Density PSK Phase Shift Keying RLS Recursive Least Squares RMS Root Mean Square

SIMD Single Instruction Multiple Data TDMA Time Division Multiple Access TL Transmission Loss

UWA UnderWater Acoustic WGN White Gaussian Noise

(11)

Introduction

1.1

Background

Aqwary AB is developing a platform for divers that is supposed to share data between divers. The data shared between divers will be e.g. depth, pressure in the tank (how much air) and an alarm to alert other divers if a problem has occured.

1.2

Thesis Formulation

The task of this master thesis is to develop a communication system for underwater communication with acoustic waves using simple hardware to keep cost low and time to market short. Simple hardware means trying to do most of the work in digital domain in-stead of analog domain, modern DSP/FPGA/microprocessors/processors contain much processing power. The communication range should be 100 meters underwater, and should be able to transmit the wanted data at least once every couple of seconds.

• 100 meters range

• Raw data rate of one-two kbit/s

• Use as little analog circuitry as possible • Use off the shelf transducer

(12)

Chapter 1. Introduction 2

Using little analog circuitry and an off shelf transducer will lower the cost of the hard-ware, the development will also be easier and flexible.

1.2.1 Transducers

A transducer can convert one form of energy to another form of energy (and the other way back to the first energy form), e.g. convert an electronic signal to sound pressure wave and sound pressure wave to an electronic signal. The transducer can therefore be used as a projector (transmitting) and a hydrophone (receiver). Piezoelectric or magnetostrictive transducers are usually used in underwater acoustics[1].

1.2.2 Radio Waves

Ordinary radio waves do not travel far in water, especially not in thick electrical conduc-tors like salt water. Radio waves with frequencies around 3−30 kHz travel approximately 20 meters in water and frequencies around 3-300Hz can travel hundreds of meters. This limits communication significantly since it will have a substantially short range or a very slow data rate.

1.2.3 Acoustic Waves

Acoustic waves propagate better than radio waves in water, e.g. whales can communicate far distances using low frequency acoustic waves. Higher frequencies get more attenuated than lower frequencies, the same applies for e.g. radio waves in air but not as rapidly as acoustic waves in water(or even more in air). The underwater acoustic channel is therefore bandlimited, the available bandwidth depends on the wanted range.

1.3

Approach to The Problem

In the first phase, previous underwater communication systems and the underwater com-munication channel were studied. Development was done with MATLAB. Developing in MATLAB before continuing with the actual implementation has the advantage of

(13)

faster development and that the design can be validated before realizing the actual im-plementation. The channel could also be simulated on a computer, making it possible to develop on a computer without doing field tests. There was a variety of channel models suggested, but a quite simple model was used. The channel model was an FIR filter with random tap delay and filter coefficients, and is further discussed in section 1.4.

Computer Computer Presonus Firestudio mobile Presonus Firestudio mobile Transducer

Figure 1.1: First test setup

The first testing setup for field tests (figure1.1) was done with some recording equipment (Presonus Firestudio mobile) connected to the transducer instead of mic/speakers and by creating a sound file in MATLAB, playing it and recording it, and afterwards analyzing the received signal in MATLAB.

When a design was chosen and implemented in MATLAB the first tests were done in air at short distances (< one m). This first simple setup was only used to do some initial test, but some water tests were done with this setup. Building testing equipment for underwater usage was harder than expected, cases that could protected the electronics from water were hard to get. Later in the project, testing equipment where the signal went through analog processing, was sampled and transmitted over USB to a computer that saved the samples for later processing were used.

1.4

Channel

The underwater acoustic (UWA) channel is considered to be challenging to send data in. Due to the dynamic behavior of the water which will lead to a change of the channel function over time. The speed of sound in water is much smaller than the speed of radio waves, this speed combined with the reflection of the acoustic signal on physical objects can cause severe multipath propagation.

(14)

Chapter 1. Introduction 4

1.4.1 Speed of Sound

The speed of sound is important when considering what channel access method for the shared medium to use. If TDMA (Time Division Multiple Access) is used then guard periods have to be used so messages do not collide. A quite accurate equation for the speed of sound in water is [2]:

c = 1449 + 4.6T − 0.055T2+ 0.00029T3+ (1.34 − 0.01T )(S − 35) + 0.016Z m/s

where T is the temperature of the water in degrees celsius, S is the salinity per mille and Z is the depth in meters. The temperature has the most significance, the speed will approximately be 1520 m/s.

1.4.2 Transmission Loss

The signal amplitude becomes attenuated when the signal travels through the water due to geometric spread and energy is converted to heat. The equations below come from [3]. 1.4.2.1 Geometric Spread a spherical spreading D R R b cylindrical spreading

Figure 1.2: Geometrical spread

The standard measure of transmission loss (T L) in underwater acoustics is the change in signal strength in decibel between a field point (I(R), where R is the distance to the source) and signal strength one meter from the source (I0 = I(1 m)):

T L = −10log I(R) I0



(15)

For spherical spreading the signal strength is proportional to a sphere (figure 1.2 a), that is:

I ∝ 1 4πR2

With the standard measure (eq. 1.1) this gives us:

T Lspherical = −10log  1 R2  = 20log(R)

When the acoustic energy reaches the surface or ocean floor the energy gets reflected, keeping the energy between the surface and the ocean floor. The energy will be spread over an area of a cylinder (without bottom and top). In practice the reflections will lose some energy when they bounce on the surface or ocean floor. The signal strength will be:

I ∝ 1 2πRD

where D is the depth, and is assumed to be constant. The transmission lost will be:

T Lcylinder = 10log(R)

Spherical spread holds for near field communication (R ≤ D) and cylindric spread holds for long-range or shallow waters (R  D).

1.4.2.2 Attenuation

The acoustic energy will be continuously absorbed when it travels through the water, the energy will be transformed into heat. There will also be energy lost in the signal due to inhomogeneities in the water. The result of these effects will be that the energy decays as a function of range. A simplified expression for the attenuation as a function of frequency (f ) is: T Lattenuation ' 3.3 × 10−3+ 0.11f2 1 + f2 + 44f2 4100 + f2 + 3.0 × 10 −4f2dB/km (1.2)

Where f is in frequency in kHz. A 40 kHz signal will be attenuated approximately 1.3 dB in 100 meters. The attenuation in eq. 1.2function will grow with frequency, that

(16)

Chapter 1. Introduction 6

is the reason most underwater acoustic communication systems transmit in the lower frequencies which also limits the transmission rate (limited bandwidth).

1.4.3 Multipath Propagation sea surface ocean floor Direct path multipath multipath

Figure 1.3: Multipath propagation

The reflections in the cylinder formula (section 1.4.2.1) will have a different path than the direct path (see figure1.3), so that energy will be spread out in time. The less energy lost in T Lcylinder compared to T Lspherical is therefore only beneficial if the receiver can

add up the time scattered signal.

In the shallow water channel, the reflections mainly come from channel boundaries. The multipath problem varies with the particular geometry of the channel.

1.4.4 Channel Model t1 t2 tN aN a1 a2 …. + …. + s(t) s(t-t1) r(t) s(t-t1- t2) s(t-t1-..- tN)

Figure 1.4: Channel model

The channel model used is shown in figure 1.4, mathematically that is:

r(t) =

N

X

i=1

(17)

where Ti= i X j=1 tj

The channel variables are random within an interval, i.e. N , ai for i = 1..N and ti for

i = 1..N . The problem with the channel model was to know what interval to choose for the variables for the specific channel. How many multipath components N can be expected? what time delays ti and what attenuation ai can be expected? Most of the

reports I found were on longer channels (> 100 m), so I used values that I though were reasonable from the equations above.

The channel model was mostly used in the first half of the project, in the later part of the project I found real recordings more useful. The maximal number of path used was N equal to three (one direct path and two alternative paths). The attenuations used were decreasing, i.e. a1 > a2 > a3 which is a simplified view of the real behavior. The

total delay was maximum TN was two ms, which is roughly the delay of a surface bounce

(18)

Chapter 2

Digital Communication

This chapter tries to briefly cover the general digital communication techniques used or considered during this thesis. The content of this chapter can be considered as common knowledge within the field and the information can be found in a digital communication book covering the basics.

2.1

Overview

Source encoder Channel encoder Modulator Channel Demodulator channel decoder Source decoder data source data sink

Figure 2.1: An simple overview of a digital communication

The purpose of a digital communication system is to transfer information from one point to another via a channe. Which can be both wireless or a wire. The information transferred is in digital form (i.e. bits), even if the information is analog and consumed in analog form (e.g. music) there are some advantages to convert it to digital form. Digital data can be compressed, i.e. less data needs to be sent over the channel and bandwidth can be saved. Compressing is the task of the source encoder block in figure

2.1.

(19)

The channel encoder can add redundancy in the information to be sent to detect or actually correct them in the channel decoder. If the channel encoder should only de-tect errors or correct them will depend on the characteristics of the channel and the communication. Typical error correction will need more information redundancy than error detection and if more bits should be corrected/detected more redundancy will be required.

The information is in digital form. But has to be converted to analog waveforms to be transmitted efficiently over the physical channel, the modulator converts time-discrete bits into these analog waveforms. The demodulator converts the received analog wave-forms that are reshaped by the physical channel back to bits. Several transmitters can share the same physical channel by sending at different frequencies/times and therefore not disturbing each other.

2.2

Modulation and Demodulation

Coding Pulse shaping Upconversion Bits Baseband symbols Baseband signal Passband signal Figure 2.2: A modulator

The coding block in figure 2.2 converts bits to baseband symbols, if linear modulation is used. The baseband symbol is then spread over a symbol period by the pulse shaping block, producing a baseband signal. The baseband signal is upconverted to passband to be transmitted over the channel.

Decoding Pulse shaping Downconversion Bits Baseband symbols Baseband signal Passband signal Figure 2.3: A demodulator

At the receiver is the passband signal is converted to a baseband signal by the demod-ulator block, see figure 2.3. The pulse shape block time limit the signal to a symbol period (baseband symbols). Bit estimates is done from the baseband symbols.

(20)

Chapter 2. Digital Communication 10

2.2.1 Upconversion and Downconversion

The information sent over the channel (passband signal) can be represented with a complex baseband signal. A baseband signal has its energy centered around f = 0 Hz frequency and a passband signal has its energy centered at a frequency f = fc 6= 0Hz

where fc is the carrier frequency. The complex baseband signal can be written as

sb = sI + jsQ, where sI is called the in-phase component (or just I component) and

sQ is called the quadrature component (or just Q component). The passband signal is:

Spt(t) = SIφI+ SQφQ, where: φI= √ 2cos(2πfct) φQ= − √ 2sin(2πfct)

To downconvert the passband signal back to baseband consider

2Sp(t) cos(2πfct) = 2SI(t) cos2(2πfct) − 2SQ(t) sin(2πfct) cos(2πfct)

= SI(t) + SI(t) cos(4πfct) − SQ(t) sin(4πfct) (2.1)

if we lowpass filter eq. 2.1, the second and third term will be removed and what we have left is SI(t). In a similar fashion SQ(t) can be obtained by multiplying with φQand then

lowpass filtered. Upconversion and downconversion is done by the blocks in figure2.4.

X

X

ΦI ΦQ

X

X

ΦI ΦQ Lowpass filter Lowpass filter Upconversion (baseband to passband) Downconversion (passband to baseband) SI(t) SI(t) SQ(t) SQ(t) Sp(t)

(21)

4-PSK 8-PSK 16-QAM

Figure 2.5: Some common constellations for linear modulation

2.2.2 Linear Modulation

Figure 2.5shows some different modulation constellations, the real axis corresponds to the in phase (I) component and the imaginary axis corresponds to the quadrature phase (Q) component. Phase shift keying (PSK) corresponds to transmitting a sinusoidal with different phases, 4-PSK have four different phases and each symbol contains the information of two bits (log2(4) = 2). Thus different modulation constellations may have more or fewer bits/symbol ratio, since a constellation with more bits/symbol the symbols will be closer to each other (assuming the same energy) and the demodulator will be more prone to do bit- or symbol errors. A modulation constellation with high bits/symbol ratio will have higher data rate, but it will require a higher signal-to-noise (SNR) ratio.

The alphabet of a communication system is the set of possible symbols to transmit. The bandwidth efficiency of a linear modulation system is approximately log2M (bits/s)/Hz [4, p. 53], where M is the number of symbols in the alphabet.

2.2.2.1 Hard Decisions

4-PSK 8-PSK 16-QAM

(22)

Chapter 2. Digital Communication 12

When the signal gets transmitted over the channel it gets reshaped by the channels transfer function. This will make the symbols in the complex baseband representation will differ from the transmitted (ideal) locations. The demodulator has to take a decision how to interpret the received symbols, a hard decision demodulators output is what symbol it thinks was transmitted based on the received symbol. The procedure of taking a decision on what symbol was transmitted is called decision rule. A common decision rule is the ML (most likely) decision rule, it maps the received symbol to the nearest symbol in the alphabet (see figure 2.6).

2.2.2.2 Soft Decisions s1 s3 s4 s2 1 -1 -1 (0.25,0.5) (1.5,-2) 1

Figure 2.7: Soft decision example

The output of a soft decision demodulator are the probabilities of what symbol/bits were transmitted, this is advantageous when error correction or error detection codes are used because it is fed with more information than a hard decision demodulator provides. To calculate the probabilities the following formula can be used [4, p. 108]

π(i|y) = π(i) exp(−

||y−si||2 2σ2 ) PM j=1π(j) exp(− ||y−sj||2 2σ2 ) (2.2)

where y is the received symbol, π(i|y) is the probability that symbol i was sent when symbol y was received, π(i) is the probability that symbol i is transmitted, M is the number of symbols in the alphabet, σ is the channel noise variance and siis the complex

value of symbol i. Table2.1 shows the results of the example shown in figure2.7 using eq. 2.2.

(23)

π(i|y) y = (0.25,0.5) y = (1.5,-2)

1 0.455 0.017

2 0.276 0.001

3 0.102 0.047

4 0.167 0.935

Table 2.1: Soft decision example (σ2= 1 and π(i) = 1/4 for all i)

2.2.2.3 Modulation Coding 00 01 11 10 d1 Gray coding d2 s1 s2 s3 s4 00 01 10 11

Figure 2.8: Gray coding

The distance between symbols S1 and S4 (d2) is shorter than the distance between

symbols S1 and S3 (d1) in figure2.8, therefore is it more likely that a S1 symbol will be

interpreted as a S4 symbol instead of a S3 symbol. Comparing the mappings in figure

2.8 shows that the left mapping (gray code) has a benefit over the right mapping, the probability for a symbol error Pe is the same but the probability for a bit error Pb is

smaller because interpreting a S1 symbol as a S4 symbol will lead to only one bit error

for gray coding compared to two bit errors for the right mapping.

2.2.3 Orthogonal Modulation

Frequency shift keying (FSK) is a commonly used orthogonal modulation technique, the FSK signal over an interval of length T is given by

si(t) = ej2πfitI[0,T ], i = 1, ..., M

where fi are the different frequencies, j is the imaginary unit, t is time and I[0,T ] is a

symbol pulse. The distance between the tones |fk− fi| is chosen so that the M different

symbols are orthogonal. The bit rate for the FSK is (log2M )/T . The tone spacing for a coherent FSK system has to be 1/2T resulting in a bandwidth usage of approximately

(24)

Chapter 2. Digital Communication 14

M/2T , and for a non-coherent FSK system the tone spacing has to be 1/T and the bandwidth usage of M/T . The bandwidth efficiency will be (2 log2M )/M (bits/s)/Hz and log2M/M (bits/s)/Hz for coherent and non-coherent FSK respectively [4].

2.2.4 Differential Modulation

Differential modulation uses PSK constellations, but the information is encoded in the phase transition between symbols instead of the absolute phase of one symbol. The differential modulation (DPSK) technique is useful in a channel where the amplitude and phase varies over time, as long as the phases does not change too much between to successive symbols the DPSK can handle the variations with time. Figure2.9illustrates DPSK. 00 01 10 11 Figure 2.9: Differential PSK 2.2.5 Pulse Shaping

The time discrete baseband symbols are pulsed before transmitted over the channel, there are several pulses with different time and frequency characteristics. Two pulses are presented below, one with good time characteristics and one with good frequency characteristics. Usually another pulse is used that has good enough characteristics in both domains (e.g. raised cosine).

2.2.5.1 Boxcar Function

The boxcar function is viewed in figure 2.10, in time domain it’s defined as:

f (t) =    1 −T /2 ≤ t ≤ T /2 0 otherwise.

(25)

−10 −5 0 5 x 10−3 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time Domain Time Amplitude −600 −400 −200 0 200 400 600 0 10 20 30 40 50 60 70 80 90

Frequency Domain shifted

Frequency

Amplitude

Figure 2.10: Boxcar function

where T is the symbol period. In time domain this is the ideal pulse shape filter, it has no ISI (Inter Symbol Interference) and it also makes timing easy in the receiver because sampling will be equally good anywhere −T /2 ≤ t ≤ T /2. The fourier transform of the boxcar function is:

W (f ) = Z ∞ −∞ f (t)e−j2πf tdt = Z T /2 −T /2 e−j2πf tdt = e −j2πf t −j2πf T /2 −T /2 = e−jπf T − ejπf T −j2πf = T sin(πf T ) πf T ≡ T sinc(f T ) (2.3) The fourier transform is illustrated in figure 2.10. Since the sinc function attenuates with an envelope of 1/(πxT ) it spread its energy over a wide frequency range (”infi-nite”), this frequency spread is undesired because the signal will interfere with other signal bands in frequency division multiplexing. There are more reasons to limit the frequency spread, in the receiver the bandpass filter with small bandwidth will remove more white noise energy and will be less sensitive to distortions because it will attenuate ”more” frequencies. The amount of bandwidth one can use can also be restricted by the government as in e.g. radio.

Eq. 2.3illustrates that for a shorter symbol period (T ) the frequency envelope 1/(πxT ) decays slower, meaning that a higher symbol rate requires a wider frequency band.

(26)

Chapter 2. Digital Communication 16

Higher symbol rate generally requires more bandwidth holds and not only for the boxcar function. 2.2.5.2 Sinc Function −5 0 5 x 10−3 −0.2 0 0.2 0.4 0.6 0.8 1 Time Domain Time Amplitude −50000 0 5000 0.5 1 1.5 2 2.5 3

3.5Frequency Domain shifted

Frequency

Amplitude

Figure 2.11: Sinc function

The Sinc function (figure2.11) is a sinc in the time domain and a boxcar in the frequency domain. This function is strictly limited in the frequency domain, which makes it easy to keep the energy in a certain frequency band.

With the sinc function will symbols overlap with each other and cause ISI, unless perfect sampling is performed see figure 2.12. Since perfect sampling is hard to attain will the sinc function probably cause ISI, especially with multipath propagation.

−8 −6 −4 −2 0 2 4 6 8 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 Time Amplitude

(27)

2.3

Channel Coding

The goal of channel coding is to control the correctness of the received data (error detection) or to correct data errors (error correction). Channel coding is done by adding extra (redundant) information to the data transmitted and then using this information in the receiver to recover from errors introduced by the channel. There are several error correction techniques but only the techniques considered in this master thesis are presented.

2.3.1 Overview

Convolutional codes are important because they are commonly used both as channel coding technique and as building blocks in other techniques as turbo codes and LDPC codes. Turbo code is a forward error correction code class and was the first practical code to perform near channel capacity. For each of n input bits to the encoder the output is m bits where m ≥ n ((m,n) code) and the code ratio is R = n/m, generally a lower code ratio R (more redundancy) increases the error correction/detection possibility. If we only consider non-recursive codes (i.e. coded word only depend on input bits not previous output bits). A code is defined by the set ζ of 2n (xζ ∈ ζ) possible codewords.

All codewords (valid and not valid) are written as:

x = [x1, ..., xm]

and the 2n possible information words are:

u = [u1, ..., un]

The codeword x is generated by bit multiplying (modulo-2) the information word x with a generator matrix G which is a n × m matrix:

(28)

Chapter 2. Digital Communication 18

A parity check matrix H with dimensions (m − n) × m is then used to check if the incoming codeword is valid

HxζT = 0

Using the well known (7,4) Hamming code as an example we have the generator matrix

G =         1 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 1 1 1 1        

and the parity check matrix

H =      0 1 1 1 1 0 0 1 0 1 1 0 1 0 1 1 0 1 0 0 1      x1 x2 x3 x4 x5 x6 x7 c1 c2 c3

Figure 2.13: Tanner graph for (7,4) Hamming code

A tanner graph [5] can be generated using the parity check matrix H of a code, where the nodes to the left correspond to codeword bits and the right nodes corresponds to check equations. E.g. the first row in the (7,4) Hamming code corresponds to check node c1, the check equation is

(29)

2.3.2 Most Likely (ML) Decision Rule

If we denote the received soft decision vector ¯xs then the most likely (ML) decision rule

is picking a valid codeword xζi with the shortest euclidean distance to the received soft

decision vector. The euclidean distance between two vectors ¯x, ¯y with length n is:

d(¯x, ¯y) =p(x1− y1)2+ .. + (xn− yn)2= v u u t n X i=1 (xi− yi)2

then the ML decision rule for soft decision is

˘

x = min

i=1..md(¯xs, xζi)

where ˘x is the most likely codeword of the m valid codewords.

For hard decision ML decision the hamming distance dH(¯x, ¯y) is used instead, which is

the number of bits that differ between bit vectors ¯x and ¯y. If the hard decision received vector is ¯xh, the ML rule is:

ˆ

x = min

i=1..mdH(¯xh, xζi)

where ˆx is the most likely codeword decided with a hard decision vector and the m valid codewords.

If there are several codewords with the same distance (euclidean/hamming), the output can be either of them (or both) or just interpret as an error (error detection).

2.3.3 Low Density Parity Check Codes

Low Density Parity Check codes were first invented in 1962 [6] but were forgotten until after turbo codes were introduced in 1993 and two researchers, McKay and Neal redis-covered LDPC [7]. The LDPC perform near Shannon limit, especially for large block lengths [7]. LDPC codes use ordinary convolutional and the term ”low density” referring to the sparseness of ones in H, an iterative algorithm passing soft decisions between the variable nodes and check nodes (see Tanner graph figure2.13) is used to decode. Regular (dv,dc) LDPC codes have dv ones (weight) in each column in the parity check

(30)

Chapter 2. Digital Communication 20

(number of connections for each check node). When the code length increases and the code rate R is constant the dimensions of H scale up, dv and dc should remain constant

low (sparseness).

Irregular LDPC codes have different column and row weights, which are chosen in a random matter based on a specified degree distribution [4, p.347]. Irregular LDPC codes perform better than regular, and generally the more irregular bit degree distribution the better. The irregular codes may converge faster because the check equations with lower weight can converge faster and give more certain decision to the longer check equation.

2.3.3.1 Message-Passing Decoding

The sum-product decoding algorithm is shortly presented here (for a more compre-hensive guide [7]). The input bit probabilities to the LDPC decoder are called priori probabilities, the output bit error probabilities from the decoder are called posteriori probabilities. The probabilities are expressed as Log-Likelihood Ratios (LLR)

L(xi) = ln

 p(xi = 0)

p(xi = 1)



where p(xi = 0) is the probability that bit xi is a zero, p(xi = 1) is the probability that

bit xi is one. If we know that xi = 0 then L(xi) is a large positive number and if we

know that xi = 1 then L(xi) is a large negative value, the sign of L(xi) can be used as

a hard decision criteria.

The extrinsic message Ej,i from check node j to bit node i is the LLR probability for bit

node i computed by check node j, check node j computes Ej,i with a LLR message Mj,i0

from all the other nodes connected to j (i0 ∈ Bj, i0 6= i, Bj is the bit nodes connected to

check node j). The LLR message from check node i is node used to calculate extrinsic message to node i, that would cause instabilities. The extrinsic message is

Ej,i= ln 1 2 + 1 2 Q i0∈B

j,i06=itanh(Mj,i0/2)

1 2 − 1 2 Q i0∈B

j,i06=itanh(Mj,i0/2)

!

The input to the algorithm are the priori probabilities ri for each bit i, for each iteration

a posteriori probability is calculated with the extrinsic (Ej,i) information. With the

(31)

satisfied with the hard decisions then the algorithm is stopped and the hard decisions are the output. The posteriori probability is

Li =

X

j∈Ai

Ej,i+ ri

If the check equations are not satisfied then the bit node i computes a LLR message Mj,i to check node j which is the posteriori probability without the extrinsic message

from check node j (Ai is the check nodes connected to bit node i), .

M j, i = X

j0∈A i,j0=j

Ej0,i+ ri

2.4

Noise

All real applications will experience noise. Below are some usual noise components presented.

2.4.1 White Gaussian Noise

Sn(f)

f

N0/2

Figure 2.14: White Gaussian Noise

Due to the channel and the electronics used unwanted noise is going to be introduced in the system, this noise is usually modeled as White Gaussian Noise (WGN). WGN has constant Power Spectral Density (PSD) and is measured in watts per hertz of bandwidth, i.e. ideal WGN has infinite power (figure 2.14) but because bandpass filtering is done at the receiver (assuming ideal) the power WGN is finite and is proportional to the bandwidth used. For an ideal receiver (i.e. perfect components) the white noise is [4, p. 87]

(32)

Chapter 2. Digital Communication 22

where k = 1.38 × 10−23joule/kelvin is the Boltzmann’s constant, T0 is the temperature

in kelvin (290K in room temperature). All components have a noise figure associated with it, which is the ratio in dB of the SNR in and out

N F = 10 log F = 10 log SNRin SNRout

= SNRin,dB− SNRout,dB

where F is called noise factor. The white noise included the noise figure is [4, p. 88]

N0 = kT 10N F/10

When several components are cascaded the total noise factor can be calculated with Frii’s formula [8] for noise

Ftotal= F1+ F2− 1 G1 +F3− 1 G1G2 + ... + Fn− 1 G1G2...Gn (2.4)

where Gnis the power gain. Eq. 2.4illustrates that the first stage has a major effect on

the receiver performance, for the first stage, high power gain Gnand a low noise factor

Fnis wanted.

2.4.2 Quantification Noise

Analog signal Digital

signal n(analog - digital)q =

Analog signal

q/2

-q/2

Figure 2.15: Quantification

Quantification noise nq is introduced because signals can not be represented exact in

digital domain, so when the signal is sampled (ADC) quantification noise is introduced. The power of quantification noise depends on how many bits are used to represent the signal. Figure 2.15 shows the quantification noise nq which is the difference between

(33)

the analog signal (signal with infinite resolution) and the digital representation. The smallest difference between two numbers that can be represented is equal to the value of the Least Significant Bit (LSB) and is noted as q = 2−N where N is the number of bits used. The Root Mean Square (RMS) of the nq is [9]

q ¯ n2 q= q √ 12

An ideal signal, i.e. a full scale sinusoidal is

v(t) = q2 N 2 sin(2πf t) and the RMS of v(t) is RM S(v(t)) = q2 N 2√2

The Signal to Noise Ratio (SNR) in dB is SNR = 10 log10(Psignal

Pnoise) = 20 log10(

Asignal

Anoise)

where P stands for power and A is amplitude. The SNR between a full scale signal and the quantification noise is

SNRq= 20 log10 q2N/2√2 q/√12 ! = 20 log102N + 20 log10 r 3 2 ≈ 6.02N + 1.76dB (2.5)

The above formula is a simplified expression first derived from W.R Bennet [10], how-ever the expression is usually good enough. Quantification noise is usually modeled as white noise, i.e. equally distributed over the frequency spectrum (0 < f < fs/2) and

independent of the input signal. I.e. the SN Rq is affected on the number of bits used

N and if the signal utilizes the whole range (full scale).

2.5

Synchronization

The receiver has to track unknown (at the beginning) parameters such as amplitude, frequency and phase shifts that the channel introduce. Synchronization is tracking and compensating for this parameters. Non-coherent system try to decode the signal without tracking the carrier phase, in e.g. wireless channels can this be useful because the phase can be hard to track over time. Some processing in a coherent system (tracks the

(34)

Chapter 2. Digital Communication 24

carrier phase) is non-coherent, e.g. timing synchronization. A mathematical model for the received baseband signal y(t) before synchronization for the transmitted complex baseband signal u(t) =P

nb[n]gtx(t − nT ) (gtx is the transfer function (pulse shaping)

of the transmitter and b[n] is the transmitted symbol as a boxcar) is

y(t) = Aejθu(t − τ )ej2π∆f t+ n(t)

= Aej(2π∆f t+θ)X

n

b[n]gtx(t − nT − τ ) + n(t)

The parameters introduced by the channel and non-ideal effects in the electronics com-bined is attenuation A, θ is the phase offset, τ is the time delay, ∆f is the offset in carrier frequency and n(t) is noise.

2.5.1 Amplification

The signal can be amplified at the receiver to counter the attenuation A, the attenuation will lower the SNR in the receiver. The receiver should have a Low Noise Amplifier as a first stage because the first stage has major effect on the noise factor of the receiver as shown in eq. 2.4. In digital domain and when going to digital domain (ADC input) the signal should be amplified to keep the signal full scale so the SN Rq is kept low, e.g. eq.

2.5 shows that if only half the digital range is used the maximal achievable SN R will drop 6dB .

2.5.2 Phase Compensation

The unknown phase offset θ can be calculated e.g. if a known signal is sent (training mode) at the beginning of the message, if s[n] is the known transmitted complex signal and y[n] is the received complex signal. The most likely phase offset is [4, p. 166]

ˆ

θM L= arg

Zs

Zc

, z[n] = Zc+ jZs= y[n]s∗[n]

where ∗ is complex conjugate. When the phase offset is known, the received signal can be phase compensated by ˆy[n] = y[n]e−j ˆθM L. The phase offset may vary over time, a

(35)

known at the receiver and a PLL takes the phase error as input, so the receiver first have to decode the signal before calculating the phase error (decision mode).

2.5.3 Timing

The task of timing is to first find when a message starts, and then find where each symbol starts and ends. The delay τ is in modulus T (symbol interval), i.e. finding τ compares to symbol timing. If a known signal s(t) is transmitted, a matching filter can be used sM F(t). The most likely time delay is then [4, p. 168]

ˆ

τM L= arg max

τ |(y ∗ sM F)(τ )|

where y(t) is the received signal, and ∗ corresponds to convolution.

2.5.4 Frequency

The carrier frequency of the received signal and the receivers local carrier frequency may vary due to Local Oscillator differences or due to the channel (Doppler effect). A frequency offset ∆f will cause the received complex to rotate over time. The transmitter could start a message by transmitting the carrier frequency (without modulation), then the receiver could use a PLL to track the received carrier frequency. The received carrier frequency may change over time, when a first frequency offset ∆f and phase offset θ is estimated a PLL can continue to track the frequency.

2.6

Adaptive Filters

Adaptive filtering tries to track the unknown channel function and use the inverse chan-nel function on the received signal to get the transmitted signal. A known signal (for the receiver) can be used (training mode) and/or the receiver can estimate the transmitted signal (decision mode).

(36)

Chapter 2. Digital Communication 26

2.6.1 Multipath

A model for multipath propagation is

y(t) =

M

X

k=1

Akejφku(t − τk)e−j2πfcτk (2.6)

where y(t) is the received signal, k is an index for the multipath components, Ak is

attenuation, τkis the relative delay, φkis the phase variation, fcis the carrier frequency

and the number of multipath components is M . Since fc is large and a small difference

in delay τk will make a big change in the phase, the phase can be modeled as a variable

θk = φk− 2πfcτk. A channel transfer function h(t) is defined as y(t) = h(t) ∗ u(t), so

the transfer function for eq. 2.6is

h(t) =

M

X

k=1

Akejθkδ(t − τk) (2.7)

where δ(t) is the Dirac delta function. When the receiver and transmitter are mobile, the variables Ak, θk and τk in eq. 2.7 may vary over time. Eq. 2.7is at signal rate, the

equation can be transformed to discrete time:

h[n] =

M

X

k=1

Akejθkδ[n − k] (2.8)

where Ts= 1/f is the sample period.

Eq. 2.8can also be represented as a vector h0 in the following way

h[n] = δ[n]h0 = h δ[n]..δ[n − M ] i      A1ejθ1 .. AMejθM      (2.9)

(37)

T T T aN a1 a2 …. + …. + S[n+f1] S[n-1+f1] d[n] + aN-1 T S[n-f2] S[n+1-f2]

Figure 2.16: Feedforward filter

2.6.2 Feedforward Filter

Instead of using one baseband symbol S[n] to decode the received signal, a feedforward filter takes a vector of samples

S[n] =            S[n + f1] S[n − 1 + f1] ... S[n + 1 − f2] S[n − f2]           

where f1 is the number of samples after the desired sample S[n], f2 is the number of

the desired samples after the desired sample S[n] and number of samples in the received vector S[n] is f = 1 + f1+ f2.

The geometric model for the received vector S[n] is

S[n] = Ub[n] + w[n] (2.10)

where b[n] is the transmitted symbols, w[n] is a white-gaussian noise vector and U is a vector combined of h0 as in eq. 2.9and time shifted versions of h0. E.g. if a symbol

spaced receiver has three feedforward filter taps the received vector is (assuming only three transmitted symbols in this simple example):

S[n] =      A1ejθ1 0 0 A2ejθ2 A1ejθ1 0 A3ejθ3 A2ejθ2 A1ejθ1           b[n − 1] b[n] b[n + 1]      +      w[n − 1] w[n] w[n + 1]     

(38)

Chapter 2. Digital Communication 28

The received vector S[n] can then be divided into the wanted part including b[n] and the unwanted part withP

i6=0b[n + i] and w[n]

S[n] = b[n]h0+

X

i6=0

b[n + i]hi+ w[n]

The received vector is then multiplied with the feedforward filter coefficient vector a to produce a decision statistic d[n]

d[n] = a∗S[n] = b[n](a∗u0) +

X

i6=0

b[n + i](a∗ui) + a∗w[n]

The goal of the adaptive filter algorithm is to make a so that a∗u0 is significantly larger

than the terms a∗ui, for i 6= 0.

2.6.3 Zero Forcing (ZF) Equalizer

The zero forcing solution is, if it exists

a∗u0= 1

and

a∗ui = 0, for all i 6= 0

The ZF equalizer will remove ISI efficiently but will enhance noise [4, p. 218]. A ZF equalizer can be used when the ISI is much more significant compared to the noise.

2.6.4 Linear MMSE Equalizer

The linear minimum mean squared equalizer tries to minimize the cost function [4, p. 220]

M SE = J (c) = E[|a∗S[n] − b[n]|2]

where b[n] is the symbol stream and E[] is the expected value function. During training mode the symbol stream b[n] is known, and during decision directed mode b[n] is the

(39)

symbol decision based on the equalizer output. The MMSE correlation vector is then

aM M SE= R−1p

where

R = E[S[n](S[n])∗], p = E[b∗[n]r[n]] (2.11)

Implementations of the MMSE algorithm replace the statistical expectations in eq. 2.11

with empirical averages. Below are two well know MMSE implementations

2.6.4.1 Least Mean Square (LMS)

[11, p. 236] Initialize ˆ a(0) = 0 Filter output y(n) = ˆa∗(n)S(n) Estimation error e(n) = d(n) − y(n) Tap-weight adaption ˆ

a(n + 1) = ˆa(n) + µS(n)e∗(n)

2.6.4.2 Recursive Least Squares (RLS)

[11, p. 443] Initialize ˆ a(0) = 0 P(0) = δ−1I and δ =     

small positive constant for high SNR large positive constant for low SNR

(40)

Chapter 2. Digital Communication 30

for each instant of time, n = 1, 2, ... compute

π(n) = P(n − 1)S(n),

k(n) = π(n) λ + S∗(n)π(n)

e(n) = d(n) − ˆa∗(n − 1)S(n) ˆ

a(n) = ˆa(n − 1) + k(n)e∗(n)

P(n) = λ−1P(n − 1) − λ−1k(n)S∗(n)P(n − 1)

where k(n) is called the gain vector, e(n) is the error estimate, π(n) is a help vector (intermediate calculation), P(n) is the inverse weighted sample correlation matrix of S(n), λ is the forgetting factor.

2.6.5 Decision Feedback Equalizer

Feedforward filter Feedback filter Symbol decision + 1/T symbol estimation m/T S[n]

Figure 2.17: Feedback filter

The ZF equalizer minimizes the ISI but has some noise enhancement associated with it, the MMSE equalizer tries to minimize the ISI-noise combined. Even though the MMSE takes the noise into account, the noise enhancement can still be significant. A DFE (figure 2.17) counters the ISI from past symbols by using a feedback from the priori decisions. The symbols in the feedback filter are ideal symbols based on the priori error so that there is no noise in the feedback signal, a wrong symbol decision will be fed back and may cause more error decisions (error propagation). Feedback filter reduces noise enhancement.

(41)

The Receiver

3.1

Overview

120

o

Figure 3.1: The transducer positions

The receiver uses three transducers (channels) as inputs and their physical positiones to cover a large area, the angle between the transducers are 120◦ in one direction and 0◦ in the other (in the same plane) and can be viewed in figure3.1. The total beam angle of the transducer is 120◦± 12◦ [12].

The receiver blocks/modules are shown in figure 3.2. The input signal is bandpass filtered and amplified in the analog processing block before being sampled by the ADC. The carrier frequency (Fc) is 40kHz and the signalband is 40 ± 1kHz, the ADC samples

at 96kHz and satisfying the Nyquist sampling theorem with some margin.

(42)

Chapter 3. The Receiver 32 Analog processing

ADC

Digital signalband processing Input channels / transducers Output Digital baseband processing Channel decoder

Figure 3.2: The receiver modules

After the ADC there is the digital signal processing block that converts the signal from signalband to baseband and does synchronization. Timing synchronization is done in the digital signal processing block, it detects when a package starts and what samples to use (timing). Digital amplification is also performed to reduce the numerically introduced errors (quantization) in later stages.

The baseband processing block performs phase synchronization, channel combining, channel equalization and the output is bit soft decisions.

The channel decoder iterates and tries to find a valid code with the soft decisions from the baseband processing block, if a valid codeword can not be found the package is thrown away.

3.2

Data Package

The signal is broadcasted to up to 70 users in a sphere of 100 meters. Multiuser access is done with TDMA. The transducer used [12] is bandlimited to 1kHz (−3dB), CDMA and OFDMA would require more bandwidth than TDMA to transmit at the same symbol rate T . The underwater acoustic channel is changing rapidly and keeping the data packages short in time can be advantageous. A disadvantage of using TDMA is the long guard times that have to be used due to the speed of sound in water, it takes 67ms for sound to travel 100 meters in water so the guard time has to be at least equal to that. If the guard time is 70ms and the package length is 50ms, a time slot has to be

(43)

120ms. If there are 70 users and the time slot time is 120ms, each user will transmit data every 8.4s. Broadcasting is used, so the receiver would have to decode several messages with different codes if CDMA is used. Transducers are usually narrow banded and OFDMA would require very slow symbol rates if we should transmit in the band where the transducer is efficient, or transmit at frequencies where the transducer is not efficient.

Probe sequenceTraining Data sequence

t

tdelay

Figure 3.3: The signal in time domain

The data to be transmitted consists of small data packages (4 bytes, 32 bits), but there are some additional symbols/bits in the data package (figure3.3) to ease the decoding. First there is the probe signal used to detect a new package, the probe is an one-symbol-long (T ) tone (just like a ordinary symbol). After the probe there is a pause which makes it easier to do the coarse timing. The pause will hopefully make the worst multipaths disappear before the message.

After the pause there is the training sequence that is a known sequence used to train the equalizer filter. The length of the training sequence has to be long enough so the filter coefficients have converged close enough to be able to decode the data when it arrives. One could argue that a long training sequence is a waste of bandwidth, but adding some extra bits/symbol is a small cost if it increases the performance, e.g. adding 10 symbols at a symbol rate of T = 1ms will make the data package 10ms longer but if the user is able to decode some message that it was not able to before and had to wait for 8.4s for the next package (as in the TDMA example). A too long training sequence will cause the channel to change during the message and the coefficients will not converge to a value.

Last in the data package is the the data sequence consisting of useful data and redundant data used for error detection/correction. The error detection/correction code used is LDPC with a code rate of 1/2 (32 data bits and 32 redundancy bits). The argument for using so much redundancy is the same as for the training sequence, that the cost is small compared to the redundancy of the the TDMA/guard times.

(44)

Chapter 3. The Receiver 34 Symbols Time[ms] Probe 1 1 Pause 4 4 Training sequence 10 10 Data load 16 16 Redundant data 16 16 Guard time 70 Total 117

Table 3.1: System variables (T = 1ms, 4-PSK)

The data package is summarized in table 3.1 for symbol period T = 1ms and with 4-PSK modulation, useful data is transmitted for 16ms out of 117ms which is a time slot. There is much overhead to start a package and the useful data in each package is low, if we would add more useful data to the package the efficiency would increase because much of the overhead would be the same (only redundant data would increase if we would use the same code rate). If higher useful data speed is desired then one should look at minimizing the guard times first.

3.3

Signalband

X

e

-j2πfct

LP

M1

M2

coarse timing synchronization Polyphase filter

a

Sp[m] sb[n]

Figure 3.4: The receiver signalband

The digital signalband processing block first mixes the signal down to baseband and then lowpass-filters the signal to symbol rate in frequency domain (−1/2T ≤ f ≤ 1/2T ), but keep more samples in time-domain. With sampling frequency fs and the symbol

frequency fsymbol = 1/T , the signal could be decimated by M = fs/fsymbol to be at

(45)

ωs/2 -ωs/2 -ωc ωc ωc - ωsymbol /2 ωc + ωsymbol /2 ω |S(f)| Noise

Figure 3.5: Frequency spectrum of the input energy

The input signal energy spectrum is viewed in figure 3.5, where ωc = 2πfc[rad/s] is

the carrier angular frequency (or just frequency) and ωs = 2πfs[rad/s] is the sampling

angular frequency. The signalband of interest is ωc±ωsymbol2 where ωsymbol is the symbol

angular frequency, the signalband is marked with a triangle. There is also unwanted white noise spread over the whole frequency spectrum.

ωs/2 -ωs/2 ωs-2ωc ω |S(f)| 2ωcs LP filter

Figure 3.6: Frequency spectrum of the signal energy after mixing

After mixing (multiplication with carrier frequency) some residual frequency components end up at ±(ωs− ωc) for reasons shown in section 2.2.1 and because we go to digital

domain folding occurs, the frequency spectrum of the signal after mixing is shown in figure 3.6. The dotted line shows the frequency response of the lowpass filter after mixing. The purpose of the lowpass filter is to remove the out-of-band noise and the undesired residual frequency components after mixing. A bandpass filter could be used before mixing to remove the out-of-band noise, and then use a simpler lowpass filter after mixing to remove the residual frequency components.

A polyphase filter (jointly filter and decimation) can be used in the mixer lowpass filter and the computational cost will be less than an ordinary filter, therefore no bandpass filter is used. If filtering and decimation is done separatley then the filter would compute

(46)

Chapter 3. The Receiver 36

unnecessary output samples that would be thrown away. This will lead to a cheaper computational cost and a better filter can be used instead for the same computational cost. ωs/(2M) -ωs/(2M) |S(f)| ωsymbol /2 -ωsymbol /2 ω

Figure 3.7: Frequency spectrum of the signal energy after filtering and decimation

After mixing, filtering and decimating the frequency spectrum looks like figure3.7. The baseband decoder wants fractionally sampled inputs, i.e. two samples per symbol so that the total decimation is M = M 1 × M 2 = fs

2fsymbol.

Figure 3.8: Filter frequency response

The filter coefficients are generated in MATLAB with the specification in table3.2, the frequency response can be viewed in figure 3.8

(47)

Filter length 82 Passband edge 0.04 Stopband edge 0.1 Passband ripple 0.1 dB Stopband ripple 50 dB Filter type FIR Design algorithm equripple

Table 3.2: Filter specification

3.3.1 Synchronization

A package probe is detected when the input signal energy is larger than a constant (after mixing, filtering and decimation with M 1), the ratio rsignal= fsymbolfs is the

num-ber of samples per symbol before decimation, each symbol is rsignal/M 1 samples after

decimation with M1. The probe find equation is: n X i=n−rsignal/M 1 Sd[i] > Ec

where sd[i] is the signal after mixing, filtering and decimation with M 1 and Ecis a energy

constant. When a signal probe has been detected the synchronization block looks for the end of the probe by finding the local maximum of the function:

ˆ

nmax = arg max n n X i=n−(rsignal/M 1) Sd[i]

note that the absolute is outside the sum, so a signal with constant phase will have a greater impact on the timing equations (less sensitive for noise). When a probe is found, the coarse timing block decides what samples to be fed to baseband processing via the decimation block M 2 (figure 3.4). It is not critical that the timing is exact because an adaptive filter and fractional sampling (several samples for each baseband symbol) are used.

The energy of the probe is:

ˆ Emax = ˆ nmax X

i=ˆnmax−(rsignal/M 1)

Sd[i]

(48)

Chapter 3. The Receiver 38

and is used to decide scaling a to utilize the numerical range without getting overflow. The scaling is

a = Eideal−probe− Emargin ˆ

Emax

where Eideal−probe is the energy of an ideal probe would result in. Emargin is a constant

used to have some margin to avoid overflow.

3.4

Baseband

Ha1[n] Ha2[n] Ha3[n] X X X + Hard decision Soft decision Hb[n]

-Equalizer and synchronization joint algorithm sb1[n’]

sb2[n’] sb3[n’]

Figure 3.9: Overview of baseband module

The baseband module block is shown in figure3.9, the equations are based on [13,14].

3.4.1 Equations

The feedforward coefficients are denoted by:

a0k= [ak−N1..a

k N2]

(49)

where the []∗ means complex conjugate of the vector. The number of coefficients are N = N1+ N2+ 1 and from the coarse timing synchronization the current symbol should

be multiplied with coefficient denoted ak0 and N1 earlier samples and N2 later samples

should be the input to the feedforward filter. The input to the feedforward filter is fractionally sampled by two (two samples per symbol), the term n0 means a sample space of T /2 (fractionally spaced) and n a sample space of T (symbol space). The inputs to the feedforward filter is:

sbk[n] = [sbk[n0+ N1]..sbk[n0− N2]]

The output of the feedforward filter is only computed at sample space and is carrier phase compensation:

pk[n] = a0ksbk[n]e−j `θk

Each of the feedforward filter outputs are then coherently combined:

p[n] =

K

X

i=1

pk[n]

The feedback filter coefficients are arranged in a vector:

b0 = [b1..bM]

where M is the number of decision symbols fed back, and they are arranged in a vector:

¯

d[n] = [ ¯d[n − 1].. ¯d[n − M ]]

And the output of the feedback filter is:

q[n] = b0¯d[n]

The output from the feedback filter is subtracted from the coherently combined feedfor-ward filter output:

ˆ

(50)

Chapter 3. The Receiver 40

The output symbol ˆd[n] is then used as input for the hard and soft decision demodulator. The output of the hard decision demodulator ( ¯d[n]) is used as input to the feedback filter and the the output of the soft decision demodulator ( ˘d[n]) is used as input for the error correction block.

The parameters that the updating algorithm updates are a0k, `θk for k = 1..3 and b0,

and the values are updated at a symbol interval. Updating the parameters is done by minimizing the Mean Squared Error (MSE), M SE = E[|d[n] − ˆd|2] where E[] is the expected value. The equalizer algorithm uses the calculated error as input for the updating function

e[n] = d[n] − ˆd[n]

During the training sequence the value of d[n] is known and the error e[n] can be cal-culated with certainty, but during decision mode (data sequence) d[n] = ¯d[] (but phase compensated) and a fault decision by the hard decision demodulator may cause the filter coefficients to diverge and the wrong decision will also be fed back to the feedback filter. To counter the fast phase fluctuations and coefficient rotations a second-order DPLL (digital phase locked loop) is used. Each of the input channels has a DPLL of their own, one could argue that only one DPLL is necessary (the phase fluctuations will be the same for all channels) but the relatively low cost of three DPLL is worth it. So the updating algorithm is divided into two steps, first phase compensate and then calculate the new filter coefficients. The phase error can be calculated by:

Φk[n] = arg( ¯d[n]) − arg( ˆd[n])

A second order DPLL equation looks like this:

` θk[n + 1] = `θk[n] + KPΦk[n] + KI n X i=0 Φk[i]

(51)

The input to the adaptive filter algorithm looks like this: ˆ d[n] = [a01..a0Kb0]         sb1e−j `θ1[n+1] .. sbKe−j `θK[n+1] −¯d[n]         = c0u[n]

(52)

Chapter 4

Implementation Considerations

4.1

Hardware

Microprocessor (Atmel SAM4S) Processor (TI arm9) Analog frontend USB Transducer Figure 4.1: Hardware

The hardware used for the implementation is shown in figure 4.1. The analog front end perform amplification and bandpass filtering when receiving and transmitting. A chip with an ADC and microprocessor (atmel SAM4S [15]) samples the analog signal, perform signalband processing and packaging. The SAM4S microprocessor has a 12-bit cyclic pipelined ADC with several input channels, so that the inputs are sampled in a burst (not at the same time). Sampling and data management has hardware support in the SAM4S so a block of samples can be filled into a buffer without microprocessor (software) intervention, the microprocessor then computates the samples blockwise. A large buffer will reduce microprocessor overhead but will require more data memory. The processor in the SAM4S is an ARM Cortex-M4 processor, the Cortex Microcon-troller Software Interface Standard (CMSIS) is a software library for ARM Cortex pro-cessors that support e.g. DSP functions with fixed point data types. The DSP functions in CMSIS include filtering, multiplications, additions etc. on blocks of data. The pro-gramming language used for the SAM4S is C.

(53)

The SAM4S perform the signalband processing discussed in section 3.3, i.e. mixing, filtering, decimation and packaging (timing synchronization). After a package has been detected and received the signal goes via a USB link to a processor for baseband com-putations, the USB link is used so that an ordinary PC can be connected during devel-opment.

The baseband computations are implemented in C++, i.e. the computations described in section 3.4. The adaptive filter algorithm is implemented with the software library EIGEN [16], EIGEN is used for matrices and vector (linear algebra) operations. EIGEN can also be compiled with Single Instruction Multiple Data (SIMD) instructions for the ARM NEON engine, SIMD can boost performance when doing computations on vectors of data.

The open software for LDPC from Radford M. Neal [17] (free to copy and modify) is used. The code generated (32,64) is an irregular code with 20 % of the check nodes with two check bits, 70 % with three check bits and 10 % with seven check bits. The LDPC code is also without cycles (< four node cycle). The maximal number of iterations are ten in the LDPC decoder. If a valid code is not found before the maximal number of iterations, then is the data discarded.

4.2

Data Types

The incoming signal has to be represented at a certain time instances (sampling fre-quency) as digital values. Digital values can not represent the signal exactly and an error is introduced when converting the value from an analog signal to a digital.

4.2.1 Fixed Point

A fixed point number Qm.n is represented as an integer with one sign bit, m integer bits and n fractional bits. The total number of bits is n + m + 1. The smallest difference between two fixed point numbers (resolution) is Q = 2−n. The range (largest and smallest possible number possible to represent) is [−2−m, 2m − 2−n]. A fixed point number ˆa is stored as an ordinary integer a, but there is a scaling factor 2−n (based on the data type) associated with the integer and ˆa = 2an . When a multiplication is

(54)

Chapter 4. Implementation 44

performed ˆa × ˆb, an integer multiplication is first performed and then scaled (ˆa × ˆb)2n= (a×b22n)2n= a×b2n

4.2.2 Floating Point

A floating point number (SX, EX, FX) has a sign bit SX, exponent part EX and a

significand FX. Combined they give `X = (−1)SXbExFx. Floating point have a higher

dynamic range than fixed point, i.e. the difference between the smallest and the biggest number it can represent is larger. The on average resolution for floating point is lower than fixed point for the same number of bits, but the relative resolution is almost constant. The resolution depends on the exponent.

Scaling is not important because the relative resolution is constant when using floating point data types. Fixed point numbers have to be scaled at the input to increase SNR (utilize numerical range), the signal to round-off noise ratio can be low (low SNR) with fixed point without scaling. Scaling for fixed point has to be done before multiplications (filters) but is not needed for additions and subtractions. Scaling can cause overflow, safe scaling is used to avoid this. Safe scaling is making sure that an overflow can not occur. However, this is usually unnecessary and instead a more practical approach is to decrease scaling if an overflow occurs.

Without hardware support for floating point, the floating point operations have to be done with fixed point arithmetic (software). The computational cost for performing floating point operations on a processor without floating point is high.

4.2.3 Usage

The signalband computations done on the SAM4S (section4.1) are done with Q0.15 (or Q15) format, i.e. fixed point with one sign bit and 15 fractional bits. The data type Q15 is chosen for the signalband computations because it can be computed more efficient, e.g. if floating point would have been used, a filter with less filter taps would have had to been used isntead (because of the computational cost).

The Single precision floating point data format is used for the baseband computations. Implementing with floating point can be easier than with fixed point (scaling does not

(55)

have to be considered) and the processor used for baseband computations has more com-putational power. The processor used did not have hardware support for floating point which is very inefficient, therefore should the baseband computations be implemented in fixed point or the processor should be changed.

4.3

Computational Cost

Most of the operations are performed on the processors in this system, and all software operations have a computational cost i.e. the number of additions, multiplications etc. associated with it. When trying to improve/design a digital processing system, the computational cost should be considered. The operations that are computational heavy are considered in this section.

4.3.1 Signalband

Mixing i.e. multiplying the input signal with a carrier frequency and lowpass filtering it, the number multiplications are direct proportional to the sampling frequency fs. The

lowpass filtering computational cost is proportional to the output rate i.e. input rate fs

divided by the decimation factor M , and proportional to the filter length N . Mixing is done for all input channels CH, the computation cost function for mixing CCmixing is

then CCmixing = CH(2fsM U L + fsN M (MUL + ADD )) =  CH fs  2 + N M  MUL +  CHfsN M  ADD (4.1)

where M U L is the cost for a multiplication and ADD is the cost for an addition. The timing synchronization i.e. computations discussed in section3.3.1, it performs ac-cumulation of NM W inputs (I and Q part) and then adding the absolute values together.

Timing synchronization is done after mixing and therefore at a rate fs/M . The goal of

timing synchronization is to find the probe, the length of the accumulation NM W has

to have the same length as the probe (decimated). If the length of the probe is nprobein

References

Related documents

– Physical memory controller interface – Handling of PCI-bus communication – Onboard memory capacity are limited. • Need for

Also, since a bundle is a manifold, Conlon emphasizes that it’s fair to view a bundle over an n-dimensional manifold as a “special case” of an n + m- dimensional manifold where

In this chapter, a parameter estimation algorithm called EASI- SM is compared to the non-negative least squares (NNLS) spectrum approach commonly used in the context of MRI.

Again, the neck pain risk we found from rotation in a group of forklift operators (OR 3.9, Table 2 ) seems reason- able given that forklift operators are more exposed to un-

O’Boyle (2016) går däremot emot DeNisi och Pritchards (2006) åsikt och hävdade i sin meta-studie att mindre kontrollerande parametrar som binds till organisationens

For frequency domain data it becomes very simple: It just corresponds to assigning dierent weights to dierent fre- quencies, which in turn is the same as using a fre- quency

The decision was made to test two of the main components in TrueVoice: the NLMS filtering used in the acoustic echo cancellation and the FFT that splits the fullband signal

One of the most interesting results of the experiment is analysis C), because it shows that signal processing affects the perceived complexity of low complexity stimulus more than