OFDM simulation – performance in AWGN channel

Goal: Simulate discrete-time cyclic-prefixed OFDM communication system. Explain role of IFFT/FFT, cyclic prefix. Simulate M-QPSK / M-QAM based cyclic prefixed OFDM over AWGN channel.

This article is part of the book
Wireless Communication Systems in Matlab (second edition), ISBN: 979-8648350779 available in ebook (PDF) format and Paperback (hardcopy) format.

Discrete-time implementation of baseband CP-OFDM

The schematic diagram of a simplified cyclic-prefixed OFDM (CP-OFDM) data transmission system is shown in Figure 1. The basic parameter to describe an OFDM system is to specify the number of subchannels (N) required to send the data. The number of subchannels is typically set to powers of 2, such as \{64, 256, 512, 1024, \cdots \}. The size of inverse discrete Fourier transform (IDFT) and discrete Fourier transform (DFT) need to be set accordingly.

The transmission begins by converting the source information stream into N parallel subchannels. For convenience, the information stream \mathbf{d} is already represented as a symbol from the set \{1,2,\cdots,M\}. The data symbol in each subchannel is modulated using the chosen modulation technique such as MPSK or MQAM.

Since this is a baseband discrete-time model, where the signals are represented at symbol sampling instants, the information symbol on each parallel stream is assumed to be modulating a single orthogonal carrier. At this juncture, the modulated symbols \mathbf{X} on the parallel streams can be visualized as coming from different orthogonal subchannels in the frequency domain. The components of the orthogonal subchannels in the frequency domain are converted to time domain using IDFT operation.

Discrete-time simulation model for OFDM transmission and reception
Figure 1: Discrete-time simulation model for OFDM transmission and reception

The following generic function implements the modulation mapper (constellation mapping) shown in the Figure 1. The function supports MPSK modulation for M \in \{2,4,8, \cdots \} and MQAM modulation that has square constellation : M \in \{4,16,64,256,1024, \cdots \}. It is built over the mpsk_modulator.m and mqam_modulator.m functions given in sections 5.3.2 and 5.3.3 of chapter 5 (Refer the book Wireless communication systems using Matlab).

Please refer the book Wireless communication systems using Matlab – for full Matlab code

modulation_mapper.m: Implementing the modulation mapper for MPSK and MQAM

function [X,ref]=modulation_mapper(MOD_TYPE,M,d)
%Modulation mapper for OFDM transmitter
% MOD_TYPE - 'MPSK' or 'MQAM' modulation
% M - modulation order, For BPSK M=2, QPSK M=4, 256-QAM M=256 etc..,
% d - data symbols to be modulated drawn from the set {1,2,...,M}
%returns
% X - modulated symbols
% ref -ideal constellation points that could be used by IQ detector
if strcmpi(MOD_TYPE,'MPSK'),
[X,ref]=mpsk_modulator(M,d);%MPSK modulation
else
if strcmpi(MOD_TYPE,'MQAM'),
[X,ref]=mqam_modulator(M,d);%MQAM modulation
else
error('Invalid Modulation specified');
end
end;end

OFDM signal is a composite signal that contains information from subchannels. Since the modulated symbols \mathbf{X} are visualized to be in frequency domain, it is converted to time-domain using IDFT. In the receiver, the corresponding inverse operation is performed by the DFT block. The IDFT and DFT blocks in the schematic can also be interchanged and it has no impact to the transmission.

In a time-dispersive channel, the orthogonality of the subcarriers cannot be maintained in a perfect state due to delay distortion. This problem is addressed by adding a cyclic extension (also called cyclic prefix) to the OFDM symbol (reference [1]). A cyclic extension is added by copying the last N_{cp} symbols from the vector \mathbf{x} and pasting it to its front as shown in Figure 2.

Adding a cyclic prefix in CP-OFDM
Figure 2: Adding a cyclic prefix in CP-OFDM

Cyclic extension of OFDM symbol converts the linear convolution channel to a channel performing cyclic convolution (view demo here) and this ensures orthogonality of subcarriers in a time-dispersive channel. It also completely eliminates the subcarrier interference as long as the impulse response of the channel is shorter than the cyclic prefix. At the receiver, the added cyclic prefix is simply removed from the received OFDM symbol.

