Wireless Transmission Using Orthogonal Frequency Division Multiplexing

download Wireless Transmission Using Orthogonal Frequency Division Multiplexing

of 14

Transcript of Wireless Transmission Using Orthogonal Frequency Division Multiplexing

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    1/14

    - 1 -

    Wireless Communication usingOrthogonal Frequency DivisionMultiplexing

    ------------------------------------------------------MATLAB Simulation of the Transmitter, Communication

    Channel and Receiver of an OFDM System

    ------------------------------------------------------

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    2/14

    - 2 -

    Wireless Communication usingOrthogonal Frequency Division

    Multiplexing----------------------------------------------------------------------------------------------MATLAB Simulation of the Transmitter, Communication

    Channel and Receiver of an OFDM System----------------------------------------------------------------------------------------------

    There are presently many well known multiplexing techniques in

    wireless communications FDM, TDM, and CDM. But these have various limitations

    such as low bit rate capacity, less spectral efficiency, multi-path fading and inter-

    symbol interference (ISI). ISI occurs when a transmission interferes with itself due to

    reflection of the signal from large objects such as mountains or buildings and thus the

    receiver sees more than one copy of the signal and cannot decode the transmission

    correctly. Since the indirect paths take more time to travel to the receiver, the

    delayed and attenuated copies of the signal interfere with the primary signal; causing

    ISI. The use of Orthogonal Frequency Division Multiplexing provides better solutions

    to the above mentioned problems. OFDM is a multi-carrier modulation technique

    which distributes the data over large number of carriers that are mathematically

    orthogonal. The orthogonality of the carriers prevents the demodulator from seeing

    frequencies other than their own.

    In this paper, we have simulated the transmitter, communication

    channel and the receiver using the OFDM principle through MATLAB. It clearlyshows that OFDM greatly reduces the bit-error rate as compared to other

    conventional modulation techniques. We have used BPSK and QPSK modulation

    schemes and demonstrated that OFDM system with BPSK scheme is suitable for low

    capacity, short distance applications while OFDM with QPSK for large capacity and

    long distance applications. With the rapid growth of digital communication in recent

    years, the need for high-speed data transmission has increased. OFDM is especially

    suitable for high-speed communication as it sends many low speed transmissions

    simultaneously. The benefits of OFDM are high spectral efficiency, resiliency to RF

    interference and low multi-path distortion. The use of FFT technique to implement

    modulation and demodulation function makes it computationally more efficient. Theprocessing power of modern digital signal processors has increased to a point where

    OFDM has become feasible and economical. Examining the patents, journal articles,

    and books available on OFDM, it is clear that this technique will have an impact on

    the future of communication.

    ----------------------------------------------------------------------------------------------

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    3/14

    - 3 -

    Orthogonal Frequency Division Multiplexing

    Orthogonal Frequency Division Multiplexing is a special case of

    Frequency Division Multiplexing where we use multi-carrier modulation and thecarriers taken are orthogonal. OFDM allows the transmission of high data rates over

    extremely hostile channels. OFDM distributes the available bandwidth among a large

    number of narrow band sub-carriers that are mathematically orthogonal. This

    orthogonality property ensures compact spectral utilization and at the same time

    prevents inter-channel interference (ICI). Frequency selective fading occurs when

    particular frequencies are either enhanced or attenuated due to the channel frequency

    response. In conventional single carrier modulation the whole symbol is affected but

    in OFDM which is a multi-carrier modulation technique only particular sub-carrier

    symbols are lost.

    Another advantageous feature of an OFDM system relates to its ease of

    implementation. This refers to the fact that modulation can be performed digitally by

    IDFT which can be implemented very efficiently as an Inverse Fast Fourier

    Transform (IFFT). So, the entire modulation is done by the IFFT Block and this

    reduces the need of multiple carrier generators. Obviously, the FFT Block fills in for

    the corresponding demodulator at the receiver end.

    Significance of Orthogonality

    The concept of orthogonality allows the carriers to be distinguished

    from each other at the receiver. The sub-carriers are chosen in such a way that the

    sidebands of the individual carriers can overlap as long as there is no cross-talk from

    the other sub-channels at the critical frequency of each sub-carrier. By using an IFFT

    for modulation we implicitly choose the spacing of the sub-carriers in such a way that

    at the frequency where we evaluate the received signal, all other signals are zero.

    There are many advantages of the orthogonal selection of the sub-carriers:

    Proper utilization of the spectrum and thus reduced bandwidth requirement.

    Reduction in inter-channel interference (ICI). The IFFT/FFT implementation can be done in hardware at affordable rates.

    Hence it reduces the overall cost.

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    4/14

    - 4 -

    OFDM Signal Generation

    Transmitter

    Random Data Generator It accepts any source of data and outputs bits in theform of 1s and -1s. The source could be a text file, a sound file or a stream of

    random numbers.

    Serial to Parallel Converter It takes in the serial stream of bipolar bits andoutputs the data distributing it among a number of channels.

    IFFT BlockThis block generates the time domain signal as per the spectrumsupplied to its input. This block performs the necessary modulation and

    ensures that the sub-carriers are orthogonal.

    Parallel to Serial Converter It produces a serial stream of the OFDM signalfrom the parallel chunks.

    Guard Interval Addition BlockThis block adds a guard space between eachsymbol. The first half of the guard interval is zero-padded and the other half is

    the cyclic extension of the end part of the corresponding symbol. Thus the

    output is the OFDM signal which is ready to be transmitted.

    Communication Channel

    Noise We have assumed an AWGN channel. Multipath We have considered the effects of frequency selective fading and

    inter-symbol interference (ISI). Clipping Due to high PAPR, we clip the amplitude to simulate the problem

    of amplifier saturation.

    Receiver

    Guard Interval Removal Block - This removes the guard space betweenadjacent symbols from the received OFDM signal.

    Serial to Parallel Converter This block again distributes the signal intoparallel streams to be inputted to the FFT Block.

    FFT BlockThis block acts as the demodulator in the receiver end. It takes inthe parallel chunks of the received signal and generates the spectrum

    accordingly, which in turn was the input we had supplied to the IFFT block.

    Parallel to Serial Converter This block takes in the parallel chunks of theoutput of the FFT block and outputs the serial stream of bipolar bits.

    Source File Interpreter - This block interprets the serially received bits andrecovers the source file.

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    5/14

    - 5 -

    Working Model

    OFDM Signal Generation Simulation Parameters

    Parameters/

    Specifications

    Values/

    Types

    Modulation Schemes used BPSK and QPSK

    Number of Carriers used 32

    IFFT/FFT Size 128

    Guard Interval Size 32

    Guard Interval

    Type

    The first half of the guard interval is zero-padded

    and the other half is the cyclic extension of the end

    part of the corresponding symbol

    OFDM Frame Size 128

    Channel Noise AWGN

    Other Channel Attributes

    Considered in

    Simulation

    InterSymbol Interference,

    Frequency Selective Fading,

    Clipping Effects

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    6/14

    - 6 -

    Significance of IFFT/FFT Implementation

    The transmitter first converts the input data from a serial stream to parallel sets. Each

    set of data contains one symbol, S i, for each sub-carrier. For example, a set of four data

    would be [S0

    S1

    S2

    S3

    ]. Before performing the Inverse Fast Fourier Transform (IFFT),this example data set is arranged on the horizontal axis in the frequency domain as

    shown in following figure:

    Frequency domain distribution of symbols

    This symmetrical arrangement about the vertical axis is necessary for

    using the IFFT to manipulate this data. An inverse Fourier transform converts the

    frequency domain data set into samples of the corresponding time domain

    representation of this data. Specifically, the IFFT is useful for OFDM because it

    generates samples of a waveform with frequency components satisfying orthogonality

    conditions. Then, the parallel to serial block creates the OFDM signal by sequentially

    outputting the time domain samples.

    Since OFDM is a multi-carrier modulation (MCM) technique, we need

    to have a mechanism to economically generate a large number of sub-carriers and at

    the same time we have to maintain the condition that they must be orthogonal. Using

    conventional methods, we would need a bank of sinusoidal generators of precise

    orthogonal frequencies. At the same time, at the receiver end, we would need amechanism for coherent carrier generation for each sub-channel. Since the number of

    carriers is large, this would be quite expensive.

    The IFFT/FFT block pairs remove this difficulty as they ensure that

    only orthogonal carriers are used in modulation. In our design, the essence of OFDM

    being purely orthogonal relies on an environment of digital manipulation. Through

    IFFT, our digital sequence is converted to analog transmission, and the spacing

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    7/14

    - 7 -

    between carriers equals the inverse of the time duration of the transmitted symbols,

    causing the carriers to be orthogonal. Similar is the case with FFT; the only difference

    is that it will give us back the original digital sequence from the analog received

    signal.

    Guard Interval Addition

    The addition of an extra guard interval greatly reduces the effects due

    to inter-symbol interference (ISI). The guard interval is added in such a way that the

    starting part of the symbol is well protected from the delay spread zone produced due

    to ISI. So we start the symbol from a new point so that actual symbol will be safe from

    this zone. But this occurs at the expense of increase in the increased bandwidth

    requirement.

    Generally, we take the guard interval duration as about 25% of the

    original symbol duration. So, after the addition of guard interval, the new length ofthe symbol becomes 5/4 times the original.

    Channel Characteristics

    Noise

    The noise present in the channel is assumed to be white and having a Gaussian

    distribution. Hence, we use the AWGN (Additive White Gaussian Noise) channel.

    Multipath

    Due to the signals getting reflected by obstructions, the receiver sees delayed andattenuated signals along with the original signal. Hence, it is not able to correctly

    decode the message properly. We have considered two delayed versions of the

    signal of different path gains.

    Clipping

    Clipping simulates the problem of amplifier saturation in the channel. In OFDM

    signal there is a high Peak-to-Average Power Ratio (PAPR). Due to the sudden rise in

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    8/14

    - 8 -

    amplitude at the peak value of the OFDM signal, there is an increase in the in -band

    noise and this increases the BER when the signal has to go through amplifier non-

    linearity. Thus, the signal is clipped to a fixed clip value if it exceeds the threshold.

    Comparison of the efficiencies of BPSK and QPSK

    In our simulation, we have used two modulation schemesBPSK and

    QPSK. We have chosen Phase Shift Keying because it produces constant amplitude

    signals and we face fewer problems with amplitude fluctuations caused by fading.

    Plots of BER vs SNR for QPSK and BPSKThe plot shows higher BER for QPSK than BPSK at any value of SNR

    Thus, we see that at any value of SNR, the bit-error rate for QPSK modulation

    scheme is higher than that of BPSK scheme. But at the same time we should

    remember that BPSK modulates 1-bit at a time, while QPSK 2-bits at a time. So QPSK

    has higher data carrying capacity than BPSK. Hence we conclude that:

    The OFDM system with BPSK scheme is suitable for low capacity and shortdistance applications.

    The OFDM system with QPSK scheme is useful for large capacity and longdistance applications at the cost of slight increase in the bit-error rate.

    Spectrum of OFDM Signal

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    9/14

    - 9 -

    Now let us view the spectrum of an OFDM signal by taking Fast

    Fourier Transform. We can clearly see the 32 sub-carriers central frequencies. At

    each frequencys peak, we see that there is no cross-talk from the other sub-carriers.

    Thus we observe that the carriers produced by the IFFT block are indeed orthogonal.

    Spectrum of the OFDM signalThe peaks represent the central frequencies of the 32 carriers used

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    10/14

    - 10 -

    Practical Applications of OFDM

    OFDM is used in:

    Digital Audio & Video Broadcasting [DAB and DVB] in Europe.

    Asymmetric Digital Subscriber Line [ADSL] modems. HDTV Broadcasting. Cellular Radio. Wireless Networking Standard IEEE 802.11a.

    Conclusion

    In this paper, we have simulated all the necessary parts of an OFDM system.We have used BPSK and QPSK modulation schemes and compared their

    working efficiencies. We have also shown how OFDM is more effective than

    other contemporary techniques such as 16-QAM in channels where multi-path and noise prevail.

    Examining the patents, journal articles, and books available on OFDM, it isclear that this technique will have an impact on the future of communication.

    References

    OFDM and MC-CDMA for Broadband Multi-User CommunicationsL Hanzo, M Munster, BJ Choi, T Keller.

    IETE Technical Review

    Volume 23

    No. 3, 2006SB Pokle and KD Kulat

    Digital CommunicationsSimon Haykin

    Digital Signal Processing: A Computer-Based ApproachSanjit K Mitra

    Contemporary Communication Systems Using MatlabJohn G Proakis and M Salehi

    Wireless CommunicationsTheodore Rappaport

    OFDM versus Single Carrier with Cyclic Prefix: A System-Based comparisonJan Tubbax, Boris Come, Liesbet Van der Perre, Luc Deneire, Marc Engels

    MATLAB 6.5 Software Modeling tool for CommunicationM/s Mathworks Inc., USA.

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    11/14

    - 11 -

    MATLAB Code------------------------------------------------------------------------------------------------------------%Developed by AMIT KUMAR and SRIRAM BHATTARU%under the guidance of Prof. G.Panda%Head of Department of ECE%NIT Rourkela

    % setupdisp(' '), disp('------------------------------------------------------------')disp('Simulation Setup')

    fft_size = 128 % should be a power of 2 for fast computation% more points = more time domain samples (smoother & more cycles)

    num_carriers = 32 % should be it does not get copied over y-axisspaced_chunks(i,fft_size:-1:fft_size/2+2) = conj(spaced_chunks(i,2:fft_size/2));

    end

    % perform ifft to create time domain waveform representing datatd_sets = zeros(num_chunks,fft_size);for i = 1:num_chunks

    td_sets(i,1:fft_size) = real(ifft(spaced_chunks(i,1:fft_size)));end

    % Construct signal to transmit by placing time domain sets in seriesxmit = zeros(1,num_chunks*fft_size);

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    12/14

    - 12 -

    for i = 1:num_chunksfor k = 1:fft_size

    xmit(k + (i-1)*fft_size) = td_sets(i,k);end

    end

    % simulating channel-----------------------------ch%completed---------------------------------------

    disp('Receiving')

    % rx_chunk

    % break received signal into parellel sets for demodulationrecv_td_sets = zeros(num_chunks,fft_size);for i = 1:num_chunks

    for k = 1:fft_sizerecv_td_sets(i,k) = recv(k + (i-1)*fft_size);

    endend

    % perform fft to recover original data from time domain setsrecv_spaced_chunks = zeros(num_chunks,fft_size);for i = 1:num_chunks

    recv_spaced_chunks(i,1:fft_size) = fft(recv_td_sets(i,1:fft_size));end

    % rx_dechunk

    % take out zeros_between from recv_spaced_chunks --> recv_chunksrecv_chunks = zeros(num_chunks, num_carriers);i = 1;for k = zeros_between +1:zeros_between +1:fft_size/2

    recv_chunks(1:num_chunks,i) = recv_spaced_chunks(1:num_chunks,k);i = i+1;

    end

    % Recover bit stream by placing reconstructed frequency domain data in seriesrecv_dechunked = zeros(1, num_chunks*num_carriers);for i = 1:num_chunks

    for k = 1:num_carriersrecv_dechunked(k + (i-1)*num_carriers*2) = real(recv_chunks(i,k));recv_dechunked(k + (i-1)*num_carriers*2 + num_carriers) = imag(recv_chunks(i,k));

    endend

    % take out trailing zeros from output --> outputoutput_analog = recv_dechunked(1:data_length);output = sign(output_analog);output = pol2bin(output);

    output_samples_big = zeros(1,floor(length(output)/8)); %extra zeros are not original datafor i = 1:length(output_samples_big)

    output_samples_big(i) = bin2eight(output(1 + (i-1)*8:(i-1)*8 + 8));end%convert dynamic range from 0:255 to -1:1output_samples = (output_samples_big-127)/128;%sound file outputwavwrite(output_samples, 11025, 8, 'OFDM_out.wav')

    % Analysis

    disp(' '), disp('------------------------------------------------------------')disp('Preparing Analysis')

    figure(1), clfsubplot(221), plot(data_samples), title('OFDM Symbol Input Data');subplot(223), plot(output_samples), title('OFDM Recovered Symbols');

    subplot(222), plot(xmit), title('Transmitted OFDM');subplot(224), plot(recv), title('Received OFDM');

    dig_x_axis = (1:length(xmit))/length(xmit);figure(2), clf

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    13/14

    - 13 -

    num = [1, zeros(1, d1-1), a1, zeros(1, d2-d1-1), a2];den = [1];[H, W] = freqz(num, den, 512);mag = 20*log10(abs(H));phase = angle(H) * 180/pi;

    subplot(313)freq_data = abs(fft(recv));L = length(freq_data)/2;plot(dig_x_axis(1:L), freq_data(1:L))xlabel('FFT of Received OFDM')axis_temp = axis;

    subplot(311),freq_data = abs(fft(xmit));plot(dig_x_axis(1:L), freq_data(1:L)), axis(axis_temp)title('FFT of Transmitted OFDM')

    subplot(312)plot(W/(2*pi),mag),ylabel('Channel Magnitude Response')

    figure(3), clfsubplot(211);

    plot(W/(2*pi),mag);title('Channel Magnitude Response');

    xlabel('Digital Frequency');ylabel('Magnitude in dB');

    subplot(212);

    plot(W/(2*pi),phase);title('Channel Phase Response');

    xlabel('Digital Frequency');ylabel('Phase in Degrees');

    binary_err_bits_OFDM = 0;for i = 1:length(data_in)

    err = abs(data_in(i)-output(i));if err > 0

    binary_err_bits_OFDM = binary_err_bits_OFDM +1;end

    endBER_OFDM = 100 * binary_err_bits_OFDM/data_length;

    disp(strcat('OFDM: BER=', num2str(BER_OFDM,3), ' %'))

    disp(strcat(' Number of error bits=', num2str(binary_err_bits_OFDM)))

    % Listen to soundsdo_again = '1';while ( ~(isempty(do_again)) )

    disp(' ')disp('Press any key to hear the original sound'), pausesound(data_samples,11025)disp('Press any key to hear the sound after OFDM transmission'), pausesound(output_samples,11025)do_again = '';do_again = input('Enter "1" to hear the sounds again or press "Return" to end ',

    's');end

    -----------------------------------------------------------------------------------------------------

    ch.m

    disp('Simulating Channel'),disp('--------------------------------------------------------------')recv = xmit; % channel is applied to recv, don't modify transmitted data

    norm_factor = max(abs(recv)); % Normalize all data before applyingrecv = (1/norm_factor) * recv; % channel for a fair comparison

    % ch_clippingclip_level = 1;for i = 1:length(recv)

  • 8/2/2019 Wireless Transmission Using Orthogonal Frequency Division Multiplexing

    14/14

    - 14 -

    if recv(i) > clip_levelrecv(i) = clip_level;

    endif recv(i) < -clip_level

    recv(i) = -clip_level;end

    end

    % ch_multipatha1 = 0.3;a2 = 0.25;d1 = 6;d2 = 10;copy1=zeros(size(recv));for i=1+d1:length(recv)

    copy1(i)=a1*recv(i-d1);end

    copy2=zeros(size(recv));for i=1+d2:length(recv)

    copy2(i)=a2*recv(i-d2);end

    recv=recv+copy1+copy2;

    % channel noise

    % noise_level = 0.1;% noise = (rand(1,length(recv))-0.5)*2*noise_level;

    % recv = recv + noise;

    recv = awgn(recv,300);

    recv = norm_factor * recv;

    -----------------------------------------------------------------------------------------

    bin2pol.m

    function y = bin2pol(x)

    % bin2pol%% Converts binary numbers (0,1) to polar numbers (-1,1)% Accepts a 1-D array of binary numbers

    y = ones(1,length(x));for i = 1:length(x)

    if x(i) == 0y(i) = -1;

    endend

    pol2bin.m

    function y = pol2bin(x)

    % pol2bin%% Converts polar numbers (-1,1) to binary numbers (0,1)% Accepts a 1-D array of polar numbers% Removes trailing zeros, since they are not valid data

    % % Remove zeros - not needed with intelligent decoding% last_data=length(x);% while x(last_data) == 0

    % last_data = last_data - 1;% end

    y = ones(1,length(x));for i = 1:length(x)

    if x(i) == -1y(i) = 0;

    endend

    ------------------------------------------------------------------------------------------------------