Showing posts with label Modulation. Show all posts
Showing posts with label Modulation. Show all posts

Sunday, February 10, 2013

OFDM in WLAN: 802.11a and 802.11g: Detailed Analysis with Data Rate derivation

Previously we have learned about the fundamental concepts of OFDM, generic and independent of technology. Now lets take a more specific look at use of OFDM in 802.11.


Before, OFDM Wi-Fi was suffering from low data rates it was more like a PAN rather than a LAN. OFDM was first introduced in to Wi-Fi in the year 2003 with standardization of 802.11a (5GHz) and then with 802.11g (2.4GHz). Only then people started seeing Wi-Fi as something useful rather than a pure experimentation technology.

802.11b offers us atmost rate of 11Mbps through the use of CCK/HR-DSSS. But 802.11a/g offer 54 Mbps of data rate which is a drastic 5 fold increase compared to 802.11b.

Where as 11n gives us 600 Mbps of data rate a tremendous 11 fold increase. of course they are lots of factors involved there but whats the role of OFDM in this? Lets dive in to know.

802.11a/g: 

The IEEE 802.11 standard reserves 64 sub-carriers for use with OFDM but not all are used practically. Only 52 of them are used, remaining 12 are reserved.Enough theory lets get to some mathematics and see how OFDM achieves those fancy data rates.

802.11-2012: 20.6 has a good tables w.r.t data rates of 11n
Now before we start with the data rate calculations we need to understand a few terminologies, concepts and transmission process. 

  1. What parameters govern the Data rate?
  2. Modulation Scheme & Coding Rate (MCS)
  3. Bandwidth
  4. OFDM:  No of data sub-carriers
  5. Guard Interval


Modulation : With (A) and (B) from above, lets choose a modulation now modulation decides how many bits can carried for Eg. In case of QPSK we have 4 phases to choose from so using QPSK, so with the help of 2 bits we can choose one of the 4 possible phases meaning we can transport 2 bits. Similarly for 64 QAM (which is the highest modulation supported up to 802.11-2012 standard, 802.11-asc has 256 QAM support) we can transport 6 data bits (2^6=64).

Coding Rate: Any form of wireless communications suffers bits dostortion/corruption, so its important to know that our data Rx is intact and if its wrong we need to have capability identify the defect. For this we insert some extra bits in to the actual data so that we can do some error detection/correction, these are called parity bits and we have different coding schemes to employ Eg. convolutional encoding.



Shannon’s Noisy Channel Coding Theorem

“With every channel we can associate a “channel capacity” C (bits/sec). There exist such error control codes that information can be transmitted at a rate below C (bits/sec) with an arbitrarily low bit error rate.”


Coding rate determines the ratio of data to the extra parity bits. Higher the coding rate better the throughput because we are actually transporting more data bits.


OFDM Encoding Process: Group of all sub-carriers transmitted at once,so in .11a/g we have 52 sub carriers constituting a OFDM symbol.

We directly go to the source the standard 802.11-2012: 18.3.2.2 Overview of the PPDU encoding process, it says

i) Divide the resulting coded and interleaved data string into groups of NBPSC bits. For each of the bit groups, convert the bit group into a complex number according to the modulation encoding tables.Refer to 18.3.5.8 for details. 
This is the first step in the OFDM process after the scrambler and interleave  basically it is grouping the incoming data.

j) Divide the complex number string into groups of 48 complex numbers. Each such group is associated with one OFDM symbol. In each group, the complex numbers are numbered 0 to 47 and mapped hereafter into OFDM subcarriers numbered –26 to –22, –20 to –8, –6 to –1, 1 to 6, 8 to 20,and 22 to 26. The subcarriers –21, –7, 7, and 21 are skipped and, subsequently, used for insertingpilot subcarriers. The 0 subcarrier, associated with center frequency, is omitted and filled with the value 0. Refer to 18.3.5.10 for details.
 This is a crucial step, where in we map 48 bits of data to each sub carrier, all the mathematical representation is in form of complex numbers leaving space for pilot sub carriers. Here we don't use the subcarrier 0 which is the DC subcarrier because to avoid complexity in RF while performing D/A or A/D.

