You are on page 1of 38

Understanding an OFDM transmission

by Krishna Sankar on February 3, 2008 Let us try to understand simulation of a typical Orthogonal Frequency Division Multiplexing (OFDM) transmission defined per IEEE 802.11a specification. Orthogonal pulses In a previous post (here ), we have understood that the minimum frequency separation for two sinusoidals with arbitrary phases to be orthogonal is period. , where is the symbol

In Orthogonal Frequency Division Multiplexing, multiple sinusoidals with frequency separation is used. The sinusoidals used in OFDM can be defined as (Refer Sec6.4.2 in [DIG-COMM-BARRY-LEE-MESSERSCHMITT]:

, where correspond to the frequency of the sinusoidal and is a rectangular window over Using of inverse Fourier Transform We now have understood that OFDM uses multiple sinusoidals having frequency separation where each sinusoidal gets modulated by independent information. The information is multiplied by the corresponding carrier and the sum of such modulated sinusoidals form the transmit signals. Mathematically, the transmit signal is, .

The interpretation of the above equation is as follows: (a) Each information signal multiplies the sinusoidal having frequency of . (b) Sum of all such modulated sinusoidals are added and the resultant signal is sent out as . Update: 29th May 2008 (thanks to the comment by Mr. Mork)

The sampled version of the above equation is,

It is reasonable to understand that above operation corresponds to an inverse Discrete Fourier Transform (IDFT) operation. Understanding of an OFDM transmission specified per IEEE 802.11a [80211A] From the Table 79 in [80211A], the symbol duration .

This implies that the used subcarriers are and so on. The available bandwidth of 20MHz is split into 64 subcarriers. Out of the available 64 subcarriers having indices , the number of used subcarriers is 52. The used subcarriers are having indices from are used for transmitting information sequence to . To understand in detail the correspondence between the subcarrier index and frequency, one may refer to a previous post (here). Once the bits in each symbol are assigned to appropriate IDFT inputs (Ref. Figure 109 in [80211A]), the IDFT operation is performed to obtained the time domain signal. For each symbol, some samples from the end are appended to the beginning of the symbol (referred to as cyclic prefix insertion). We may discuss the pros/cons of cyclic prefix in a future post. Simulation Model A simple Octave script where a BPSK modulated signal is transmitted on the 52 used subcarriers, may be used for understanding generation of an OFDM signal. The script is loosely based on 802.11a specification. Click here to download.

Figure: Spectrum of an OFDM transmission (based on 802.11a specification) Reference [DIG-COMM-BARRY-LEE-MESSERSCHMITT] Digital Communication: Third Edition, by John R. Barry, Edward A. Lee, David G. Messerschmitt [802.11A] Wireless LAN Medium Access Control (MAC) and Physical (PHY) Layer specifications High speed physical layer in 5GHz band Hope this helps. Krishna Tagged as: OFDM, orthogonal

Related posts
1. 2. 3. 4. 5. Inter Carrier Interference (ICI) in OFDM due to frequency offset Peak to Average Power Ratio for OFDM Cylcic prefix in Orthogonal Frequency Division Multiplexing BPSK BER with OFDM modulation BER for BPSK in OFDM with Rayleigh multipath channel

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN. { 118 comments read them below or add one }

1 Mork May 27, 2008 at 6:27 pm Hi, After providing the formula for s(t), you wrote >It is reasonable to understand that above operation corresponds to an inverse Discrete Fourier Transform (IDFT) operation. Why? s(t) is a continuous-time signal, so wouldnt it be the Fourier Series (if anything) rather than the DFT? Another question: I understand the properties of s(t) as it is, but how can this be implemented efficiently for large values of K? A direct implementation of the formula would require K oscillators at the receiver and the transmitter (to generate the individual sinusoidals), right? Thanks! M Reply

2 Mork May 27, 2008 at 9:44 pm Sorry for the double-posting, but I just happened to find the answer to my question (by pure chance Ive been trying to find out for quite a while already). The relation between s(t) as you wrote it (and as it is widely used) and the actual (I)DFT implementation is looked at in a paper by Lin and Phoong (http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1223555). Summarized very briefly, they find that for general window functions g(t) in your example including the commonly used rectangular windows, it is indeed *not* possible to generate the same s(t) using a DFT followed by a DAC. It is possible to generate a signal with the same values at the times t=nT, but the corresponding signal will still be different (and thus have a different PSD, too). Thanks for your attention -M Reply

3 Krishna Pillai May 29, 2008 at 5:05 am @Mork:Thanks for the valuable comments. Trying to answer the first comment:

(a) Yes, I agree. I was loosely specifying that a continuous time signal can be represented using IDFT. Infact, I should have added one more step, where I defined s(nT) and then claimed that it can be represented using IDFT. (b) Yes, direct implementation is K oscillators Trying to answer the second comment. Thanks for the link to the paper OFDM transmitters: analog representation and DFT-based implementation (a) From a quick read, the authors are showing that one has to consider the sampled window function g(nT) rather than the contnuous function g(t). I did not follow the full paper, however I was unable to find the reason behind y(t) having more psd than x(t) in region from 0.5 to 0.75 omega_s (ref. figure 5). Any thoughts? (b) Further, just to note that, in a typical implementation, the output x(nT) will be upsampled followed by a digital filtering, then passed to the DAC. Not of relavence to this discussion, but just to add as FYI. Thanks again for your comments. You helped me provide a better insight. Ps. I made a brief update to the post to reflect that s(nT) and not s(t) can be implemented using iDFT. Reply

4 Abdul-Jabbar Al-Ubaidy January 4, 2009 at 7:12 pm Hi all, OFDM is play great role in communication enhancement the understanding of this subject need good acknowledgment in M-arry modulation process and frequency analysis process ,so we can generate OFDM using wavelet Transform instead Fourier Transform. Reply

5 Krishna Pillai January 6, 2009 at 6:17 am @Abdul: Can you please point to reference explaining OFDM generation using Wavelet Transform Reply

6 kakamilan January 14, 2009 at 7:54 am

Note that there is an time extention beofre IDFT.The time that a symbol lasts will be N times than before. So T should be NT while suming N symbols. Is it right? Reply

7 Krishna Pillai January 16, 2009 at 6:20 am @kakamilan: Sorry, I did not understand your comment. I do not see a reason why the symbol should be extended before IFFT. Typically the cyclic prefix insertion is done after ifft. OR where you implying something else? Reply

8 Filbert January 25, 2009 at 2:24 pm Hi Krishna, I read from references that it requires oversampling at least twice, so if you transmitting 2500 bits, it needs at least 1250 zeros in the middle of the sequence. Is it right? I do not see the oversampling in your Matlab script. Thanks Reply

9 Krishna Pillai January 27, 2009 at 6:16 am @Filbert: For OFDM case, its a bit different. In OFDM we let aliasing to happen. However, the aliasing does not cause distortion because there are no frequency components in the -ve side of the spectrum. I have discussed in bit detail on the post on Negative Frequency. URI: http://www.dsplog.com/2008/08/08/negative-frequency/ Ps. Btw, if its oversampling by 2 (of a bit sequence of 2500bits), we need to insert 2500 bits. You can find details on oversampling and associated filtering (zeroorder hold, sinc, raised cosine etc) @ URI: http://www.dsplog.com/2008/04/14/transmit-pulse-shape-nyquist-sincrectangular/ URI: http://www.dsplog.com/2008/04/22/raised-cosine-filter-for-transmit-pulseshaping/ URI: http://www.dsplog.com/2008/05/01/eye-diagram-plot-matlab-raised-cosinefilter/

Hope this helps. Reply

10 kamran January 26, 2009 at 6:16 pm hi Krishna i hope you are fine and doing well. I am new to this field and would like to post questions starting from a basic level. In matlab why do we need to upsample our data sequence e.g. 4-PAM before sending it to the pulse shaping filter? I read that we need to match their sampling frequencies but i didnt understand what its trying to explain. Can you kindly explain this to me that why we need to match the sampling frequencies of both??? thanking in advance Reply

11 Krishna Pillai January 27, 2009 at 6:28 am @kamran: Yes, you are right. The sampling of data sequence and the sampling of the filter should match. If it does not match, then the filtering might not be proper. I have written some posts on transmit pulse shaping filter @ URI: http://www.dsplog.com/2008/04/14/transmit-pulse-shape-nyquist-sincrectangular/ URI: http://www.dsplog.com/2008/04/22/raised-cosine-filter-for-transmit-pulseshaping/ URI: http://www.dsplog.com/2008/05/01/eye-diagram-plot-matlab-raised-cosinefilter/ Hope this helps. Reply

12 Filbert January 28, 2009 at 12:20 pm Hi Krishna, how are you? I have some questions about your Matlab code scriptofdmtx. Is it right to write: outputiFFT=64*ifft(inputiFFT,nFFTSize) or just outputiFFT= ifft(inputiFFT,nFFTSize)? I get confused if it should be multiplied with nFFTSize or not.

And for [Pxx, W]=pwelch(st,[],[],4096,20) What is 4096 for? I think it is just nFFT? Why dont you use 64 instead of 4096? Thank you Reply

13 Krishna Pillai January 30, 2009 at 5:36 am @Filbert: My responses 1. Multiplication by nFFTSize does not really matter. It just enables one to scale the power of the signal, if one desires to do so. 2. The parameter 4096 controls the frequency resolution of the pwelch() function. Yes, I could have used 64, but I just wanted the plot to have more frequency resolution. Hope this helps. Reply

14 sona February 6, 2009 at 3:16 pm Sir i would like to do a project on simulation of ofdm using matlab. also i would like to compare the performance with some other communication system. Which you think is the best one to be compared with ofdm so that i can show the benefits of using ofdm clearly. can you give some help in doing the same? Reply

15 Krishna Pillai February 10, 2009 at 7:59 pm @sona: You may compare the performance of single carrier 802.11 transmission which is spread spectrum based (data rates of 1Mbps, 2Mbps, 5.5Mbps, 11Mbps) and compare it with 802.11a which is OFDM based (data rates of 6, 9, 12, 54Mbps). You may show the performance in multipath for similar data rates. Am expecting that OFDM should offer better immunity for multipath. Hope this helps. Reply

16 Claire February 16, 2009 at 7:54 am Hi, if you would like to use different windowing method (such as hanning), should I use the hanning(x) and multiply the signal and then using the psd() to calculate the PSD (to replace the pwelch function)? Thanks for your help! Reply

17 Krishna Pillai February 21, 2009 at 7:07 am @claire: I think pwelch() by default multiplies by hamming windo before finding the spectrum. http://www.mathworks.com/access/helpdesk_r13/help/toolbox/signal/pwelch.html Reply

18 thiruppathi March 2, 2009 at 7:27 pm hi sir , plz sent some good material about to understand the Doppler shift ;; sir can you provide the book mentioned below L.Hnzo, M.Munster, B.J.Choi, T.Keller, OFDM and MC-CDMA, thank you IEEE communication socity, March,2004. Reply

19 Krishna Pillai March 5, 2009 at 5:16 am @thiruppathi; I think Digital Communications: Fundamentals and Applications by Bernard Sklar has a good review on Doppler in the chapter on Fading channels (Chapter 15 in my copy).

Reply

20 Filbert March 2, 2009 at 10:20 am Hi Krishna, How are you? I just wonder why the psd in papers i have read the ripple is so smooth (some of them are just flat lines!). When i use your script, there are a lot of ripples. Do you have any idea about this? Thank you Reply

21 Krishna Pillai March 5, 2009 at 5:04 am @Filbert: It depends on the parameter passed onto the pwelch() function. Try specifying the window size and overlap factor. Modify the pwelch() code to [Pxx,W] = pwelch(st,25,0.01,4096,20); Reply

22 Marwan March 8, 2009 at 12:11 am Hi Mr Pillai, I have failed to implement OFDM raised cosine windowing. Are you able to give me some matalab hints? thank you in advance! Reply

23 Krishna Pillai March 8, 2009 at 7:46 pm @Marwan: As I understand, raised cosine windowing is performed to do transmit filtering without causing ISI. However, in OFDM, as there is cyclic prefix, there wont be any ISI evenif we use a normal filter. Hence may I know the motivation behind using raised cosine filtering for OFDM. Reply

24 Filbert March 11, 2009 at 9:59 am Hi Khrisna, I have sent you my simulation result, i do hope you can give your opinion about it. And i have another question. You said i should try [Pxx,W] = pwelch(st,25,0.01,4096,20); May i know why you chose 25 for window length and 0.01 for overlap factor? Are there any consideration for choosing these parameters? Thank you Reply

25 Krishna Pillai March 21, 2009 at 7:04 am @Filbert: I think smaller window length ensures that the spectrum is smoother. That was one of your objectives, no? Reply

26 Omar Quiones March 17, 2009 at 3:31 pm HOLA, tengo una duda, estoy trabajando en un proyecto y debo usar la ventana hanning, pero resulta que esta me reduce la magnitud de los datos, he leido que para compensar dicha magnitud, estos datos deben ser multiplicados por un factor pero no tengo conocimiento de como calcular este factor, alguien aqu tiene este dato, o me podrian colaborar con informacin al respecto. Muchas Gracias Reply

27 Krishna Pillai March 21, 2009 at 8:59 am @Omar: (after translating your comment to english thanks to google translate) I have a doubt, Im working on a project and I use the Hanning window, but it is me that this reduces the magnitude of the data, I read that, to compensate for this magnitude, these data should be multiplied by a factor but Im not aware of

how to calculate this factor, someone here has such information, or do you work with information. Thank you very much hmm.how are you applying Hamming window ? Reply

28 Kishore March 26, 2009 at 9:06 am Hi Krishna, One more doubt, subcarrierIndex = [-26:-1 1:26]; Here 52 subcarriers are used. 1)Can i use 0 to 51 intstead of negative frequencies and avoid fftshift()?. 2) How do we interpret these subcarrier numbers 0 corresponds to dc value N/2 ( here 52/2) corresponds to Nyquist frequency and after this is a replica. Am i right here ? Thanks again. Reply

