13.07.2015 Views

Praise for Fundamentals of WiMAX

Praise for Fundamentals of WiMAX

Praise for Fundamentals of WiMAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

144 Chapter 4 • Orthogonal Frequency Division Multiplexing4.7 Simulating OFDM SystemsIn this section, we provide some resources <strong>for</strong> getting started on simulating an OFDM system.The popular LabVIEW simulation package from National Instruments can be used to developvirtual instruments (VI’s) that implement OFDM in a graphical user interface. See also [1].Other communication system building blocks and multicarrier modulation tools are available inthe National Instruments Modulation Toolkit.OFDM functions can also be developed in Matlab. 6 Here, we provide Matlab code <strong>for</strong> abaseband OFDM transmitter and receiver <strong>for</strong> QPSK symbols. These functions can be modifiedto transmit and receive M-QAM symbols or passband—complex baseband—signals.function x=OFDMTx(N, bits, num, nu)%==========================================================% x=OFDMTx( N, bits, num, nu,zero_tones)%% APSK transmitter <strong>for</strong> OFDM%% N is the FFT size% bits is a {1,-1} stream <strong>of</strong> length (N/2-1)*2*num (baseband, zero DC)% num is the number <strong>of</strong> OFDM symbols to produce% nu is the cyclic prefix length%==========================================================if length(bits) ~= (N/2-1)*2*numerror('bits vector <strong>of</strong> improper length -- Aborting');end x=[];real_index = -1; %initial valuesimag_index = 0;<strong>for</strong> a=1:numreal_index = max(real_index)+2:2:max(real_index)+N-1;imag_index = max(imag_index)+2:2:max(imag_index)+N-1;X = (bits(real_index) + j*bits(imag_index))/2;X=[0 X 0]; % zero nyquist and DCx_hold=sqrt(N)*ifft([X,conj(fliplr(X(2:length(X)-1)))]); %Baseband so symmeteicx_hold=[x_hold(length(x_hold)-nu+1:length(x_hold)),x_hold]; %Add CPx=[x,x_hold];endx=real(x);function bits_out = OFDMRx(N,y,h,num_symbols,nu)%=========================================================% bits_out = OFDMRx(M,N,y,num_symbols,nu,zero_tones)%% N is the FFT size% y is received channel output <strong>for</strong> all symbols (excess delay spread removed)% h is the (estimated) channel impulse response6. These functions also can be used in MathScript <strong>for</strong> LabVIEW.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!