k) Four subcarriers are inserted as pilots into positions –21, –7, 7, and 21. The total number of thesubcarriers is 52 (48 + 4). Refer to 18.3.5.9 for details.
Insert the pilot sub carriers at predefined positions.  
l) For each group of subcarriers –26 to 26, convert the subcarriers to time domain using inverse Fourier transform. Prepend to the Fourier-transformed waveform a circular extension of itself thus forming a GI, and truncate the resulting periodic waveform to a single OFDM symbol length by applying time domain windowing. Refer to 18.3.5.10 for details.
Here comes the IFFT, faster way of doing DFT which converts from frequency domain to time domain. The CP (Cyclic Prefix) is also done after IFFT.

Data Rate Calculation:       Data rate is the "No of bits transported per sec" now with the above concepts we can see that,  

 Data Rate (bps)= No of bits in Modulation/OFDM carrier * No of data sub carriers *Coding Rate * Time Spread/sec 

As discussed above 802.11a/g standard specifies 64 sub carriers out of which 52 are used in a/g.

  1. Total Theoretical sub carriers: 64
  2. Total Sub carriers used: 52
  3. Total data sub carriers used: 48  ====> A
  4. Pilot sub carriers: 4 
Now with this, we know that the standard bandwidth in WLAN is 20MHz, (802.11-2012 introduces half and quarter rates also, but lets leave that as home work :-) anyways they are just inverse exponential to 20MHz).       

We also need to know about a few FFT related paramters. Refer Table 18-5 in 802.11-2012.

With 20 MHz bandwidth and 64 subcarriers: The sub carrier frequency spacing comes to
                 (SCFS) : 20MHz/64=0.3125 MHz.

So the IFFT/FFT has to run at a period of 1/SCFS to convert it to time/frequency domain:
                  IFFT/FFT period =1/0.3125 MHz=3.2 us.

So the total symbol duration is 3.2us and the thumb rule in .11a/g is that we leave a guard interval of 1/4 symbol time i.e., 0.8 us. 

                    So the total symbol time = 3.2us + 0.8 us = 4us. ====> B

 The above formula for data rate becomes,

Data Rate (bps)= No of bits in Modulation/OFDM carrier *A*Coding Rate * B

So for a BPSK we can transport 1 bit per sub carrier which makes 48 bits per OFDM symbol which spreads 4us in time domain. Now with coding rate of 1/2 it comes to, 

Data Rate =1*48*1/2*4=6 Mbps

Similarly for 64QAM with data rate 3/4 (The highest coding rate in 802.11), 
Data Rate=6*48*3/4*4=54 Mbps

Frequently Asked Questions:

1) Is OFDM performed first and then modulation or vice-versa?

First we divide and map the incoming bits to the "constellation mapper" in to N streams (N=no of sub-carriers) and  based on the encoding tables/modulation scheme converts to the complex number. Which is given as input to the IFFT for conversion to time domain, it also acts as a parallel to serial converter N-Frequency domain modulated streams to a single time domain stream for transmission.

2) Is there any rule between a modulation scheme and coding rate?Why cant i use 5/6 coding rate with BPSK?

Yes. Generally the more the no of bits carried by the modulation the more it is error prone but carrying more bits gives us high data rate. Its always a tradeoff between BER and Data Rate. In that aspect BPSK has the highest BER but lowest data rate. 

Here's the results from agilent on EVM and Constellation Errros (Measures the Tx Modulation Quality) , as you can see BPSK in the best in the table.

Allowed EVM and Relative Constellation Error
Data Rate (Mbps)Relative Constellation Error (dB)EVM (% RMS)
6-556.2
9-839.8
12-1031.6
18-1322.3
24-1615.8
36-1911.2
48-227.9
54-255.6
But, The error rate in BPSK is high as there is only one 
bit for representing data so slight error causes high BER. So it depends on the channel and type of fading whether BPSK can cause high BER or Low BER.

Hence the 802.11 standard has fixed these mappings for modulation and coding rates.


References:


Saturday, February 9, 2013

What is OFDM?: Simplified..