29 Krishna Pillai April 4, 2009 at 7:54 am @Kishore: My replies: (1). Definition of subcarriers from [32:63] in 64-pt FFT is notional. What ever we sent on those subcarriers will get aliased back to [-32:-1]. To understand better, think of the following scenario. Lets say we are sampling a sinusoidal at 11MHz with sampling frequency of 20MHz. From sampling theory, we know that 11MHz gets aliased to 11-20 = -9MHz. (2) Negative subcarriers can be interpreted as complex sinuosidal e^(-jwt) with the phase decreasing with increasing time. N/2 is not typically 52/2. Typically we deal with FFT sizes which are powers of 2 in this example we use 64. Did you want to look at a post on negative freqency @ http://www.dsplog.com/2008/08/08/negative-frequency/

Hope this helps to give you good pointers. Please revert, if otherwise. Reply

30 Budhaditya March 30, 2009 at 2:52 pm Hi, while going through Understanding an OFDM transmission i have come across few problems,and they are: 1.When the 20 Mhz is divided into 64 subcarriers,then why only 52 are used?is it because we have to provide the guard band in between the siglans??? Reply

31 Krishna Pillai April 4, 2009 at 4:23 pm @Budhaditya: You are right. To be more precise, the null subcarriers are provided to have guard band between signals in adjacent channels. Reply