On the receiver side, the demapper for demodulating MPSK and MQAM can be implemented by using a simple IQ detector that uses the minimum euclidean distance metric for demodulation. (discussion and function definitions in section 5.4.4 of chapter 5 (Refer the book Wireless communication systems using Matlab).

Performance of MPSK-CP-OFDM and MQAM-CP-OFDM on AWGN channel

The code (given in the book Wireless communication systems using Matlab) puts together all the functional blocks of an OFDM transmission system, that were described here, to simulate the performance of a CP-OFDM system over an AWGN channel. The code supports two types of underlying modulations for OFDM – MPSK or MQAM. It generates random data symbols, modulates them using the chosen modulation type, converts the modulated symbols to frequency domain using IDFT operation and adds cyclic prefix to form an OFDM symbol. The resulting OFDM symbols are then added with AWGN noise vector that corresponds to the specified E_b/N_0 value (AWGN noise model is described in this article).

On the receiver side, cyclic prefix is removed from the received OFDM symbol, DFT is performed and then the symbols are sent through a demapper for getting an estimate of the source symbols. The demapper is implemented by using a simple IQ detector that uses the minimum euclidean distance metric for demodulation. Finally, the symbol error rates are computed and compared against the theoretical symbol error rate curves for the respective modulations over AWGN. Simulated performance results are plotted in Figure 3.

Performance of M-PSK CP-OFDM and M-QAM CP-OFDM over AWGN channel
Figure 3: Performance of M-PSK CP-OFDM and M-QAM CP-OFDM over AWGN channel

Rate this article: PoorBelow averageAverageGoodExcellent (22 votes, average: 3.77 out of 5)

Reference

[1] A. Peled and A. Ruiz, Frequency domain data transmission using reduced computational complexity algorithms, in Proc. IEEE ICASSP- 80, Vol. 5, pp.964 – 967, April 1980.↗

Topics in this chapter

Orthogonal Frequency Division Multiplexing (OFDM)
● Introduction
Understanding the role of cyclic prefix in a CP-OFDM system
 □ Circular convolution and designing a simple frequency domain equalizer
 □ Demonstrating the role of cyclic prefix
 □ Verifying DFT property
Discrete-time implementation of baseband CP-OFDM
Performance of MPSK-CP-OFDM and MQAM-CP-OFDM on AWGN channel
● Performance of MPSK-CP-OFDM and MQAM-CP-OFDM on frequency selective Rayleigh channel

Books by the author

Wireless Communication Systems in Matlab
Wireless Communication Systems in Matlab
Second Edition(PDF)

PoorBelow averageAverageGoodExcellent (162 votes, average: 3.78 out of 5)

Digital modulations using Python
Digital Modulations using Python
(PDF ebook)

PoorBelow averageAverageGoodExcellent (123 votes, average: 3.60 out of 5)

digital_modulations_using_matlab_book_cover
Digital Modulations using Matlab
(PDF ebook)

PoorBelow averageAverageGoodExcellent (126 votes, average: 3.70 out of 5)

Hand-picked Best books on Communication Engineering
Best books on Signal Processing

92 thoughts on “OFDM simulation – performance in AWGN channel”

  1. Hello sir, I referred to the MATLAB simulation code in your book, and tried modifying the MPSK-CP-OFDM simulation for frequency selective Rayleigh channel to Rician channel instead.

    I am having a lot of trouble generating simulation results that match the theoretical results. At the moment, the results go in opposite directions.

    I am attempting the following:
    (1) Single tap -> just the rician random variable
    (2) 10 taps (just as in the simulation provided in the textbook) -> rician random variable but with length (1,L).

    Understand this thread was written long ago, but will appreciate any advice and tips on going forward.

    Regards,
    Zewei

    Reply
  2. Good afternoon sir ,please I am working on UAV to UAV communication or multipe UAVs communicating with with one another.I wand to use OFDM as my modulating scheme .how should I do it .this is my number xxxxxxxxx (number redacted for privacy). you can send me your number and I will call too.is urgent thank you

    Reply
  3. OK, please find my whole query (from facebook) here.

    1)It’s about “Simulation of OFDM system in Matlab – BER Vs Eb/N0 for OFDM in AWGN channel”

    OK, here is my question. It’s about finding Es/N0.(considering we use BPSK)

    ——-
    CP
    ——

    1)We have 64 sub-carriers but we have Null in some sub-carriers too. So shouldn’t the useful bits be 52 instead of FFT size which is 64? because you had to assign 0 in 12 subcarriers to make it fullfil 64 sub-carriers. So when you consider bit energy, why do you consider those 0 you added to IFFT input too?

    Or you consider the useful bits after IFFT block?

    2) I am confused about OFDM symbol you mentioned.

    The FFT size is 64 (number of used sub-carrier is 52). So it’s gonna be 52*10^4 bits to be transmitted?(in case it’s BPSK)

    Then why number of useful bits to use to calculate Es/N0 is not equal to 52*10^54? but it’s equal to just the number of FFT size?
    is it because we consider only 1 OFDM?

    Please see my example below.
    Assume we transmit 1 2 3 4 5….15
    When we do serial to parallel it’s gonna be

    11 6 1
    12 7 2
    13 8 3
    14 9 4
    15 10 5

    3) First 1,2,3,4,5 will be assigned into IFFT input. Do we consider 1,2,3,4,5 as 1 ofdm symbol. 6,7,8,9,10 as another OFDM symbol? and when we calculate Eb/No we consider only one by one OFDM symbol? not whole information data?

    When you say OFDM symbol (below “Effect of Cyclic Prefix on Es/N0″) do you mean like each OFDM symbol above?
    I am confused with BPSK, 0 is one symbol, 1 is another symbol. Or QPSK has 00 as 1 symbol, 01 as another symbol.

    Reply
  4. hello sir, i saw the implementation of this code iun your book, how can i add a pulse shaping filter? i am learning about slepian sequences and i was wonder if they can be applied in this case

    Reply
    • Pulse shaping filter can be implemented using waveform simulation technique where each and every cycle has to be simulated. I have just released the following book that contains the complete details on simulating various pulse shapes like raised cosine, square-root raised cosine, rectangular and sinc pulses. Similar way Slepien sequence can be implemented if the equation for the pulse shape is known. Thanks

      Wireless Communication Systems in Matlab – ISBN: 978-1720114352 (Paperback) – https://www.amazon.com/dp/1720114358
      Wireless Communication Systems in Matlab – (PDF ebook) – https://www.gaussianwaves.com/buy-books

      Reply
  5. hello sir, i am trying to implement a multicarrier modulation using slepian sequences. in what point of the ofdm scheme do i have to change the pulse wave to achieve this?

    Reply
    • Subcarrier pulse shaping blocks are implemented between the IFFT block and the Parallel-to-serial converter in the transmitter.

      In conventional OFDM. each output from the IFFT is usually shaped using a rectangular filter. This gives a sinc spectrum for each subcarrier. When the subcarriers are spaced 1/T apart, the zeros of the other subcarriers align in such a way that there is no interference from other subcarriers.

      However, if the channel is a frequency dispersive channel (like Doppler effect), the subcarriers are
      no longer in the zeros of the sinc, and given the shape of the sinc outside these zeros any frequency dispersion causes inter carrier interference.

      Prolate spheroidal sequences like Slepian sequences that are most concentrated within a discrete time interval and most band-limited within a given bandwidth. Hence it is a better choice in the case of frequency dispersive channels.

      Slepian pulse shaping bases can be implemented after IFFT block, replacing the rect filters. Example shown below – for more details refer the source: https://arxiv.org/pdf/1212.3374.pdf
      https://uploads.disquscdn.com/images/3f00386d0fce5124aae6eb0ee5020beba440407f5efac8b8b825a3641f5b54b4.png

      Reply
  6. Hi sir
    can you explain to me what is OFDM-IM (index modulation).?
    and what is the main difference between him and classical OFDM? and how i can simulate it?
    or mention me to a reference BOOK that can help me.
    thank you

    Reply
  7. hello sir ,i bought your book from amazon kindle ….i found code for ofdm over awgn channel bt pls help me for ofdm over rician fading channel

    Reply
  8. Hi sir iam doing ofdm system in the channel modeling instead of AWGN i want to use rayleigh channel but my code isn’t complete can you help me plz

    Reply
  9. Hello sir.!
    Recently I’ve been working with OFDM and doing my research on Index Modulation using OFDM.

    Can you help me with the block that generates index bits and data bits separately and use them for OFDM?

    Reply
  10. Hi Sir,
    In your book:
    in OFDM transmitter: x_Time=N/sqrt(Nst)*ifft(X_Freq);
    and receiver: r_Time=sqrt(Nst)/N*(fft(r_Parallel));

    Could you explain what is “N/sqrt(Nst)” for? Is it for scaling and must do?
    Thank you for your time.

    Reply
  11. Hello Sir,

    > Your final expression for transmitted signal power management “Boosted OFDM signal” is bit confusing for me. As we are just repeating some symbols for cyclic prefix, so CP and DMRS signals must not come in the expression.
    > Your final expression doesn’t contain extra bits due to IFFT block. We zero pad in IFFT inputs so it must effect the power of transmitted signal and simulated BER.
    For example: If we have 100 PRBs (= 1200 resource elements in frequency domain) and IFFT size is 2048. then the boosting factor must me “sqrt(2048/1200)”.
    **Why the CP and DMRS will effect the BER? Please clear this point**
    > Let suppose there are total 9792 (for 68 PRBs and 1 subframe = 68*12*12) modulated symbols. These symbols are mapped to 100 PRBs in uplink and DMRS signals are inserted in 2 columns. Now, the total symbols will be 100*12*14 = 16800 (1200 rows with 384 rows zero padded and 14 columns). For IFFT size 2048 this 1200*14 matrix is converted into 2048*14 (= 28672) size matrix with zero padding and then CP is inserted in each column. and according to 3gpp standard total 160*2 + 144*12 (= 2048) symbols inserted and total 30720 bits transmitted. Here we are zero padding two times and DMRS signals are also inserted. How will you solve this problem to get better BER in matlab simulation? Your above explanation doesn’t explain anything in detail.

    Reply
  12. Hi, How can I see the latex lines properly? I have tried different browsers (IE, firefox, chrome) with no luck. I have MikTex installed as well, right now what I see is for example “Es(N+N_{cp})=NE_{b}“. thanks

    Reply
    • The latex plugin was not working properly with the old syntax on this page. I have installed MATHJAX latex plugin, updated the syntax and now the equations are getting displayed properly.

      Thanks for bringing it to my notice.
      Just browse/reload this page on your browser to see the equations . Let me know if you are still unable to see the equations properly.

      Reply
  13. I have a question related to crest factor(PAPR) of OFDM signal. I have read that the crest factor of OFDM is equal to the number of subcarriers say K(where KxK is the peak value of signal and K is the RMS value of signal, as per http://www.nutaq.com/blog/understanding-papr-ofdm-systems). Does this mean that the dynamic range of DAC is [-KxK, KxK]?(I wonder whether for large number of subcarriers the range of [-KxK, KxK] will be practical or not!)

    Reply
  14. In your matlab code X_Freq =[ zeros( 1,1) s( 1: Nst/ 2) zeros( 1,11) s( Nst/ 2 +
    1: end)];
    Why don’t you use Nun instead 11 ?? There are 11 null sub carriers, but maybe using Nun will be suitable for other applications.

    Reply
  15. hello sir….i want know the how to intoduce the convex optimization problem in solving of multiuser communications. i.e the output of least square precoding technique is equal to the solving the optimization problem “s=Hx” where s is data input H chanel matrix, x is our solution

    Reply
  16. I want to calculate the bit error rate and plot of this for wavelet based ofdm system can you help me for this? i have written the wavelet based ofdm code.

    Reply
  17. How can I use Matlab to measure the energy of each transmitted symbol and each received symbol. I would like to make comparisons between each pair of transmitted and receive symbols.

    Reply
  18. I am doing my M.E. project. I have implemented OFDM system. I have added carrier frequency offset to it. Then I have plotted graphs for CFo Vs. ICI power and CFO Vs. Carrier to interference ratio. Then I have applied Kaiser window in transmitter after IFFT. It is expected that ICI power should reduce and CIR should increase.But i am not getting correct results. Please tell me how to implement kaiser window in OFDM.Also suggest me formula for calculating ICI power.

    Reply
  19. I am working on Intercarrier interference cancellation For OFDM.I have designed system for IEEE802.11a. I have added carrier frequency offset to it. I want to plot graph of CFO Vs.ICI power. But how to calculate ICI power. Please tell me formula.
    Also i want to use windowing (kaiser window) to reduce ICI power. How to implement Kaiser window in OFDM .

    Reply
  20. Hi,
    I want to know why OFDM with BPSk has high bit error rate than OFDM with QPSK and 64 QAM?
    And why 16-QAM has best performance among all?

    Reply
      • Dear Neetu,
        You need some more knowledge about digital communication systems. Once observe constellation graphs for all modulation schemes, then you will let you clear your doubt.

        Reply
  21. Hi Mazda,

    3) OFDM over rayleigh.

    if rayleigh channel has 10 taps

    nTap = 10;
    ht = 1/sqrt(2)*1/sqrt(nTap)*(randn(nSym,nTap) + j*randn(nSym,nTap));

    How can we know that we have to use this term “1/sqrt(2)*1/sqrt(nTap)” to normalise. Is it the theory from the book? where can I find those sources to check what term I should use to normalise channel, noise in matlab.

    Consider the following equation for generating a complex gaussian noise
    n = rand(1,10) + j rand(1,10)

    The rand function in matlab generates noise with zero mean and unit variance. Since we are using two independent noise sources to generate a complex noise, the variance will double. So in this case the variance is 2x ( where x=1)

    To generate a complex noise with zero mean and unit variance, the output has to be normalized by 1/sqrt(2). So the code becomes
    n = 1/sqrt(2) * (rand(1,10)+j rand(1,10)

    Why should we require the noise variance to be 1 ? Because, when the variance is 1, the noise power becomes unity. The noise power is scaled to become unity indirectly.

    For an n Tap channel the equation to generate the multipath is
    ht = 1/sqrt(2)*1/sqrt(nTap)*(randn(nSym,nTap) + j*randn(nSym,nTap));

    the term 1/sqrt(nTap) is used in the similar way to normalize the noise power to unity.

    Reply

  22. (1)–> For OFDM over AWGN, you compare the result with BPSK over AWGN. The results are the same. And the reason is…OFDM doesn’t do anything in AWGN.

    (2)–> However in OFDM over rayleigh(using n tap), you compare the result with BPSK over rayleigh. The results are the same as well.

    2.1 ->But why this time the reason is not “because OFDM doesn’t do anything in rayleigh”. as (1)
    2.2 ->and why the results are the same if OFDM is doing something? and what is OFDM doing? what can you tell from the graph that the result is the same as BPSK over rayleigh?

    I think u are refering to Rayleigh Fading Simulation with nTap multipath. OFDM will improve the performace of a system if the multipath channel incorporates both delay spread and doppler effect. I think that the simulation that you are refering to is incorporating only the variation of tap weights. In that case, both BPSK and OFDM with BPSK will perform similar.

    Introduce doppler spread in the Rayleigh channel and you can observe the difference in performance improvement with and without OFDM

    Reply
  23. Hi Mazda,

    3) OFDM over rayleigh.

    if rayleigh channel has 10 taps

    nTap = 10;
    ht = 1/sqrt(2)*1/sqrt(nTap)*(randn(nSym,nTap) + j*randn(nSym,nTap));

    How can we know that we have to use this term “1/sqrt(2)*1/sqrt(nTap)” to normalise. Is it the theory from the book? where can I find those sources to check what term I should use to normalise channel, noise in matlab.

    Consider the following equation for generating a complex gaussian noise
    n = rand(1,10) + j rand(1,10)

    The rand function in matlab generates noise with zero mean and unit variance. Since we are using two independent noise sources to generate a complex noise, the variance will double. So in this case the variance is 2x ( where x=1)

    To generate a complex noise with zero mean and unit variance, the output has to be normalized by 1/sqrt(2). So the code becomes
    n = 1/sqrt(2) * (rand(1,10)+j rand(1,10)

    Why should we require the noise variance to be 1 ? Because, when the variance is 1, the noise power becomes unity. The noise power is scaled to become unity indirectly.

    For an n Tap channel the equation to generate the multipath is
    ht = 1/sqrt(2)*1/sqrt(nTap)*(randn(nSym,nTap) + j*randn(nSym,nTap));

    the term 1/sqrt(nTap) is used in the similar way to normalize the noise power to unity.

    Reply
  24. 3) OFDM over rayleigh.

    if rayleigh channel has 10 taps

    nTap = 10;
    ht = 1/sqrt(2)*1/sqrt(nTap)*(randn(nSym,nTap) + j*randn(nSym,nTap));

    How can we know that we have to use this term “1/sqrt(2)*1/sqrt(nTap)” to normalise. Is it the theory from the book? where can I find those sources to check what term I should use to normalise channel, noise in matlab.Could you please recommend me the book that contain such information (if it’s from the theory).

    I really don’t understand what number I should use to normalise things in matlab. and why do we need to normalise it.

    ps: I am still looking forward to reading your articles of OFDM over rayleigh+matlab code.

    ———————-
    Also would be useful if you could post the articles about DFT, FFT and something about OFDMA 🙂

    Reply
  25. I have more queries here.
    (1)–> For OFDM over AWGN, you compare the result with BPSK over AWGN. The results are the same. And the reason is…OFDM doesn’t do anything in AWGN.

    (2)–> However in OFDM over rayleigh(using n tap), you compare the result with BPSK over rayleigh. The results are the same as well.

    2.1 ->But why this time the reason is not “because OFDM doesn’t do anything in rayleigh”. as (1)
    2.2 ->and why the results are the same if OFDM is doing something? and what is OFDM doing? what can you tell from the graph that the result is the same as BPSK over rayleigh?

    Reply
  26. Thank you so much. Everything is clear to me apart from the one below.
    (I really respect you. You are my best teacher. As I told you before, your explanation is the best, simply to understand.Thank you so so much for all the work.)

    Anyway, here is what I am unclear.
    In question one, you seem to explain to me on “Effect of unused subcarriers on Es/N0”. but my question is about “Effect of Cyclic Prefix on Es/N0”. My question is confusing you with the word “sub carrier”. Sorry about that.Could you please re-read my first query again for me with additional information below.

    Reply
  27. 3) OFDM over rayleigh.

    if rayleigh channel has 10 taps

    nTap = 10;
    ht = 1/sqrt(2)*1/sqrt(nTap)*(randn(nSym,nTap) + j*randn(nSym,nTap));

    How can we know that we have to use this term “1/sqrt(2)*1/sqrt(nTap)” to normalise. Is it the theory from the book? where can I find those sources to check what term I should use to normalise channel, noise in matlab.Could you please recommend me the book that contain such information (if it’s from the theory).

    I really don’t understand what number I should use to normalise things in matlab. and why do we need to normalise it.

    ps: I am still looking forward to reading your articles of OFDM over rayleigh+matlab code.

    ———————-
    Also would be useful if you could post the articles about DFT, FFT and something about OFDMA 🙂

    Reply
  28. I have more queries here.
    (1)–> For OFDM over AWGN, you compare the result with BPSK over AWGN. The results are the same. And the reason is…OFDM doesn’t do anything in AWGN.

    (2)–> However in OFDM over rayleigh(using n tap), you compare the result with BPSK over rayleigh. The results are the same as well.

    2.1 ->But why this time the reason is not “because OFDM doesn’t do anything in rayleigh”. as (1)
    2.2 ->and why the results are the same if OFDM is doing something? and what is OFDM doing? what can you tell from the graph that the result is the same as BPSK over rayleigh?

    Reply
  29. from your information on “Effect of Cyclic Prefix on Es/N0”, The bit energy represents the energy contained in the “useful bits”.

    And from equation
    Es(N+Ncp)=N*Eb

    What I meant in my first question is that. Shouldn’t the right term be 52*Eb instead of N*Eb or 64*Eb. because the useful bits are only 52, not 64.

    but if the right term is 64*Eb, that means you consider “added zero” as a useful bit too? why?

    Reply
  30. Thank you so much. Everything is clear to me apart from the one below.
    (I really respect you. You are my best teacher. As I told you before, your explanation is the best, simply to understand.Thank you so so much for all the work.)

    Anyway, here is what I am unclear.
    In question one, you seem to explain to me on “Effect of unused subcarriers on Es/N0”. but my question is about “Effect of Cyclic Prefix on Es/N0”. My question is confusing you with the word “sub carrier”. Sorry about that.Could you please re-read my first query again for me with additional information below.

    Reply
  31. In matlab simulation, why channel h is multiplied by transmitted signal Xt in BPSK over rayleigh –> h*Xt
    but in “OFDM over rayleigh”, channel will be convolved with transmitted signal –> conv(h,Ht)
    why?
    why we don’t do convolution in BPSK over rayleigh too…or may be just do normal multiply in OFDM?


    Convolution in time domain is equivalent to multiplication in frequency domain.

    Following statements are equivalent
    y(t) = h(t)*x(t)
    Y(F) = H(F)X(F)

    Check which method is used in the matlab script and cross verify this duality

    Reply
  32. Lets consider there are 4 subcarriers in our OFDM system. I wish to transmit 12 bits of information 1,0,1,1,0,0,1,1,1,0,0,0
    Converting serial to parallel (fill row by row from left to right)
    C1 C2 C3 C4
    1 0 1 1
    0 0 1 1
    1 0 0 0

    In BPSK system 1-> 1, 0->-1
    So the actual matrix is
    C1 C2 C3 C4
    1 -1 1 1
    -1 -1 1 1
    1 -1 -1 -1

    In carrier 1 we transmit 1,-1,1 (read column-wise)
    In carrier 2 we transmit -1,-1,-1
    In carrier 3 we transmit 1,1,-1
    In carrier 4 we transmit 1,1,-1

    But we cannot transmit the bits as it is. Each carrier has to be operated on some orthogonal frequencies.
    The final output will be the combination (summation) of all these frequencies.

    This is where we use IFFT block. The IFFT block takes each row one by one, assuming them to be at different frequencies and produces the output
    by performing IFFT on each row and converting them to time domain.

    Here 1 OFDM symbol is 4 bits (four carriers). So we transmit 3 OFDM symbols in total

    For QPSK instead of single elements in the matrix we will have double elements
    Example:
    C1 C2 C3 C4
    00 01 11 11
    10 10 00 11
    10 00 11 00

    Here also 1 OFDM symbol has 4 subcarriers but 8 bits in total and 3 such OFDM symbols are transmitted

    Reply
  33. We have 64 sub-carriers but we have Null in some sub-carriers too. So shouldn’t the useful bits be 52 instead of FFT size which is 64? because you had to assign 0 in 12 subcarriers to make it fullfil 64 sub-carriers. So when you consider bit energy, why do you consider those 0 you added to IFFT input too?
    Or you consider the useful bits after IFFT block?

    1) We have 64 subcarriers in total – So 1 OFDM symbol (with BPSK) has 64 bits
    2) Lets call the energy possessed by 1 OFDM symbol be Es
    3) Out of 64 subcarriers only 52 are used (remaining being set to null)
    4) So the ratio of useful subcarriers to total subcarriers is 52/64
    5) Lets call the energy per bit be Eb
    6) 1 OFDM symbol has 52/64 useful information and 12/64 zero information (since the input is zero for these 12 unused subcarriers)
    7) So the OFDM symbol energy is 52/64*Eb

    Reply
  34. In matlab simulation, why channel h is multiplied by transmitted signal Xt in BPSK over rayleigh –> h*Xt
    but in “OFDM over rayleigh”, channel will be convolved with transmitted signal –> conv(h,Ht)

    why?

    why we don’t do convolution in BPSK over rayleigh too…or may be just do normal multiply in OFDM?

    Reply
  35. OK, please find my whole query (from facebook) here.

    1)It’s about “Simulation of OFDM system in Matlab – BER Vs Eb/N0 for OFDM in AWGN channel”

    OK, here is my question. It’s about finding Es/N0.(considering we use BPSK)

    ——-
    CP
    ——

    1)We have 64 sub-carriers but we have Null in some sub-carriers too. So shouldn’t the useful bits be 52 instead of FFT size which is 64? because you had to assign 0 in 12 subcarriers to make it fullfil 64 sub-carriers. So when you consider bit energy, why do you consider those 0 you added to IFFT input too?

    Or you consider the useful bits after IFFT block?

    2) I am confused about OFDM symbol you mentioned.

    The FFT size is 64 (number of used sub-carrier is 52). So it’s gonna be 52*10^4 bits to be transmitted?(in case it’s BPSK)

    Then why number of useful bits to use to calculate Es/N0 is not equal to 52*10^54? but it’s equal to just the number of FFT size?
    is it because we consider only 1 OFDM?

    Please see my example below.
    Assume we transmit 1 2 3 4 5….15
    When we do serial to parallel it’s gonna be

    11 6 1
    12 7 2
    13 8 3
    14 9 4
    15 10 5

    3) First 1,2,3,4,5 will be assigned into IFFT input. Do we consider 1,2,3,4,5 as 1 ofdm symbol. 6,7,8,9,10 as another OFDM symbol? and when we calculate Eb/No we consider only one by one OFDM symbol? not whole information data?

    When you say OFDM symbol (below “Effect of Cyclic Prefix on Es/N0″) do you mean like each OFDM symbol above?
    I am confused with BPSK, 0 is one symbol, 1 is another symbol. Or QPSK has 00 as 1 symbol, 01 as another symbol.

    Reply
  36. Hi, Thank you so much for your reply on the facebook. However you skipped many parts. I mean you didn’t complete it because you forgot to view whole comment.

    In each of my comments in facebook, please also click “See More” below my comments (and above the date and time). Then you will see the whole question. Because facebook will only show a few lines of the comment. you have to click “See More” to view whole message.

    Reply
  37. Hi Mathuranathan,
    Thank you for your reply.

    I posted a question on your facebook because it didn’t show up here. May be it’s too long. could you please reply those questions as well. Thank you.

    Reply
  38. Hi Mathuranathan,
    Thank you for your reply.

    I posted a question on your facebook because it didn’t show up here. May be it’s too long. could you please reply those questions as well. Thank you.

    Reply
  39. Could you please explain what is this term “sqrt((N+Ncp)/N)” in
    r= sqrt((N+Ncp)/N)*ofdm_signal + 10^(-EsN0dB(i)/20)*noise;
    ———————————
    For AWGN
    Y=X+n ; X is transmitted signal
    ———————————
    So why do you need to multiply OFDM signal with something again?
    and why n term is 10^(-EsN0dB(i)/20)*noise

    Why don’t you use “noise” straight away? or you have to convert to dB? Again if you convert to dB, it shouldn’t be this term.

    The term sqrt((N+Ncp)/N) is used for normalization which is used to normalize the energy of OFDM signal with respect to unity It is similar to the term sqrt(1/2) term found in the transmitter equation for BPSK (refer some text book on this part)

    The noise generated by rand function in matlab is zero mean unit variance noise. The purpose of the simulation is to plot Eb/No vs BER, otherwise, plotting BER for various signal to noise ratio. Eb/N0 or Es/N0 is always specified in dB. So we need to convert it from dB to linear scale. Remember that we need to generate noise that gives us required Eb/N0, i.e. need to generate noise with required variance. As mentioned earlier, the noise generated by rand function is zero mean unit variance noise. So it need to be scaled appropriately to give noise with required variance (or equivalently noise power)

    Reply
  40. Can’t we just use
    s=reshape(data,nSym,nBitsPerSym);

    instead of

    s=reshape(data,nBitsPerSym,nSym).’ ;

    doesn’t it do the same?


    reshape(A,m,n) returns the m-by-n matrix where as reshape(A,n,m) returns n-by-m matrix. So the commands are not the same

    Reply
  41. 1) IFFT block: why null at 0, 27-37, any rule about where to do zero padding? why don’t you do null at front 0-5, then in the middle 32, then the end at 59-63?

    There is no hard and fast rule on inserting null or zero padding. But to standardize things, there need to be some uniformity across implementations. IEEE 802.11 standard is one of the standards that is usually followed in industries for WLAN implementation. IEEE 802.11 standard is followed in the post. It specifies the particular way in which the nulls have to be inserted.


    2) Regarding using transpose at reshape. Is this why in IFFT process you have to transpose the data back again? (X_Freq.’) as below

    x_Time=N/sqrt(Nst)*ifft((X_Freq.’)).’;

    If so, why do you do transpose at first? why don’t you just leave the data in the matrix m*n as the beginning? or is it easier do it in that dimension?

    It is just for programming convenience. As long as you understood the code you can use mxn or nxm format for all the matrices in your code.

    Reply
  42. Could you please explain what is this term “sqrt((N+Ncp)/N)” in

    r= sqrt((N+Ncp)/N)*ofdm_signal + 10^(-EsN0dB(i)/20)*noise;

    ———————————
    For AWGN
    Y=X+n ; X is transmitted signal
    ———————————

    So why do you need to multiply OFDM signal with something again?

    and why n term is 10^(-EsN0dB(i)/20)*noise

    Why don’t you use “noise” straight away? or you have to convert to dB? Again if you convert to dB, it shouldn’t be this term.

    Please explain to me. Thank you so much.

    Reply
  43. Could you please explain what is this term “sqrt((N+Ncp)/N)” in

    r= sqrt((N+Ncp)/N)*ofdm_signal + 10^(-EsN0dB(i)/20)*noise;

    ———————————
    For AWGN
    Y=X+n ; X is transmitted signal
    ———————————

    So why do you need to multiply OFDM signal with something again?

    and why n term is 10^(-EsN0dB(i)/20)*noise

    Why don’t you use “noise” straight away? or you have to convert to dB? Again if you convert to dB, it shouldn’t be this term.

    Please explain to me. Thank you so much.

    Reply
  44. OK, here is my question. It’s about Es/N0 again.(considering we use BPSK)

    CP
    Q1)We have 64 sub-carriers but we have Null in some sub-carriers too. So shouldn’t the useful bits be 52 instead of FFT size which is 64? because you had to assign 0 in 12 subcarriers to make it fullfil 64 sub-carriers. So when you consider bit energy, why do you consider those 0 you added to IFFT input too?

    Or you consider the useful bits after IFFT block?

    2) I am confused about OFDM symbol you mentioned.

    The FFT size is 64 (number of used sub-carrier is 52). Number of OFDM symbols is 10^4. Is it per 1 sub-carrier?

    If it’s per 1 carrier so it’s gonna be 52*10^4 bits to be transmitted?(in case it’s BPSK)

    Then why number of useful bits to use to calculate Es/N0 is not equal to 52*10^54? why it’s equal to just the number of FFT size?
    is it because we consider only 1 OFDM?

    Please see my example below.
    Assume we transmit 1 2 3 4 5….15
    When we do serial to parallel it’s gonna be

    11 6 1
    12 7 2
    13 8 3
    14 9 4
    15 10 5

    First 1,2,3,4,5 will be assigned into IFFT input. Do we consider 1,2,3,4,5 as 1 ofdm symbol. 6,7,8,9,10 as another OFDM symbol? and when we calculate Eb/No we consider only one by one OFDM symbol? not whole data information?

    When you say OFDM symbol (below “Effect of Cyclic Prefix on Es/N0”) do you mean like each OFDM symbol above?
    I am confused with BPSK, 0 is one symbol, 1 is another symbol. Or QPSK has 00 as 1 symbol, 01 as another symbol.

    I am sorry for many question. I am just learning so I might ask you really basic question 🙂

    Thank you so much for your reply in advance.

    Reply
  45. From my previous message in second question(2). I forgot to ask you what is “N/sqrt(Nst)” for? I guess it’s to scale the signal to unit? please explain to me what it is for. I original wasn’t clear about “scaling” as well. why do we need it. I see they use a lot in matlab on many simulations. I am a bit confused.

    And please also explain where N/sqrt(Nst) come from. I don’t understand. e.g. to scale “a+bj”, you will divide by sqrt(a^2+b^2). But in this case I don’t really get it why using this term to scale.

    Thank you so much again. I have a few more questions. But please let me organize them how I should ask. Then I will post in the next message 🙂

    Reply
  46. Thank you so much. Very well explanation! 🙂 I understand it now.

    However I am confused about something below. Please again explain to me.

    1) IFFT block: why null at 0, 27-37, any rule about where to do zero padding? why don’t you do null at front 0-5, then in the middle 32, then the end at 59-63?

    2) Regarding using transpose at reshape. Is this why in IFFT process you have to transpose the data back again? (X_Freq.’) as below

    x_Time=N/sqrt(Nst)*ifft((X_Freq.’)).’;

    If so, why do you do transpose at first? why don’t you just leave the data in the matrix m*n as the beginning? or is it easier do it in that dimension?

    Thank you so much again. I will have more questions to ask but will post in the next message 🙂

    Reply
  47. Hi, Can you please explain.

    Equation (3), can you please explain why it’s a product of equation(1) and (2). Shouldn’t it be (1)+(2)? I don’t understand.

    Equation(4), can you please explain how to convert it to dB to be able to get this equation(4). I am confused.

    Thank you so much.

    Es is the symbol energy for one OFDM symbol. The symbol energy is calculated from the contribution of cyclic prefix and unused carriers. The effect of cyclix prefix (1) is in time domain and the effect of unused subcarriers (2) is in frequency domain.

    i.e. In the time domain, the Es is affected by cyclic prefix. In the frequency domain (“Subcarriers” are always discussed in terms of frequency) the Es is affect by unused carriers. So the overall effect on Es is the product of time domain effect and frequency domain effect. (You cannot add (1) and (2) since their effect is on different domain).

    In short,
    Total Symbol energy is not the sum of equation (1) and (2) it is the product of (1) and (2)

    Converting to dB is taking log either side.

    To convert a quantity to dB (if the quantity measured is expressed as Power),
    dB = 10*log10(quantity)—> (A)

    Applying this to equation (3)

    (Es/N0)in dB = 10log10(Es/N0)

    The right hand side becomes
    (Es/N0) in dB = 10 log10(XYZ)
    Where X = (N/(Ncp+N))
    Y = Nst/N
    Z = Eb/N0

    From logarithm rule
    log(XYZ) = log(X) + log(Y) + log(Z)

    So 10log10(XYZ) = 10log10(X)+10log10(Y)+10log10(Z)

    From (A), this can be written as
    10log10(XYZ) = X in dB + Y in dB + Z in dB

    This explains the conversion.

    Reply
  48. You used ” .’ ” in the end of RESHAPE command as well as many others.
    What is this for?

    The .’ operator in matlab is to transpose a matrix. It is used at the end of reshape command to convert a matrix from mxn form to nxm form.

    Reply
  49. Hi, Can you please explain.

    Equation (3), can you please explain why it’s a product of equation(1) and (2). Shouldn’t it be (1)+(2)? I don’t understand.

    Equation(4), can you please explain how to convert it to dB to be able to get this equation(4). I am confused.

    Thank you so much.

    Reply

Post your valuable comments !!!