Lets take a look at the technology that literally commanding all and any form of wireless communications OFDM without requiring any prior electronics knowledge.

Orthogonal Frequency Division Multiplexing is the most sought modulation technique in today's cutting edge wireless either it be 802.11 (WLAN), 802.16(WiMax), 3GPP 36 series (LTE)..

Single Carrier Modulation:

In the traditional communications we make use of a single Tx antenna and a single Rx Antenna. All the incoming data is modulated using a single carrier and sent OTA, at the Rx side its is  demodulated and data after removing the carrier is given out.

Multi-Carrier Modulation:

FDM: 

But in order to gain high throughput a new scheme is introduced. Where in we divide the channel in to different sub channels and assign a carrier to each sub-channel for modulation known as sub-carrier and finally multiplex all the carriers+data and send using the single Tx Antenna.
But in order to avoid interference (inter-symbol interference) we use a guard spacing between the sub channels causing in bandwidth wastage.

OFDM: 

In order to save the wastage and use it effectively we choose the sub-channels and sub-carriers such that they are orthogonal to each other meaning they don't interfere with each other. So we can skip the guard spacing between the sub-channels and save bandwidth.



FDM Vs. OFDM


Truly speaking it should be termed as FDMO, as you will see why just in a moment. lets understand each word in detail in the acronym.

Frequency Division (FD):

Instead of modulating all data with one carrier, divide the bandwidth in to equally separated sub-channels and assign a carrier to each sub-channel called sub-carrier.

Multiplexing (M):

As we have multiple sub-carriers but a single Tx antenna we need to map all the sub-carriers rather we need to multiplex all of them and send OTA. We make use Parallel to Serial converter for this.

Orthogonality(O):

We all know from the high school maths that orthogonality means "product of slopes = -1" meaning one signal will not overlap with the other.

In a similar context in the time domain a sub channel is represents as a rectangle which in a frequency domain converts to a "sinc" wave, now if we multiplex the "sinc" waves of all sub carriers sub channels it will look something like the below.

Now at the Rx side we can decode this wave because of the orthogonality, see the "arrows" they represent the frequency at which impact of all other sub carriers is zero, so we get to Rx only that particular sub-carrier we are interested in.


*2: By using an IFFT for modulation we implicitly chose the spacing of the subcarriers in such a way that at the frequency where we evaluate the received signal (indicated as arrows) all other signals are zero.



Advantages:

  1. Saves bandwidth
  2. Carries more no of data than a conventional carrier.


Disadvantages:
  1. Highly depends on the orthogonality achieved, need a good sync on Tx and Rx and also no multipath effect.
  2. High PAPR: Peak to Average Power Ratio.
The reason for high PAPR is that, as we use many sub-carriers with same bandwidth, the sum of peak power of all the sub-carriers varies instantaneously.
OFDM exhibits peaks whose power strongly exceeds the mean  power: the signal is said to have a high PAPR. This prevents use of high-efficiency amplification devices (High Power Amplifiers, HPA), which can cause nonlinearities reuslting in in-band distortion and increases Out-Of-Band  Radiation (OOBR), inter Symbol Interference and a high Bit-Error-Rate (BER).

Mitigations

1. 

a) Pilot: Instead of using all the sub-carriers/channels for data, use some selected sub carriers to send with zero-data so that the Rx can tune itself with the Tx. These are kind of training subcarriers.

b)  Cyclic Prefix (CP): In order to overcome the MultiPath effect, OFDM implements a clever technique of CP where in we first need to find the "Doppler Spread" of the multipath channel and then copy that amount of time from the data signal from the last to the first. So that even if that signal undergoes the multipath fading, we still have the data intact only the copied part is lost.


Doppler Spread: The amount of delay induced by the multipath channel to the 1st signal causing to overlap with the 2nd singal leading to infamous inter symbol interference. 


2.  There are many methods but below are famous ones
  • Clipping and Filtering
  • Peak Windowing


References:

  1. History behind OFDM
  2. Orthogonality in OFDM
  3. Why High PAR 

  4. PAPR Reduction Techniques



Note: All the pictures here are taken from the references and some additional resources. The author do not claim any copy right.