32 algenaby April 19, 2009 at 6:15 pm Hi Mr.Krishna, I am very happy for your Contributions in solve the problems associated with high data rate as OFDM.I am reseacher and I hope to provide me fundamental code for 16QAM (OFDM) and 16PSK (OFDM). thanks . Reply

33 Krishna Pillai April 22, 2009 at 5:29 am @algenaby: Hope the symbol and bit error rate computation for 16PSK and 16QAM should help you get going http://www.dsplog.com/2008/03/18/symbol-error-rate-for-16psk/ http://www.dsplog.com/2008/05/18/bit-error-rate-for-16psk-modulation-usinggray-mapping/

http://www.dsplog.com/2007/12/09/symbol-error-rate-for-16-qam/ http://www.dsplog.com/2008/06/05/16qam-bit-error-gray-mapping/ Reply

34 zingas May 8, 2009 at 11:53 am hello i want to ask whether there is any difference between taking n-point ifft and then fft for OFDM Vs taking ifft and then n-point fft in matlab. the difference i get is the signal with n-point ifft and then fft has a spectrum which do not have good resolution regard. Reply

35 Krishna Pillai May 12, 2009 at 5:26 am @zingas: Is there any specific reason why you mentioned n-point specifically? In general, as long as you undo the effect of what you did at the transmitter at the receiver, you should be able to demodulate correctly the received symbol. The fft spectral resolution is controlled by sampling frequency (fs) and the size of fft (N). For eg, with fs = 20MHz, and N = 64, the resolution is 312.5kHz. Agree? Reply

36 raj May 25, 2009 at 5:38 am Dear Mr Krishna Regarding your matlab code for OFDM using BPSK over Rayleigh Fading Channels. I tried but i failed to understand how u calculated these parameters. nFFT = 64; % fft size nDSC = 52; % number of data subcarriers nBitPerSym = 52; % number of bits per OFDM symbol (same as the number of subcarriers for BPSK) nSym = 10^4; % number of symbols

As according to my coding BPSK in OFDM. i have used 256 bits to transmit over 256 symbols i.e. 1 bit/symbol. Using 256 point fft and IFFT. So pls advice me how can i setup my parameters. Acc to my knowledge in BPSK one bit is transmitted in one symbol and then it is furthur transmitted on the subcarrier.Pls correct me if i am wrong. Reply

