UWBR Matlab Implementation

download UWBR Matlab Implementation

of 17

Transcript of UWBR Matlab Implementation

  • 7/27/2019 UWBR Matlab Implementation

    1/17

    A MB-OFDM system implemented in Matlab

    Version number Date

    1.0 2008

    1.1 2008 Revision

    Author: Sandro Noto

    Revised by: Helena Sarmento

    Technical Report

    Project: UWB Receiver: baseband processing using reconfigurable hardware (UWBR)

    PTDC/EEA-ELC/67993/2006

  • 7/27/2019 UWBR Matlab Implementation

    2/17

    Funded by:

    2

  • 7/27/2019 UWBR Matlab Implementation

    3/17

    Funded by:

    3

    Table of ContentsA MB-OFDM system implemented in Matlab .......................................................................1Table of Contents....................................................................................................................3

    Abstract ...................................................................................................................................5

    MB-OFDM UWB technology ............................................................................................7OFDM scheme....................................................................................................................8

    Multi-band OFDM..............................................................................................................9

    MB-OFDM baseband processing .....................................................................................10

    Convolutional encoder and Puncturer...............................................................................11

    Interleaver .........................................................................................................................12

    Constellation Mapping......................................................................................................13

    IFFT ..................................................................................................................................13

    Channel .............................................................................................................................13

    FFT....................................................................................................................................13Pilots and guard su-carriers remover ................................................................................13

    Quantifier and concatenator..............................................................................................14

    Deinterleaver.....................................................................................................................15

    Depuncturer and Viterbi ...................................................................................................15

    Descrambler ......................................................................................................................16

    Simulation results..................................................................................................................16

    Conclusions...........................................................................................................................17References.............................................................................................................................17

  • 7/27/2019 UWBR Matlab Implementation

    4/17

    Funded by:

    4

  • 7/27/2019 UWBR Matlab Implementation

    5/17

    Funded by:

    5

    AbstractThis report describes a Matlab which simulates the transmission and the reception of a base

    band signal for a Multi Band-Orthogonal Frequency Division Multiplexing (MB-OFDM)

    system, operating over a Gaussian channel. We followed the ECMA 368 [1] standard. Aftera brief introduction about the MB-OFDM (Multi Band-OFDM) main features, we describe

    the system blocks, and, for each block we identify the Matlab function(s) used.

    We present results obtained for the bit error rate (BER) and compare them with other [1].

    To finalize, we identify future work.

  • 7/27/2019 UWBR Matlab Implementation

    6/17

    Funded by:

    6

  • 7/27/2019 UWBR Matlab Implementation

    7/17

    Funded by:

    7

    MB-OFDM UWB technology

    MB-OFDM [1] is a multi-band technology, using orthogonal frequency divisionmultiplexing. The total bandwidth that could be occupied, as defined by FCC, is from 3.1

    GHz to 10.6 GHz. This covers a total span of 7.5 GHz. MB-OFDM divides the available

    spectrum into 14 bands of 528 MHz. The first 12 bands are grouped into 4 band groupsconsisting of 3 bands, and the last two bands are grouped into a fifth band group (seeFigure 1).

    10296

    MHz

    3432

    MHz

    3960

    MHz

    5544

    MHz

    5016

    MHz

    4488

    MHz

    6072

    MHz

    6600

    MHz

    8184

    MHz

    7128

    MHz

    7656

    MHz

    8712

    MHz

    9240

    MHz

    9768

    MHz

    bandgroup1 bandgroup2 bandgroup3 bandgroup4 bandgroup5

    bandbandband bandband band band bandband bandband band band band

    1234567891011121314

    Figure 1 - UWB Standard spectrum allocation

    Multiple access is based on two types of Time-Frequency codes (TFCs). With a Time-

    Frequency Interleaving (TFI) code, information is interleaved over three bands. Fixed

    Frequency Interleaving (FFI) transmits coded data on a single band. Within each of the first

    four band groups, four time-frequency codes using TFI and three time-frequency codesusing FFI are defined; thereby, providing support for up to seven channels per band. For the

    fifth band group, two time-frequency codes using FFI are defined. Therefore, 30 channels

    are available in total to define a piconet.

    An OFDM symbol, transmitted in a band (528 MHz), includes 100 data sub-carriers, 10

    guard sub-carriers, and 12 pilot sub-carriers for coherent and to provide robustness againstfrequency offsets and phase noise. Data sent over each data sub-carrier are modulated,

    using QPSK or dual carrier modulation (DCM). Using QPSK, a symbol of 2 bits is mappedon a sub-carrier. The DCM symbol has 4 bits. The same 4 bits of information are mapped

    onto two different sub-carriers, separated by 50 sub-carriers (approximately 206 MHz).

    With this separation, the probability that both points simultaneously suffer from fadingdecreases and diversity loss is reduced.

    Data rate (Mbps) Modulation Code rate TDS FDS

    53.3 QPSK 1/3 Yes Yes

    80 QPSK 1/2 Yes Yes

    106.7 QPSK 1/3 No Yes

    110 QPSK 11/32 No Yes

    160 QPSK 1/2 No Yes200 QPSK 5/8 No Yes

    320 DCM 1/2 No No

    400 DCM 5/8 No No

    480 DCM 3/4 No No

    Table 1 MB-OFDM data rates

  • 7/27/2019 UWBR Matlab Implementation

    8/17

    Funded by:

    8

    Frequency-domain spreading, time-domain spreading, and forward error correction (FEC)

    coding are specified for different data rates. FEC used is a convolutional code with codingrate of 1/3. Puncturing, TDSS and FDS permit to establish the other code rates: 1/2, 5/8 and

    3/4 and 11/32. Therefore, the MB-OFDM data communication supports data rates of 53.3

    Mb/s, 80 Mb/s, 106.7 Mb/s, 160 Mb/s, 200 Mb/s, 320 Mb/s, 400 Mb/s, and 480 Mb/s

    (Table 1).Data rates depend on modulation, code rate, and the existence or absence of TDS and FDS

    spreading. For example, if QPSK modulation, code rate of 1/2, TDS and FDS are used (line

    two of (Table 1), 80 Mbps are achieved. Symbols with 100 data sub-carriers with QPSKmodulation transmit 200 bits. However, if TDS and FDS are used the same data are sent

    twice on the same symbol and twice on the next symbol. Therefore, only effective 50 bits

    (200/4) are sent. For a code rate of 1/2, information bits are only 25. As the duration ofOFDM symbol is 312.5 ns, the available data rate is 25/312.5, or 80 Mbps.Forward error

    correction employs: code rates of 1/3, 1/2, 5/8, 3/4 and 11/32; frequency-domain spreading

    (FDS); and time-domain spreading (TDS). FDS and TDS involve the transmission of thesame information on two separate sub-carriers. These two sub-carriers belong to the same

    OFDM symbol in FDS, or to two consecutive OFDM symbols in TDS.According to the ECMA specification, first devices on market shall work only on the first

    band group. These devices shall transmit and receive data at 53.3, 110 e 200 Mbps. As afirst step, we chose to implement the configuration of the first row of Table 1 .

    OFDM scheme

    # # # # # # #

    -61 Cg[0] -55 Cp[0] -45 Cp[1] -35 Cp[2] -25 Cp[3] -15 Cp[4] -5 Cp[5]

    -60 Cg[1] -54 Cd[1] -44 Cd[10] -34 Cd[19] -24 Cd[28] -14 Cd[37] -4 Cd[46]

    -59 Cg[2] -53 Cd[2] -43 11 -33 20 -23 29 -13 38 -3 47

    -58 Cg[3] -52 Cd[3] -42 12 -32 21 -22 30 -12 39 -2 48

    -57 Cg[4] -51 Cd[4] -41 13 -31 22 -21 31 -11 40 -1 Cd[49]-56 Cd[0] -50 Cd[5] -40 14 -30 23 -20 32 -10 41

    -49 Cd[6] -39 15 -29 24 -19 33 -9 42

    -48 Cd[7] -38 16 -28 25 -18 34 -8 43

    -47 Cd[8] -37 17 -27 26 -17 35 -7 44

    -46 Cd[9] -36 Cd[18] -26 Cd[27] -16 Cd[36] -6 Cd[45]

    # # # # # # #

    55 Cp[11] 45 Cp[10] 35 Cp[9] 25 Cp[8] 15 Cp[7] 5 Cp[6] 0 DC

    56 Cd[99] 46 Cd[90] 36 Cd[81] 26 Cd[72] 16 Cd[63] 6 Cd[54] 1 Cd[50]

    57 Cg[5] 47 91 37 82 27 73 17 64 7 55 2 51

    58 Cg[6] 48 92 38 83 28 74 18 65 8 56 3 52

    59 Cg[7] 49 93 39 84 29 75 19 66 9 57 4 Cd[53]60 Cg[8] 50 94 40 85 30 76 20 67 10 58

    61 Cg[9] 51 95 41 86 31 77 21 68 11 59

    52 96 42 87 32 78 22 69 12 60

    53 97 43 88 33 79 23 70 13 61

    54 Cd[98] 44 Cd[89] 34 Cd[80] 24 Cd[71] 14 Cd[62]

    Figure 2 Logical frequency sub-carriers

  • 7/27/2019 UWBR Matlab Implementation

    9/17

    Funded by:

    9

    An OFDM scheme is used to transmit information. A total of 100 data carriers CD, 10

    guard carriers CG and 12 pilot sub-carriers CP per band is used. The 10 guard subcarriersare located on either edge of the OFDM symbol at logical frequency subcarriers -61, -60,

    , -57 and 57, 58, , 61. The pilot signals shall be placed in logical frequency subcarriers

    -55, -45,-35, -25, -15, -5, 5, 15, 25, 35, 45 and 55. The logical frequency subcarriers [NT

    2, NT 2] (-61 to 61) are mapped according to Figure 2.The data on these carriers shall be created by copying over the five outermost data-bearing

    subcarriers from the nearest edge of the OFDM symbol as defined by equation

    [ ]

    [ ]

    [ ]

    ,

    ,

    ,

    0, 12

    90 , 12

    GD n

    G n

    GD n G

    NC l l

    C lN

    C l l N

    =

    +

    (1)

    A common way to implement an inverse discrete Fourier transform is by using an inverseFast Fourier Transform (IFFT) algorithm. In the FFT [1], the logical frequency subcarriers

    1 to 61 are mapped to the same numbered IFFT inputs, while the logical frequencysubcarriers 61 to 1 are mapped into IFFT inputs 67 to 127, respectively. The remaininginputs, 62 to 66 and the 0 (DC) input, are set to zero. The subcarrier falling at DC (0th

    subcarrier) is not used to avoid difficulties in DAC and ADC offsets and carrier feed

    through in the RF chain.

    Multi-band OFDMThe multi-band process is actually done after the OFDM process above is complete. OFDM

    symbols are interleaved in time across multiple frequencies, based on TFCs. Figure 3

    shows an example how this process works in reference to time and frequencies for the first

    band group. As time progresses the OFDM symbols are transmitted on different bands:

    symbol 1 is transmitted on band 1, symbol 2 on band 3 and symbol 3 on band 1.

    Figure 3 Multi Band OFDM interleaving

  • 7/27/2019 UWBR Matlab Implementation

    10/17

    Funded by:

    10

    MB-OFDM baseband processingFigure 4 and Figure 5 present the block diagram of the baseband processing of a

    transmitter and a receiver in a MB-OFDM system.

    Figure 4 MB-OFDM transmitter diagram

    Figure 5 MB-OFDM receiver diagram

    s(n) r(n)

    w(n)

    Figure 6 Communication channel

    2.1. Scrambler

    The Hamming distance between two strings of bits, generated by the convolutional

    encoder, is greater if the input sequences are uncorrelated. Therefore, a scrambler is used to

    uniformly redistribute the zeros and ones bits over the data input. The scrambler scheme,recommended by the ECMA standard [1] is presented on Figure 7.

    Figure 7 Scrambler block diagram

    The scrambled bit is given by equation (2) where [ ]s n is the unscrambled bit, the operator

    denotes the modulo-2 addition, and [ ]x n is generated by equation (3).

    [ ] [ ] [ ] 0,1,2,v n s n x n n= = K (2)

  • 7/27/2019 UWBR Matlab Implementation

    11/17

    Funded by:

    11

    [ ] [ ] [ ]14 15 0,1, 2,x n x n x n n= = K (3)

    Equation (4) defines the initialization vectorinitx , which is specified by the MB-OFDM

    frame field Seed Identifier (Table 2.1.1):

    [ ] [ ] [ ] [ ]1 2 14 15init i i i ix x x x x = K (4)

    The term [ ]ix k represents the binary initial value at the output of theth

    k delay element.

    Seed Identifierinitx

    00 0011 1111 1111 111

    01 0111 1111 1111 111

    10 1011 1111 1111 111

    11 1111 1111 1111 111

    Table 2 Seed Identifier

    In uwb_ofdm_system.m the scrambler is implemented by the scramble.m function.

    Convolutional encoder and Puncturer

    The convolutional encoder defined by the ECMA [1] has a constraint length 7L = , code

    rate 1/ 3R = and generator polynomials 0 8 1 8 2 8133 , 165 , 171g g g= = = . Additional code

    rates are derived from the mother code rate 1/ 3R = by employing puncturing. Puncturingis a procedure for omitting some of the encoded bits at the transmitter and inserting

    dummy zeros into the decoder at the receiver, in place of the omitted bits. In the

    presented implementation, we only used the puncturing and depuncturing operationsdescribed on Figure 8. At the transmitter, rate is changed from R =1/3 to R = 1/2,

    suppressing bit B0 at the receiver from R = 1/2 to R = 1/3, inserting bit B0 = 0.

    Figure 8 Puncturing and depuncturing operations forR=1/2 code

  • 7/27/2019 UWBR Matlab Implementation

    12/17

    Funded by:

    12

    In uwb_ofdm_system.m the convolutional encoder and puncturer operations are both

    implemented by the convenc.m Matlab function, which processes the following

    parameters:

    BitD_scr: the uncoded bit string

    t: calculated by the poly2trellis.m function, taking into account theconvolutional encoder trellis structure, determined by the constraint length L and

    the generator polynomialsn

    g .

    [1 0 1]: the puncturing pattern, which indicates that for each group of three bits

    the 1st

    and the 3rd

    (corresponding to 1 positions) have to be sent, while the 2nd

    (corresponding to 0 position) has to be stolen.

    Interleaver

    Figure 9 Block diagram of the bit interleaver

    The coded bit stream is interleaved (Figure 9), before sub-carriers modulation, in order to

    provide robustness against burst errors. The interleaving operations are performed in threedistinct stages, depending on parameters presented on Table 3.

    Data Rate (Mb/s) TDS Factor

    (TDS

    N )

    Coded Bits /

    OFDM Symbol

    (CBPS

    N )

    Tone Interleaver

    Block Size

    ( intTN )

    Cyclic Interleaver

    Shift

    (Cyc

    N )

    53.3 2 100 10 3380 2 100 10 33

    106.7 2 200 20 66

    160 2 200 20 66

    200 2 200 20 66

    320 1 200 20 33

    400 1 200 20 33

    480 1 200 20 33

    Table 3 Parameters for the interleaver

    Symbol interleaving permutes the bits across 6 consecutive OFDM symbols. The symbolinterleaving operation is performed by grouping the coded bits into blocks of bits

    corresponding to six OFDM symbols and then using a block interleaver whose size depends

    on the number of coded bits per OFDM symbol and the value of the time domain spreading

    factor to permute the coded bits. Intra-symbol tone interleaving permutes the bits across thedata subcarriers within an OFDM symbol. Intra-symbol cyclic shifts the bits in successive

    OFDM symbols by deterministic amounts.

  • 7/27/2019 UWBR Matlab Implementation

    13/17

    Funded by:

    13

    The uwb_ofdm_system.m script simulates situation of first row of on Table 3. The three

    interleaver stages are implemented by the symbol_intrlv.m, tone_intrlv.m and

    cyclic_shifter.m scripts that use the intrlv.m Matlab function. This function

    permutes the positions of the elements of an input vector in accordance with a permutationmatrix.

    Constellation Mapping

    Sub-carriers modulation is performed after the interleaving process. We only implemented

    QPSK modulation. The QPSK mapping operation is performed by first grouping the

    interleaved bits into pairs and then associating to each pair a complex symbol (Figure 10).Besides data, pilots and guards sub-carriers are also mapped, according to Figure 2.

    01 11

    00 10

    1 / 2

    1 / 2-1 / 2

    -1 / 2

    Q

    I

    Figure 10 QPSK constellation

    IFFT

    The OFDM symbols are generated by an IFFT operation with 128 points. In theuwb_ofdm_system.m script, the IFFT operation is implemented by the ifft.m Matlab

    function.

    Channel

    The channel simulated by uwb_ofdm_system.m is an additive white gaussiaon noise

    (AWGN) channel. In the uwb_ofdm_system.m script, the channel is implemented by the

    Matlab function awgn.m. For a chosen SNR this function calculates the power of w(t).

    FFT

    A FFT process operates at the receiver to obtain the noisy symbols. In theuwb_ofdm_system.m script, the FFT process is implemented by the Matlab function

    fft.m.

    Pilots and guard su-carriers remover

    At the output of the FFT block, pilots and guards sub-carriers are removed to isolates the

    data noisy symbols. In the uwb_ofdm_system.m, pilots and guard removal is

  • 7/27/2019 UWBR Matlab Implementation

    14/17

    Funded by:

    14

    implemented by the Matlab code presented on Figure 11, according to Figure 2. The R2vector represents modulated information on 100 data carriers. R1 vector includes data,

    pilot, guard and null values modultinf all the 128 sub-carriers.

    R2=zeros(1,100);

    R2(1)=R1(9);R2(2:10)=R1(11:19);

    R2(11:19)=R1(21:29);

    R2(20:28)=R1(31:39);

    R2(29:37)=R1(41:49);

    R2(38:46)=R1(51:59);

    R2(47:50)=R1(61:64);

    R2(51:54)=R1(65:68);

    R2(55:63)=R1(70:78);

    R2(64:72)=R1(80:88);

    R2(73:81)=R1(90:98);

    R2(82:90)=R1(100:108);

    R2(100)=R1(120);

    Figure 11 Pilots and guard sub-carriers removal

    Quantifier and concatenator

    We adopt soft decision with 4 bits for the Viterbi decoder. Therefore, to implementquantization for soft decision we have 64 levels /Figure 12). For simplicity, Figure 13

    presents the quantifier with 3 bits/8 levels.

    3 72 71 70 7

    3 62 61 60 6

    3 52 51 50 5

    3 42 41 40 4

    7 76 75 74 7

    6 76 65 64 6

    7 56 55 54 5

    7 46 45 44 4

    3 32 31 30 3

    3 22 21 20 2

    3 12 11 10 1

    3 02 01 00 0

    7 36 35 34 3

    7 26 25 24 2

    7 16 15 14 1

    7 06 05 04 0

    Imaginary

    Real

    00

    01 11

    10

    Figure 12 QPSK decision zones

  • 7/27/2019 UWBR Matlab Implementation

    15/17

    Funded by:

    15

    0

    1

    2

    3

    4

    5

    6

    7

    Symbol real or

    imaginary part

    Probability

    level

    Figure 13 Quantifier (n=3)

    Real and imaginary values received on sub-carriers, after pilot and guard removal,

    represented by R2 are independently quantified in levels. At the output of the quantifier, theconcatenator block reorders real and imaginary quantified values, putting the real and

    imaginary quantified values of the same complex in succession. In uwb_ofdm_system.m

    script, the quantifier is implemented by the quantification_integer.m script forn =

    4, and the concatenator by some lines of Matlab code.

    Deinterleaver

    The deinterleaver implements the reverse operations of the interleaver by rearranging the

    quantified values at the output of the concatenator. In uwb_ofdm_system.m, the threedeinterleaver stages are implemented by the inv_ciclyc_shifter.m, tone_deintrlv.m and

    symbol_deintrlv.m scripts. These scripts use the deintrlv.m Matlab function. By processing

    the same permutation matrix used in intrlv.m, the deintrlv.m permutes the elements of the

    input vector in the opposite way.

    Depuncturer and Viterbi

    The depuncturing is a procedure for inserting dummy bits in place of the punctured

    (suppressed) bits. Then, the Viterbi decoder estimates the original data sequence by

    determining the most likely through its trellis diagram. In the uwb_ofdm_system.m script,

    puncturing and Viterbi decoding with soft decision operations are implemented by the

    vitdec.m Matlab function. The input parameters ofvitdec.m are are:

    Vector_rx_deintrlv: the coded sequence.

    t: calculated by the poly2trellis.m function, taking into account theconvolutional encoder trellis structure, determined by the constraint length L and

    the generator polynomials.

    tblen: a positive integer that specifies the traceback depth. We considered 5 timesthe constraint lengthL.

    trunc: to assumed the start at the all-zeros state.

  • 7/27/2019 UWBR Matlab Implementation

    16/17

    Funded by:

    16

    soft: to assume soft decision.

    [1 0 1]: the puncturer pattern

    Descrambler

    The descrambler scheme is equal to the scrambler scheme. In fact, if ( )scramblea b= then

    ( )scrambleb a= . In uwb_ofdm_system.m script, the descrambler operation is

    implemented by the scrambler.m script.

    Simulation resultsWe simulated the complete script to verify the implementation, comparing sent bits with

    received bits. The two compared systems were simulated under the same conditions. We

    also compare the bit error rate with the AWGN channel with previous results presented in

    [2]. The bit error rate is calculated using equation (5), whereHd is the Hamming distance,

    which counts the number of different bits in the two pattern. The denominator is the

    number of transmitted data bits, considering 600 bits transmitted in each of the Nv cycles600 distinct bits are transmitted). In our experiment we fixed Nv =10

    6 .

    (transmitted data bit sequence, received data bit sequence)

    600

    H

    V

    dBER

    N=

    (5)

    The curves on Figure 14 show the bit error rate as a function of the energy per bit to the

    noise ratio (0

    /b

    E N ). The red present results from the simulation of the the

    uwb_ofdm_system.m script and the blue line results from 17

    0.0001

    0.001

    0.01

    0.1

    1

    0 2 4 6 8 10

    BER

    Eb/No

  • 7/27/2019 UWBR Matlab Implementation

    17/17

    Funded by:

    17

    Figure 14 BER as a function of0

    /b

    E N

    Conclusions

    We implement in Matlab the complete MB-OFMD system. The simulation confirmed thecorrectness of this description. We have now the complete framework to implement the

    receiver, using FPGAs. Simulink and Xilinx System Generator from Xilinx will be used toimplement the receiver in FPGA. The System Generator automatically generates the

    Hardware Description Language (HDL) code by processing the Simulink and the Xilinx

    blocksets which constitute the system. This HDL design can then be synthesized forimplementation in Virtex-5 FPGA ML506.

    References[1] Standard ECMA-368, High Rate Ultra Wideband PHY and MAC Standard,

    December 2007

    [2] Harry Viittala, Matti Hmlinen, Jari Iinatti: Comparative studies of MB-OFDM andDS-UWB with co-existing systems in AWGN channel, IEEE International Symposiumon Personal, Indoor and Mobile Radio Communications (PIMRC06).

    [3] Xilinx, System Generator for DSP User Guide, Release 10.1.1 April, 2008