37 Krishna Pillai May 31, 2009 at 8:14 pm @raj: Acc to my knowledge in BPSK one bit is transmitted in one symbol and then it is furthur transmitted on the subcarrier.Pls correct me if i am wrong. This is wrong. In OFDM, depending on the FFT size, there will be more than 1 subcarrier which is used. For eg, in 802.11a systems, we use 64pt FFT and use 52 subcarriers. If each subcarrier is BPSK modulated, then each symbol can carry 52 bits. Hope this helps. Please refer to posts @ http://www.dsplog.com/tag/ofdm Reply

38 haleh December 23, 2009 at 3:41 pm Hi Krishna,why BER of QAM-OFDM and QAM in AWGN are same? Reply

39 Bijunair May 27, 2009 at 12:06 pm Dear Krishna Pillai Sir, Plz give ur email id. Reply

40 Krishna Pillai May 31, 2009 at 8:31 pm @Bijunair: You may find my details @ http://www.dsplog.com/contact-us/ Reply

41 raj June 7, 2009 at 8:48 am Dear Mr Krishna Thanks for ur reply. I want to ask you that 1)if i am not using pilot bits, so is it possible that i can take 52 subcarriers for data bits transmission. 2)Why we use 20 MHz as sampling frequency what is the reason behind it. 3)I have used nSym = 64 while using 52 subcarriers for data transmission is that correct. 4)Can we use EbN0dB in place of EsN0dB in your code for BPSK OFDM in AWGN and Rayleigh Fadig channels. Reply

42 Krishna Pillai June 7, 2009 at 2:41 pm @raj: My replies: 1/ Yes, you may 2/ Well, sampling frequency of 20MHz was defined by the IEEE TGa standardization committee. In general, it depends on the available spectrum and the number of channel required etc 3/ Well, number of symbols and number of used subcarriers are two independent parameters, agree? OR was there a typo in your comment and you mean nFFT = 64 (instead of nSym = 64)? Even for the latter, your assumption is correct. 4/ For BPSK, Eb/N0 and Es/N0 are same. Agree? Reply

43 engineer193 June 7, 2009 at 2:02 pm Mr Krishna Thanks for ur support I want to know that how can i use hF=fft(ht,64,2); command in place of hF = fftshift(fft(ht,64,2)); if there is no alternative then pls explain me about these commands

hF = fftshift(fft(ht,64,2)); xt=(nFFT/sqrt(nDSC))*ifft(fftshift(xF.)).; Reply

44 Krishna Pillai June 7, 2009 at 3:19 pm @engineer193: Did not quite follow your question. The fftshift() operator is used to order the output of the fft() such that the spectrum is show with DC at the center. Plz refer to the post on negative frequency for bit more details. http://www.dsplog.com/2008/08/08/negative-frequency/ Reply

45 krishnakumar June 10, 2009 at 10:45 pm sir, i am new to OFDM but i could not understand what is happening to signal after ifft in tranmsission. Whether the tranmission is in frequency domain or time domain. how the signal will look like in spectromter in air. after ifft how the modulation produces multiple frequency. pl explain. I am new to this field. thank you Reply

46 Krishna Pillai June 11, 2009 at 5:00 am @krishnakumar: The signal after ifft() is the sum of many complex sinewaves e^{jwt} + e^{2jwt} + e^{3jwt} + The samples are in time domain. The spectrum plot is captured in this post itself. Plz re-read this post. Hopefully, it should answer some of your queries. Reply

47 salma July 24, 2009 at 12:42 am plz, help me to understand why we need to those steps in our code in script for generting OFDM transmit waveform (loosely based on IEEE 802.11A specifications) for ii = 1:nSymbol

inputiFFT = zeros(1,nFFTSize); % assigning bits a1 to a52 to subcarriers [-26 to -1, 1 to 26] inputiFFT(subcarrierIndex+nFFTSize/2+1) = ipMod(ii,:); % shift subcarriers at indices [-26 to -1] to fft input indices [38 to 63] inputiFFT = fftshift(inputiFFT); outputiFFT = ifft(inputiFFT,nFFTSize); % adding cyclic prefix of 16 samples outputiFFT_with_CP = [outputiFFT(49:64) outputiFFT]; st = [st outputiFFT_with_CP]; end I can not understand why we need to assign bits a1 to a52 to subcarriers [-26 to -1, 1 to 26]; and not enter our data points directly to ifft like writting ipMod = [ipMod zeros(1,nBitPerSymbol*nSymbol-nBit)]; ipMod = reshape(ipMod,nFFTSize,length(ipMod )/nFFTSize); then enters it directly to ifft???????????? Reply

48 Krishna Pillai July 24, 2009 at 4:53 am @salma: Well, given a sampling frequency of fs and fft order N, we subcarriers defined from [-N/2 to N/2-1]*fs/N. To send information in subcarriers from [-N/2 to -1]*fs/N, we infact send them at [N/2 to N-1] amd due to aliasing, the information gets folded back to [-N/2 to -1]*fs/N. I have discussed bit more on this topic @ http://www.dsplog.com/2008/08/08/negative-frequency/ Hope this helps. Ps. This is a difficult, but important concept to understand in OFDM. Crossing this hurdle is an important step in understanding wireless communication in general and OFDM in particular. Reply

49 Nitya July 23, 2009 at 2:35 am Hi I am a graduate student, doing a project in water filling algorithm in OFDM. Can any one suggest some material which gives fundamental description of Water filling algorithm? In many papers, they just mentions it as Applying Water filling algorithm.. and I could not find a source which explains what it is. Thanks Nitya Reply

50 Krishna Pillai July 24, 2009 at 4:21 am @Nitya: I quickly recall that water filling algorithm stands for concentrating the transmit power at frequencies where channel is good. Though I have not looked into detail, I found that Chapters 8.5.1 and 8.5.2 in Digital Communication: Third Edition, by John R. Barry, Edward A. Lee, David G. Messerschmitt. discuss about water filling. Good luck. Reply

51 r.kalidoss August 13, 2009 at 9:11 am In OFDM all the information symbols are convert into parallel form, digital mapping and ifft operation performed. The output of IFFT is very minimum amplitude in the form of 0.05+i0.253 and so on.Then how to modulate this very minimum amplitude with high carrier frequency. (like interms of MHz).. Example a=randsrc(4,1); b=diag(a); c=ifft(b); d=fft(c,4*8); plot(abs(d)); Reply

52 Krishna Sankar August 14, 2009 at 5:05 am @kalidoss: In the example, the signal to be upconverted to RF band is c. The upconversion operation is out = Re{c * exp(j*2*pi*f_carrier*t)} Reply

53 kalidoss.r August 17, 2009 at 8:41 pm In the MATLAB script whats the use of fftshift command,why do you perform in the program. Reply

54 Krishna Sankar August 18, 2009 at 3:58 am @kalidoss: The output of the N point FFT by default is from [0 to N-1]. However, the frequencies from [N/2 to N-1] gets infact aliased to [-N/2 to -(N-1)]. The fftshift function does the re-arrangement of the N point FFT to do reflect this aliasing. octave:20> x = [1:16] octave:21> fftshift(x) = [ 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 ] Also, try reading the post on negative frequency. http://www.dsplog.com/2008/08/08/negative-frequency/ Reply

55 kalidoss.r August 18, 2009 at 7:12 pm 1. In the MATLAB script, how to assign the 52 bits to ifftshift variable size of 64 bits. It omits first 6-bits and last 6-bits,remaining bits are filled in the location. 2.In this script where we introduce orthogonality of the signals or how can we visualize the orthogonality. 3. In the program original data bits are 2500, after cyclic prefix total transmitted bits are 3920 instead of 2500. Nearley 56% of increasing data length, it may eat very large bandwidth. My statements are correct or not.

Sorry for the continuous disturbance.. Reply

56 Krishna Sankar August 19, 2009 at 5:51 am @kalidoss: My replies: 1/ In fact using the term sub-carriers might be better. I omit subcarriers from [-32 to -27, 0, 27 to 31] 2/ Orthogonality is introduced because, exp(j*2*pi*k*t/T) are orthogonal. Please refer to the post on Inter Carrier Interference (ICI) in OFDM for a better explanation http://www.dsplog.com/2009/08/08/effect-of-ici-in-ofdm/. 3/ Not correct. Adding cyclic prefix, increases the duration of the symbol on the air. However, this does not increase the bandwidth. Recall, if OFDM we are sending complex sinusoidals. Adding cyclic prefix, means we are sending the same sinusoidals for extra duration, and not sending additional sinusoidals. Reply

57 aredeq September 7, 2009 at 11:17 am hi krishna.. can you help me in designing OFDM system with BPSK using MATLAB Simulink? Reply

58 Krishna Sankar September 9, 2009 at 5:44 am @aredeq: Sorry, I do not have Simulink Reply

59 vedika September 12, 2009 at 11:20 pm hello krishna, i wanted to know how exactly we do the shifting and why is it required.. Also after generating the random symbols,is it that we need to take ifft.. and but when do we modulate it with a carrier like the different carriers that have frequency in multiples for orthogonality..?

please clear my concepts.. thank you.. Reply

60 Krishna Sankar September 14, 2009 at 5:31 am @vedika: The iFFT takes care of assigning each constellation symbol to different carriers that are orthogonal. Reply

61 vedika September 15, 2009 at 10:50 am I have 2 doubts..Please help me clear them.. In the script code that you have given 1. inputiFFT(subcarrierIndex+nFFTSize/2+1) = ipMod(ii,:); why have we used the above operation? Also why do we need to do the below: subcarrierIndex+nFFTSize/2+1 2. How the Cyclic prefix operation has been performed?in the code..Please explain.. thank you.. Reply

62 Krishna Sankar September 18, 2009 at 5:38 am @vedika: 1. For each row ii, am assigning all columns of ipMod to the variable inputiFFT per the indexing subcarrierIndex+nFFTSize/2+1 2. For inserting cyclic prefix, we take the last 16 samples from the ifft output and pad it to the same variable again. % adding cyclic prefix of 16 samples outputiFFT_with_CP = [outputiFFT(49:64) outputiFFT]; Reply

63 zizi October 8, 2009 at 12:36 pm Dir krishna, How do u calculate the sampling frequency and the duration of symbole (34)? are there limitation for ifft size and number of carriers? thank you for your helps. Reply

64 Krishna Sankar October 12, 2009 at 5:27 am @zizi: Sampling frequency, number of subcarriers etc are chosen based on the system requirements. For example, in 802.11a specifications, we had a channel of bandwidth 20MHz. So we chose the FFT sampling frequency as 20MHz. Then we chose a 64 point FFT, which resulted in a subcarrier spacing of 312.5kHz (20MHz/64). Had we chosen a higher order FFT, we would have been able to have more subcarriers, but the subcarrier spacing will be narrow. Some systems like WiMax uses 256/512pt FFT. Some others like DVB etc uses 1024 pt FFT. So, as I see the choices of FFT size, sampling clock etc are engineering choices based on the end design goal. Reply

65 zizi October 12, 2009 at 9:53 pm Dir krishna, But in your codes matlab you havent use the frequency sampling and the duration of symbol (and duration of cyclic prefix) ? please help me. thank you. Reply

66 Krishna Sankar October 13, 2009 at 5:03 am @zizi: Hmm I checked. The code assumed a time domain sampling frequency of 20MHz. The duration of the cyclic prefix is 16 samples (0.8us with 20MHz

sampling). Maybe checking out http://www.dsplog.com/2009/10/07/quiz-ieee-80211aspecifications/ might be also be helpful. Reply

67 zizi October 14, 2009 at 1:31 pm Dir krishna, I have 2 questions : 1-Where are the frequency samling and the duartion symbole mentioned in your code programme. 2-In BER OFDM-multipath simulation if i use the matlab commande rayleigtchan ,the curve of BER to be constant, how to equalize the chanal in this cas. please help me. thank you. Reply

68 Krishna Sankar October 15, 2009 at 5:33 am @zizi: My replies: 1/ Please refer to my previous reply 2/ Divide by the channel in frequency domain. Reply

69 Bhasker Gupta October 15, 2009 at 4:48 pm hi krishna how are u 1, in this script you plotted ofdm spectrum after adding cyclic prefix to ifft output. i think the iffft output will be the ofdm output is it so sir. 2, you use the function [Pxx, W]=pwelch(st,[],[],4096,20) to plot ofdm spectrum. but in any frequency spectrum it is always between frequency on x axis and magnitude (in dB) on y axis. but by using above function it is PSD on y axis . so does that has same meaning . actually but i did was firstly i take the fft of iffft output and then it taken its absolute value. then i tried to plot dB conversion of absolute value.but i am not getting accurate plot will you plz help me? Reply

70 Krishna Sankar October 17, 2009 at 4:08 am @Bhasker: My replies: 1/ Yes. The spectrum which we are concerned is that of the transmit waveform which goes on the air, and that includes the cyclic prefix. 2/ The variable Pxx is in linear. In the plot, I converted to log by 10log10(Pxx) and plotted. Using ifft for one symbol alone might not be a good idea, as it uses very small set of smaples. The pwelch() uses the whole vector and has algorithms to provide the smoothed spectrum. You can post your queries. Good luck. Reply

71 Raghav October 21, 2009 at 12:59 am Hi.Guyz..m Implementing OFDM Transmitter usingifft and i am doing so..by generating random nos. ranging 0 to 3and i am using QPSKand64 pt ifft.but when i am finding its power spectral density its coming out to be a bit unexpectedhelp me.. clc; clear all; x=randsrc(1,50*52,[0,1,2,3]); M=4; qpsk=pskmod(x,M); msg_tx=reshape(qpsk,52,50); U=msg_tx.; st=[]; for j=1:48 temp=ifft(U(j,:),64); temp2=[temp(49:64),temp]; st=[st,temp2]; end; fsMHz = 20; [Pxx,W] = pwelch(st,[],[],4096,20); plot([-2048:2047]*fsMHz/4096,10*log10(fftshift(Pxx))); xlabel(frequency, MHz) ylabel(power spectral density) title(Transmit spectrum OFDM (based on 802.11a)); Reply

72 Krishna Sankar October 27, 2009 at 5:24 am @Raghav: Some comments: 1/ Using modulation values 0 to 3 might not be correct. You might want to use -3,-1, 1, 3 if you want 4PAM 2/ The subcarier loading where edge subcarriers and DC subcarriers are not used is missing. Reply

73 Raghav November 20, 2009 at 2:31 am well siri am using QPSK which requires.0 to M-1 input valuesand M is 4 herecan u throw more light on 2nd point u described..!! And siri got one more problem.i have to implement OFDM using..fractional fourier transform and i needsome matlab codesof discrete fractional fourier transform..and IDFrFt too!! Can you help me with that sir..? Reply

74 Krishna Sankar December 6, 2009 at 4:17 pm @Raghav: Sorry, I have no posts on fractional Fourier transforms. Reply

75 Rupesh Kumar December 3, 2009 at 2:05 pm Hello Sir, I am trying to implement ZF frequency equalizer in OFDM for performance analysis through matlab coding. Please, help me..if you give me the code then it will be better for me. Reply

76 Krishna Sankar December 7, 2009 at 5:09 am @Rupesh Kumar: Please refer to the post http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/ Reply

77 angelo December 5, 2009 at 1:04 am @Rupesh zf equalizer should be not a problem,it is just a division in freq. i implemented LS estimator and MMSE estimator, i would ask to krishna why for MMSE estimator i have to normalize di RECEIVED QAM Symbols by a factor (fftlenght/numofcarriers) angelo Reply

78 Krishna Sankar December 7, 2009 at 5:17 am @angelo: I have discussed OFDM with ZF equalization in http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/ If there is no interference, then using ZF equalization is optimal, we might not want to use MMSE. If you are using MMSE, then the scaling factor might have been present to precisely define the noise variance. Reply

79 Fahmi December 5, 2009 at 8:50 pm Dear Sir, I have an ambiguity concerning the guard interval; my question is: Why we chose the end of the transmitted symbol as guard interval and not the beginning of the symbol, for example? And thank you in advance. Reply

80 Krishna Sankar December 7, 2009 at 5:26 am @Fahmi: Well, we would want to make the symbol + guard interval continuous transmission without any abrupt phase changes. One way to do this is to take the last xx samples and append to the front of the symbol. Reply

81 mohan December 16, 2009 at 1:36 pm Sir, thanks for providing very good articles on OFDM. I have a doubt regarding the placement of [-26:-1] subcarriers at [38:63]. In the script for generating the OFDM tx symbols, it is given that // % shift subcarriers at indices [-26 to -1] to fft input indices [38 to 63] // What if these [-26:1] are mapped to [27:52] and then [52:63] are filled with zeros. I understood the aliasing effect but the doubt is why are the -ve indexed carriers are mapped to [38:63] instead of [27:52] Thanks Mohan Reply

82 Krishna Sankar December 23, 2009 at 5:22 am @mohan: I did not fully understand the motivation behind your query, but to answer you: the subcarriers mapped to [38 to 63] will get aliased to [-26 to -1]. If you try to map to [27 to 52], then a) no aliasing on subcarriers mapped from [27 to 31] b) aliasing on subcarriers mapped from [32 to 52] to [-32 to -12] Also, please have a look at the post on negative frequency http://www.dsplog.com/2008/08/08/negative-frequency/ Reply

83 mohan December 16, 2009 at 1:43 pm sir, I got the clariffication for the doubt i raised just now. The 6null carriers at on each side of the band are contributing the DC and 11 zeros. Thanks mohan Reply

84 Krishna Sankar December 23, 2009 at 5:23 am @mohan: oh, k. good. i just replied anyways Reply

85 mohan December 22, 2009 at 10:37 am Sir, is there any particular reason behind placing the pilot carriers at -21,-7, 7 and 21. I mean spacing of 14 sub carriers? Can they be placed at any position other than these and if so, what can be the impact on performance etc? Thanks mohan Reply

86 Krishna Sankar December 23, 2009 at 5:53 am @mohan: I do not think, there is any requirement that have to be spaced 14 subcarriers apart. But, in general its desirable to have them spread wide apart. And as FYI. The pilots are used for estimating a) constant phase shift across subcarriers caused by residual frequency offset, phase noise b) linear phase across subcarriers caused by sampling clock frequency offset Reply

87 Raghav December 27, 2009 at 11:38 am Ok..sir thanks!!! Well im really trying to understand Discrete Fractional fourier Transform and im doing a Project on OFDM..I think it will be a Big Achievement implementing OFDM with DFrft Can u too Just take a look on thatand if possible Jss make me Understand its Algorithm..!! Reply

88 vedika February 7, 2010 at 9:49 pm hello krishna I simulated your code and got the process of it.now i am supposed to design even the receiver part. I have corrupted the transmitted OFDM using AWGN function and this the following code that i used for receiver part after your code SNR=20; Y= AWGN(st,SNR); [Pyy,W] = pwelch(Y,[],[],4096,20); figure; plot([-2048:2047]*fsMHz/4096,10*log10(fftshift(Pyy))); Y=reshape(Y,49,80); rt = []; for ii = 1:nSymbol % assigning bits a1 to a52 to subcarriers [-26 to -1, 1 to 26] for j=17:80 inputFFT(subcarrierIndex+nFFTSize/2+1) = Y(ii,j); end inputFFT = fftshift(inputFFT); outputFFT = fft(inputFFT,nFFTSize); rt = [rt outputFFT] end Would u please help further ? 1. i am not able to remove the cyclic prefix that was added,how to get it? 2. how willl recover the original generated samples?

Please do the needful.. Thanks a lot.. Reply

89 Krishna Sankar April 4, 2010 at 4:15 am @vedika: Try looking at the post on BER computation with OFDM http://www.dsplog.com/2008/06/10/ofdm-bpsk-bit-error/ Reply

90 notrino February 12, 2010 at 7:19 pm hi i must simulate this paper but i dont know some of blocks in block diagram,such as zero pad,cyclic prefix ,frame status conversion and i dont find these blocks in matlab simulink.plz help me,thanks http://www.4shared.com/file/220527131/52047ce3/A_Comparative_Performance. html Reply

91 Krishna Sankar April 4, 2010 at 4:00 am @notrino: Try to understand the functionality of each block, and then model it Reply

92 Filbert February 25, 2010 at 11:52 am Hi Krishna, In your psd figure above, most of the frequencies lie on -30 dB, if i want to normalize the psd, to be 0 dB, what is the normalization factor? Thank you Reply

93 Krishna Sankar March 31, 2010 at 5:08 am

@Filbert: Multiply Pxx with 10^(30/10) Reply

94 preppy March 16, 2010 at 8:59 pm Hi Krishna im currently making simulation to compare SISO and SISO OFDM using matlab. Im using specification from 802.16d (fixed WiMAX) with 256 subcarriers (200 used subcarriers), with BPSK modulation and using AWGN channel(no fading applied). The idea is to plot these two conditions on SNR vs BER graph. I have the result from this simulation, showing that SISO OFDM have a lower SNR (which is better i think) than SISO in the same BER. What doubts me is how can OFDM make SISO have a better SNR, cause all i know about OFDM from reading several books are all about orthogonality and ISI issues. Can u relate SNR-BER issues with orthogonality-ISI issues? Is my simulation shows correct result or not? thanks in advance.. P.S.: im using same amount of bits, which is 200 SC x 48 data symbols/SC x 1 bit/symbol = 9600 bits, as for OFDM case, im using CP ratio 1/8 so it has 288 subcarriers total..hope this will complete the details.. Reply

95 Krishna Sankar March 28, 2010 at 2:30 pm @preppy: There should not be any difference in SISO vs SISO OFDM performance in AWGN. http://www.dsplog.com/2008/06/10/ofdm-bpsk-bit-error/ Reply

96 vedika March 29, 2010 at 2:02 pm hello krishna I simulated your code and got the process of it.now i am supposed to design even the receiver part. I have corrupted the transmitted OFDM using AWGN function and this the following code that i used for receiver part after your code SNR=20; Y= AWGN(st,SNR);

[Pyy,W] = pwelch(Y,[],[],4096,20); figure; plot([-2048:2047]*fsMHz/4096,10*log10(fftshift(Pyy))); Y=reshape(Y,49,80); rt = []; for ii = 1:nSymbol % assigning bits a1 to a52 to subcarriers [-26 to -1, 1 to 26] for j=17:80 inputFFT(subcarrierIndex+nFFTSize/2+1) = Y(ii,j); end inputFFT = fftshift(inputFFT); outputFFT = fft(inputFFT,nFFTSize); rt = [rt outputFFT] end Would u please help further ? 1. i am not able to remove the cyclic prefix that was added,how to get it? 2. how willl recover the original generated samples? Please do the needful.. Thanks a lot.. Reply

97 Krishna Sankar March 30, 2010 at 4:16 am @vedika: My replies: 1/ For removing cyclic prefix, need to remove samples corresponding to the duration of the cyclic prefix 2/ Plz take a look at http://www.dsplog.com/2008/06/10/ofdm-bpsk-bit-error/ Reply

98 Chaitanya March 31, 2010 at 8:32 pm Hi Krishna, I had to include a Simulink model for clarification. So Ive sent my doubt to your mail. Kindly check it out.

Reply

99 Krishna Sankar April 4, 2010 at 3:45 am @Chaitanya: Answering in the comments will be faster than emails (am running a bit late on blog related email queries) Reply

100 Chaitanya April 5, 2010 at 10:25 am I will wait for your reply to the mail. Meanwhile, can you explain the need for training insertion and zero padding in OFDM? Also, the function of channel estimation and compensation in the receiver. These were few of the blocks i encountered in the model. Also, in he OFDM transmitter, the blocks were in this order Bit generator - RS encoder- QPSK modulator - Row Selector - Matrix concatenation(first Vertical, then Horizontal) - zero pad - IFFT - Cyclic prefix - Training Insertion - Parallel to Serial converter. The vertical matrix concatenation block had 3 inputs(two from the row selector and the other is constant zero) The horizontal matrix concatenation block had 2 inputs(one from the preceding vertical block and the other from a block denoted TR) The TR block consisted of: PN seq generator Unipolar to bipolar conv The training insertion block consisted of: Column selector Horizontal matrix concatenation All this was there in the Simulink model i attached to your mail. So if u could give me the purpose of the various blocks when your time permits, it would be invaluable. Reply

101 Krishna Sankar April 6, 2010 at 4:51 am @Chaitanya: a) In frequency domain, we do not want to use subcarriers at the edge (and also at

DC). Hence these subcarriers are nulled out. b) In typical OFDM systems, the system model can be written as Y = HX + N, where Y is the received symbol H is the channel X is the transmitted symbol N is the noise. To accurately demodulate X, we need to undo the effect of channel prior to demodulation. So Yhat = Y/H = X + N/H ~= X (if N is low) > this is channel compensation For estimating channel, we will send a symbol where X is known at the receiver. Hhat = Y/X = H + N/X ~= H (if N is low) > this is channel estimation Reply

102 Chaitanya April 6, 2010 at 6:54 pm Thanks for the explanation. The nulling out of subcarriers explains the zero padding block. But what about the training pulses inserted in the transmitter and separated at the receiver?

103 vedika April 5, 2010 at 2:09 am Hello Sir, Thanks a lot for the reply, Could u please guide me as to how a receiver is designed,I am not able to recover the samples.I am using 64QAM and I am mapping the data and dividing it into subblocks,as the definition of OFDM goes.. after the ifft,i tried to to do the fft but the samples are not getting recoverd,they get scaled.. please help me for the same. Reply

104 Krishna Sankar April 5, 2010 at 4:26 am @vedika: If the scaling factor is constant across all subcarriers, then it can be easily accounted for. Agree? Reply

105 behzad June 12, 2010 at 1:13 pm hi krishna i want to know how to define separation frequency between the sub-carrier in ofdm. it the way i have found with ifft command this frequency is 1 Hz. thanks krishna Reply

106 Krishna Sankar June 14, 2010 at 6:15 am @behzad: Well, subcarrier spacing is controlled by the sampling clock and the number of points in the FFT. For examples, if the sampling clock is 20MHz and the FFT size is 64, the subcarrier spacing is 20MHz/64 = 312.5kHz Reply

107 dungpt June 14, 2010 at 7:47 am Can I understand the sampling clock is the sampling rate of DAC? For example, at 20MSa/s sampling rate, symbol period T=64*1/20(MSa/s)=3.2 (microsecond). Therefore, the subcarrier spacing is 1/T=312.5 kHz. Reply

108 Krishna Sankar June 21, 2010 at 5:51 am @dungpt: Your numbers are right. You can assume that the sampling period is the sampling period of the FFT. Sampling period of DAC need not be sampling period of iFFT. Typically, DAC can have 2x/3x oversampling compared to fft sampling rate. Reply

109 thieutuoc June 14, 2010 at 8:55 pm

hi krishna, OFDM system has a block of data Mapping is then brought through the block ifft data, so I want to know what to do for mass Mapping. thanks! Reply

110 Krishna Sankar June 21, 2010 at 5:49 am @thieutuoc: What is mass mapping? Are you referring to QAM mapping? Reply

111 thieutuoc June 15, 2010 at 5:09 am Hi krishna In OFDM system is a mapping blocks, data blocks will be put back into the IFFT, so the question is which blocks any effect? thank you! Reply

112 Krishna Sankar June 21, 2010 at 5:43 am @thieutuoc: Sorry, I do not follow your query. Reply

113 thieutuoc June 26, 2010 at 8:09 am Sorry Krishna, I mistake. It is digital modulation block (QAM). Thanks Krishna! Reply

114 Afm July 25, 2010 at 11:43 pm hi krisna,

Could you do an article about understanding the MC-CDMA too? I know it is a little bit similar to OFDM and I have also read some paper on MC-CDMA. I just dont really get how to implement the coding (which is in frequency domain) and the message bit in Matlab. Do I need to multiply them together in the frequency domain or ifft the coding first and then multiply with message bit? Thanks Reply

115 Krishna Sankar July 26, 2010 at 6:48 am @Afm: Have not written about MC-CDMA, will write in future Reply

116 Nanu Nadoda September 1, 2010 at 10:15 pm hi krishna i am new to matlab. can you send me basic script for transmitter and receiver using 64 qam modulation with addition and removal of cyclic prefix Reply

117 Krishna Sankar September 5, 2010 at 6:26 am @Nanu Nadoda: You may find code for 64QAM @ http://www.dsplog.com/2008/07/08/compare-bpsk-qpsk-4pam-16qam-16psk64qam-32psk/ Reply

118 Krishna Sankar April 13, 2010 at 5:29 am @Chaitanya: The training sequence help the receiver synchronize with the transmitter to help with channel estimation, phase synchronization etc