MATLAB in Digital Signal Processing and Communications

Similar documents
ADVANCED APPLICATIONS OF ELECTRICAL ENGINEERING

A Performance Study of Wireless Broadband Access (WiMAX)

4 Digital Video Signal According to ITU-BT.R.601 (CCIR 601) 43

INTER CARRIER INTERFERENCE CANCELLATION IN HIGH SPEED OFDM SYSTEM Y. Naveena *1, K. Upendra Chowdary 2

SC-FDMA for 3GPP LTE uplink. Hong-Jik Kim, Ph. D.

PHASE ESTIMATION ALGORITHM FOR FREQUENCY HOPPED BINARY PSK AND DPSK WAVEFORMS WITH SMALL NUMBER OF REFERENCE SYMBOLS

18-759: Wireless Networks Lecture 18: Cellular. Overview

Capacity Limits of MIMO Channels

Efficient Data Recovery scheme in PTS-Based OFDM systems with MATRIX Formulation


PAPR and Bandwidth Analysis of SISO-OFDM/WOFDM and MIMO OFDM/WOFDM (Wimax) for Multi-Path Fading Channels

Module: Digital Communications. Experiment 784. DSL Transmission. Institut für Nachrichtentechnik E-8 Technische Universität Hamburg-Harburg

Digital Modulation. David Tipper. Department of Information Science and Telecommunications University of Pittsburgh. Typical Communication System

Optimum Frequency-Domain Partial Response Encoding in OFDM System

Time and Frequency Domain Equalization

Non-Data Aided Carrier Offset Compensation for SDR Implementation

ISI Mitigation in Image Data for Wireless Wideband Communications Receivers using Adjustment of Estimated Flat Fading Errors

An Investigation into Time-Domain Approach for OFDM Channel Estimation

What s The Difference Between Bit Rate And Baud Rate?

SC-FDMA and LTE Uplink Physical Layer Design

NAVAL POSTGRADUATE SCHOOL THESIS

Noise Power and SNR Estimation for OFDM Based Wireless Communication Systems

ISDB-T Digital terrestrial broadcasting in Japan

MIMO detector algorithms and their implementations for LTE/LTE-A

ISDB-T T Transmission Technologies and Emergency Warning System

Lezione 6 Communications Blockset

Evaluating channel estimation methods for p systems. Master of Science Thesis in Communication Engineering MATTIAS HERMANSSON VIKTOR SKODA

5 Capacity of wireless channels

Multihopping for OFDM based Wireless Networks

VDSL2 A feasible Solution for Last Mile

Implementation of Digital Signal Processing: Some Background on GFSK Modulation

MODULATION Systems (part 1)

Objectives. Lecture 4. How do computers communicate? How do computers communicate? Local asynchronous communication. How do computers communicate?

RADIO FREQUENCY INTERFERENCE AND CAPACITY REDUCTION IN DSL

Teaching Convolutional Coding using MATLAB in Communication Systems Course. Abstract

AN INTRODUCTION TO DIGITAL MODULATION

Coding and decoding with convolutional codes. The Viterbi Algor

Transmission of Voice Signal: BER Performance Analysis of Different FEC Schemes Based OFDM System over Various Channels

OFDM, Mobile Software Development Framework

Hot Issues in Wireless Broadband Networking

LTE UE RF measurements An introduction and overview

Mobile Communications TCS 455

CNR Requirements for DVB-T2 Fixed Reception Based on Field Trial Results

EECC694 - Shaaban. Transmission Channel

istock.com / alengo Broadcast and media Focus

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

DVB-T2 in relation to the DVB-x2 Family of Standards

IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 55, NO. 1, JANUARY

Log-Likelihood Ratio-based Relay Selection Algorithm in Wireless Network

Seminar. Ausgewählte Kapitel der Nachrichtentechnik, WS 2009/2010. LTE: Der Mobilfunk der Zukunft. Random Access. Almamy Touray. 02.

Exercise 2 Common Fundamentals: Multiple Access

Performance of Multicast MISO-OFDM Systems

Appendix C GSM System and Modulation Description

Chapter 6: Broadcast Systems. Mobile Communications. Unidirectional distribution systems DVB DAB. High-speed Internet. architecture Container

Keysight Technologies DVB-T and DVB-T2 Receiver Test Challenges. Application Note

Lecture 1: Introduction

Two-slot Channel Estimation for Analog Network Coding Based on OFDM in a Frequency-selective Fading Channel

MIMO: What shall we do with all these degrees of freedom?

CODED SOQPSK-TG USING THE SOFT OUTPUT VITERBI ALGORITHM

Principles of Digital Communication

ATSC 3.0 Mobile Support. Luke Fay

PAPR Reduction for 3FPP LTE OFDMA System

LTE Uplink Transmission Scheme

EFFECTIVE CHANNEL STATE INFORMATION (CSI) FEEDBACK FOR MIMO SYSTEMS IN WIRELESS BROADBAND COMMUNICATIONS

MIMO Antenna Systems in WinProp

How PLL Performances Affect Wireless Systems

Introduction to Wireless Communications and Networks

DVB-T BER MEASUREMENTS IN THE PRESENCE OF ADJACENT CHANNEL AND CO-CHANNEL ANALOGUE TELEVISION INTERFERENCE

Multiuser Communications in Wireless Networks

Mobile Digital TV (DVB-H/SH) and 2 nd Generation DVB Systems (DVB-S2/C2/T2)

DVB-T. The echo performance of. receivers. Theory of echo tolerance. Ranulph Poole BBC Research and Development

INTRODUCTION TO COMMUNICATION SYSTEMS AND TRANSMISSION MEDIA

Sampling Theorem Notes. Recall: That a time sampled signal is like taking a snap shot or picture of signal periodically.

Improved Algorithm for Throughput Maximization in MC-CDMA

TABLE OF CONTENTS. Dedication. Table of Contents. Preface. Overview of Wireless Networks. vii xvii

Image Compression through DCT and Huffman Coding Technique

ADVANCED ALGORITHMS FOR EQUALIZATION ON ADSL CHANNEL

QAM Demodulation. Performance Conclusion. o o o o o. (Nyquist shaping, Clock & Carrier Recovery, AGC, Adaptive Equaliser) o o. Wireless Communications

Hardware Implementation for Error Correction Using Software-Defined Radio Platform

Chapter 1 Introduction

4 Cellular systems: multiple access

A Novel LTE-Advanced Carrier Aggregation with Higher Throughput

Michael Kornfeld and Ulrich Reimers Institute for Communications Technology, Technische Universität Braunschweig

Digital Video Broadcasting By Satellite

5 Signal Design for Bandlimited Channels

XDSL TECHNIQUES FOR POWER LINE COMMUNICATIONS

Wireless Broadband with /WiMax: Current Performance and Future Potential

LTE System Specifications and their Impact on RF & Base Band Circuits. Application Note. Products: R&S FSW R&S SMU R&S SFU R&S FSV R&S SMJ R&S FSUP

BENEFITS OF USING MULTIPLE PLP IN DVB-T2

Two Way Relaying Communications with OFDM and BICM/BICM-ID

DOCSIS 3.1: WHAT IS IT, HOW DOES IT WORK, AND HOW CAN YOU PREPARE FOR IT? Daniel Howard, SCTE CTO July 16, 2013

Transcription:

MATLAB in Digital Signal Processing and Communications Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008

Objective and Focus Focus Learn how MATLAB can be used efficiently in order to perform tasks in digital signal processing and digital communications Learn something about state-of-the-art digital communications systems and how to simulate/analyze their performance Wireless multi-carrier transmission system based on Orthogonal Frequency-Division Multiplexing (OFDM) including a simple channel coding scheme for error correction interleaving across subcarriers for increased frequency diversity OFDM is extremely popular and is used in e.g. Wireless LAN air interfaces (Wi-Fi standard IEEE 802.11a/b/g, HIPERLAN/2) Fixed broadband wireless access systems (WiMAX standard IEEE 802.16d/e) Wireless Personal Area Networks (WiMedia UWB standard, Bluetooth) Digital radio and digital TV systems (DAB, DRM, DVB-T, DVB-H) Long-term evolution (LTE) of third-generation (3G) cellular systems Cable broadband access (ADSL/VDSL), power line communications Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 1

Objective and Focus Focus Learn how MATLAB can be used efficiently in order to perform tasks in digital signal processing and digital communications Learn something about state-of-the-art digital communications systems and how to simulate/analyze their performance Wireless multi-carrier transmission system based on Orthogonal Frequency-Division Multiplexing (OFDM) including a simple channel coding scheme for error correction interleaving across subcarriers for increased frequency diversity OFDM is extremely popular and is used in e.g. Wireless LAN air interfaces (Wi-Fi standard IEEE 802.11a/b/g, HIPERLAN/2) Fixed broadband wireless access systems (WiMAX standard IEEE 802.16d/e) Wireless Personal Area Networks (WiMedia UWB standard, Bluetooth) Digital radio and digital TV systems (DAB, DRM, DVB-T, DVB-H) Long-term evolution (LTE) of third-generation (3G) cellular systems Cable broadband access (ADSL/VDSL), power line communications Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 1

Objective and Focus Focus Learn how MATLAB can be used efficiently in order to perform tasks in digital signal processing and digital communications Learn something about state-of-the-art digital communications systems and how to simulate/analyze their performance Wireless multi-carrier transmission system based on Orthogonal Frequency-Division Multiplexing (OFDM) including a simple channel coding scheme for error correction interleaving across subcarriers for increased frequency diversity OFDM is extremely popular and is used in e.g. Wireless LAN air interfaces (Wi-Fi standard IEEE 802.11a/b/g, HIPERLAN/2) Fixed broadband wireless access systems (WiMAX standard IEEE 802.16d/e) Wireless Personal Area Networks (WiMedia UWB standard, Bluetooth) Digital radio and digital TV systems (DAB, DRM, DVB-T, DVB-H) Long-term evolution (LTE) of third-generation (3G) cellular systems Cable broadband access (ADSL/VDSL), power line communications Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 1

System Overview U Channel Enc. Transmitter Interleaving S/P X IFFT x CP Channel impulse response h + AWGN n Channel CP Û Receiver Channel Dec. Deinterleaving P/S Y FFT y N c : number of orthogonal carriers (N c := 2 n ); corresponds to (I)FFT size R: code rate of employed channel code (R := 1/2 m 1) U: vector of info symbols (length RN c ), Û: corresponding estimated vector X: transmitted OFDM symbol (length N c ), Y: received OFDM symbol We will consider each block in detail, especially their realization in MATLAB Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 2

Info Vector U Info symbols U k carry the actual information to be transmitted (e.g., data files or digitized voice) Info symbols U k typically regarded as independent and identically distributed (i.i.d.) random variables with realizations, e.g., in {0, 1} (equiprobable) We use antipodal representation { 1, +1} of bits as common in digital communications MATLAB realization Generate vector U of length RN c with i.i.d. random entries U k { 1, +1} U = 2*round(rand(1,R*Nc))-1; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 3

Info Vector U Info symbols U k carry the actual information to be transmitted (e.g., data files or digitized voice) Info symbols U k typically regarded as independent and identically distributed (i.i.d.) random variables with realizations, e.g., in {0, 1} (equiprobable) We use antipodal representation { 1, +1} of bits as common in digital communications MATLAB realization Generate vector U of length RN c with i.i.d. random entries U k { 1, +1} U = 2*round(rand(1,R*Nc))-1; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 3

Channel Encoding Channel coding adds redundancy to info symbols in a structured fashion Redundancy can then be utilized at receiver to correct transmission errors (channel decoding) For each info symbol U k the channel encoder computes N code symbols X k,1,..., X k,n according to pre-defined mapping rule Code rate R := 1/N Design of powerful channel codes is a research discipline on its own We focus on simple repetition code of rate R, i.e., U = [..., U k, U k+1,... ] X = [..., U k, U k,..., U k+1, U k+1,... ] Example: U k = +1, R = 1/4, received code symbols +0.9, +1.1, 0.1, +0.5 High probability that U k = +1 can be recovered MATLAB realization Apply repetition code of rate R to info vector U Vector X of length N c X = kron(u,ones(1,1/r)); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 4

Channel Encoding Channel coding adds redundancy to info symbols in a structured fashion Redundancy can then be utilized at receiver to correct transmission errors (channel decoding) For each info symbol U k the channel encoder computes N code symbols X k,1,..., X k,n according to pre-defined mapping rule Code rate R := 1/N Design of powerful channel codes is a research discipline on its own We focus on simple repetition code of rate R, i.e., U = [..., U k, U k+1,... ] X = [..., U k, U k,..., U k+1, U k+1,... ] Example: U k = +1, R = 1/4, received code symbols +0.9, +1.1, 0.1, +0.5 High probability that U k = +1 can be recovered MATLAB realization Apply repetition code of rate R to info vector U Vector X of length N c X = kron(u,ones(1,1/r)); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 4

Channel Encoding Channel coding adds redundancy to info symbols in a structured fashion Redundancy can then be utilized at receiver to correct transmission errors (channel decoding) For each info symbol U k the channel encoder computes N code symbols X k,1,..., X k,n according to pre-defined mapping rule Code rate R := 1/N Design of powerful channel codes is a research discipline on its own We focus on simple repetition code of rate R, i.e., U = [..., U k, U k+1,... ] X = [..., U k, U k,..., U k+1, U k+1,... ] Example: U k = +1, R = 1/4, received code symbols +0.9, +1.1, 0.1, +0.5 High probability that U k = +1 can be recovered MATLAB realization Apply repetition code of rate R to info vector U Vector X of length N c X = kron(u,ones(1,1/r)); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 4

Interleaving Code symbols in vector X (length N c ) will be transmitted in parallel over the N c orthogonal subcarriers (via IFFT operation) Each code symbol sees frequency response of underlying channel on particular subcarrier Channel impulse response (CIR) is typically considered random in wireless communications (see slide Channel Model ) Channel frequency response of neighboring subcarriers usually correlated; correlation between two subcarriers with large spacing typically low Idea: Spread code symbols X k,1,..., X k,n associated with info symbol U k across entire system bandwidth instead of using N subsequent subcarriers We use maximum distance pattern for interleaving Example: N c = 128 subcarriers, code rate R = 1/4 Use subcarriers #k, #(k+32), #(k+64), and #(k+96) for code symbols associated with info symbol U k (k = 1,..., 32) Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 5

Interleaving Code symbols in vector X (length N c ) will be transmitted in parallel over the N c orthogonal subcarriers (via IFFT operation) Each code symbol sees frequency response of underlying channel on particular subcarrier Channel impulse response (CIR) is typically considered random in wireless communications (see slide Channel Model ) Channel frequency response of neighboring subcarriers usually correlated; correlation between two subcarriers with large spacing typically low Idea: Spread code symbols X k,1,..., X k,n associated with info symbol U k across entire system bandwidth instead of using N subsequent subcarriers We use maximum distance pattern for interleaving Example: N c = 128 subcarriers, code rate R = 1/4 Use subcarriers #k, #(k+32), #(k+64), and #(k+96) for code symbols associated with info symbol U k (k = 1,..., 32) Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 5

Interleaving No Interleaving With Interleaving 1.8 1.6 1.8 Channel Frequency Response (Magnitude) 1.4 1.2 1 0.8 0.6 0.4 Channel Frequency Response (Magnitude) 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0.2 0 20 40 60 80 100 120 Carrier No. 0 20 40 60 80 100 120 Carrier No. MATLAB realization Interleave vector X according to maximum distance pattern (N c =128, R=1/4) index = [ 1 33 65 97 2 34 66 98... 32 64 96 128 ]; X(index) = X; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 6

OFDM Modulation OFDM symbol X ( ˆ= frequency domain) converted to time domain via IFFT operation Vector x (length N c ) Assume CIR h of length N ch To avoid interference between subsequent OFDM symbols, guard interval of length N ch 1 required Often cyclic prefix (CP) is used, i.e., last N ch 1 symbols of vector x are appended to x as a prefix Vector of length N c + N ch 1 Details can be found in Z. Wang and G. B. Giannakis, Wireless multicarrier communications Where Fourier meets Shannon, IEEE Signal Processing Mag., May 2000. MATLAB realization Perform IFFT of vector X and add CP of length N ch 1 x = ifft(x)*sqrt(nc); x = [ x(end-nch+2:end) x ]; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 7

OFDM Modulation OFDM symbol X ( ˆ= frequency domain) converted to time domain via IFFT operation Vector x (length N c ) Assume CIR h of length N ch To avoid interference between subsequent OFDM symbols, guard interval of length N ch 1 required Often cyclic prefix (CP) is used, i.e., last N ch 1 symbols of vector x are appended to x as a prefix Vector of length N c + N ch 1 Details can be found in Z. Wang and G. B. Giannakis, Wireless multicarrier communications Where Fourier meets Shannon, IEEE Signal Processing Mag., May 2000. MATLAB realization Perform IFFT of vector X and add CP of length N ch 1 x = ifft(x)*sqrt(nc); x = [ x(end-nch+2:end) x ]; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 7

Channel Model OFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length N ch >1 In wireless scenarios channel coefficients h 0,..., h Nch 1 considered random We consider baseband transmission model, i.e., channel coefficients h l are complex-valued (equivalent passband model involves real-valued quantities) In rich-scattering environments, Rayleigh-fading channel model has proven useful, i.e., channel coefficients h l are complex Gaussian random variables: Re{h l }, Im{h l } N (0, σ 2 l /2) h l CN (0, σ 2 l ) We assume exponentially decaying channel power profile, i.e., σ 2 l σ 2 0 := exp( l/c att ), l = 0,.., N ch 1 We assume block-fading model, i.e., CIR h stays constant during entire OFDM symbol and changes randomly from one OFDM symbol to the next Noiseless received vector given by convolution of vector x with CIR h Noise samples are i.i.d. complex Gaussian random variables CN (0, σ 2 n) Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 8

Channel Model OFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length N ch >1 In wireless scenarios channel coefficients h 0,..., h Nch 1 considered random We consider baseband transmission model, i.e., channel coefficients h l are complex-valued (equivalent passband model involves real-valued quantities) In rich-scattering environments, Rayleigh-fading channel model has proven useful, i.e., channel coefficients h l are complex Gaussian random variables: Re{h l }, Im{h l } N (0, σ 2 l /2) h l CN (0, σ 2 l ) We assume exponentially decaying channel power profile, i.e., σ 2 l σ 2 0 := exp( l/c att ), l = 0,.., N ch 1 We assume block-fading model, i.e., CIR h stays constant during entire OFDM symbol and changes randomly from one OFDM symbol to the next Noiseless received vector given by convolution of vector x with CIR h Noise samples are i.i.d. complex Gaussian random variables CN (0, σ 2 n) Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 8

Channel Model OFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length N ch >1 In wireless scenarios channel coefficients h 0,..., h Nch 1 considered random We consider baseband transmission model, i.e., channel coefficients h l are complex-valued (equivalent passband model involves real-valued quantities) In rich-scattering environments, Rayleigh-fading channel model has proven useful, i.e., channel coefficients h l are complex Gaussian random variables: Re{h l }, Im{h l } N (0, σ 2 l /2) h l CN (0, σ 2 l ) We assume exponentially decaying channel power profile, i.e., σ 2 l σ 2 0 := exp( l/c att ), l = 0,.., N ch 1 We assume block-fading model, i.e., CIR h stays constant during entire OFDM symbol and changes randomly from one OFDM symbol to the next Noiseless received vector given by convolution of vector x with CIR h Noise samples are i.i.d. complex Gaussian random variables CN (0, σ 2 n) Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 8

Channel Model OFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length N ch >1 In wireless scenarios channel coefficients h 0,..., h Nch 1 considered random We consider baseband transmission model, i.e., channel coefficients h l are complex-valued (equivalent passband model involves real-valued quantities) In rich-scattering environments, Rayleigh-fading channel model has proven useful, i.e., channel coefficients h l are complex Gaussian random variables: Re{h l }, Im{h l } N (0, σ 2 l /2) h l CN (0, σ 2 l ) We assume exponentially decaying channel power profile, i.e., σ 2 l σ 2 0 := exp( l/c att ), l = 0,.., N ch 1 We assume block-fading model, i.e., CIR h stays constant during entire OFDM symbol and changes randomly from one OFDM symbol to the next Noiseless received vector given by convolution of vector x with CIR h Noise samples are i.i.d. complex Gaussian random variables CN (0, σ 2 n) Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 8

Channel Model MATLAB realization Generate exponentially decaying channel power profile Variances σ 2 l var ch = exp(-[0:nch-1]/c att); Normalize channel power profile such that overall average channel energy is 1 var ch = var ch/sum(var ch); Generate random CIR realization with independent complex Gaussian entries and specified channel power profile h = sqrt(0.5)*(randn(1,nch)+j*randn(1,nch)).* sqrt(var ch); Calculate noiseless received vector via convolution of vector x with CIR h y = conv(x,h); Add additive white Gaussian noise (AWGN) samples with variance σ 2 n n = sqrt(0.5)*( randn(1,length(y))+j*randn(1,length(y)) ); y = y + n * sqrt(sigma2 n); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 9

Channel Model MATLAB realization Generate exponentially decaying channel power profile Variances σ 2 l var ch = exp(-[0:nch-1]/c att); Normalize channel power profile such that overall average channel energy is 1 var ch = var ch/sum(var ch); Generate random CIR realization with independent complex Gaussian entries and specified channel power profile h = sqrt(0.5)*(randn(1,nch)+j*randn(1,nch)).* sqrt(var ch); Calculate noiseless received vector via convolution of vector x with CIR h y = conv(x,h); Add additive white Gaussian noise (AWGN) samples with variance σ 2 n n = sqrt(0.5)*( randn(1,length(y))+j*randn(1,length(y)) ); y = y + n * sqrt(sigma2 n); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 9

OFDM Demodulation Received vector resulting from convolution of transmitted vector x with CIR h has length (N c +N ch 1)+N ch 1 Received vector is truncated to same length N c +N ch 1 as vector x Then CP is removed to obtain received vector y of length N c Finally, FFT is performed to convert received vector y back to frequency domain received OFDM symbol Y of length N c MATLAB realization Truncate vector y by removing last N ch 1 entries, remove CP (first N ch 1 entries), and perform FFT to obtain received OFDM symbol Y y(end-nch+2:end) = []; y(1:nch-1) = []; Y = fft(y)/sqrt(nc); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 10

OFDM Demodulation Received vector resulting from convolution of transmitted vector x with CIR h has length (N c +N ch 1)+N ch 1 Received vector is truncated to same length N c +N ch 1 as vector x Then CP is removed to obtain received vector y of length N c Finally, FFT is performed to convert received vector y back to frequency domain received OFDM symbol Y of length N c MATLAB realization Truncate vector y by removing last N ch 1 entries, remove CP (first N ch 1 entries), and perform FFT to obtain received OFDM symbol Y y(end-nch+2:end) = []; y(1:nch-1) = []; Y = fft(y)/sqrt(nc); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 10

Deinterleaving and Channel Decoding For coherent detection of the info symbols U k, the channel phases associated with the entries of the received OFDM symbol Y have to be derotated We need to calculate the channel frequency response via FFT of CIR h Perform deinterleaving based on employed interleaver pattern If repetition code is used, all entries of Y that are associated with same info symbols U k are optimally combined using maximum ratio combining (MRC) Finally, estimates Ûk are formed based on the RN c output symbols Z mrc,k of the MRC step In simulation, determine the number of bit errors in current OFDM symbol by comparing Û with U Update error counter and finally determine average bit error rate (BER) by dividing overall number of errors by overall number of transmitted info bits Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 11

Deinterleaving and Channel Decoding For coherent detection of the info symbols U k, the channel phases associated with the entries of the received OFDM symbol Y have to be derotated We need to calculate the channel frequency response via FFT of CIR h Perform deinterleaving based on employed interleaver pattern If repetition code is used, all entries of Y that are associated with same info symbols U k are optimally combined using maximum ratio combining (MRC) Finally, estimates Ûk are formed based on the RN c output symbols Z mrc,k of the MRC step In simulation, determine the number of bit errors in current OFDM symbol by comparing Û with U Update error counter and finally determine average bit error rate (BER) by dividing overall number of errors by overall number of transmitted info bits Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 11

Deinterleaving and Channel Decoding MATLAB realization Calculate channel frequency response via FFT of zero-padded CIR h h zp = [h zeros(1,nc-nch)]; H = fft(h zp); Derotate channel phases associated with entries of received OFDM symbol Y Z = conj(h).* Y; Perform deinterleaving (N c =128, R=1/4) index matrix = [ 1 33 65 97 ; 2 34 66 98 ;... 32 64 96 128 ]; matrix help = Z(index matrix); Perform MRC Vector Z mrc of length RN c Z mrc = sum(matrix help,2); Form estimates Ûk based on vector Z mrc Uhat = sign(real(z mrc)) ; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 12

Deinterleaving and Channel Decoding MATLAB realization Calculate channel frequency response via FFT of zero-padded CIR h h zp = [h zeros(1,nc-nch)]; H = fft(h zp); Derotate channel phases associated with entries of received OFDM symbol Y Z = conj(h).* Y; Perform deinterleaving (N c =128, R=1/4) index matrix = [ 1 33 65 97 ; 2 34 66 98 ;... 32 64 96 128 ]; matrix help = Z(index matrix); Perform MRC Vector Z mrc of length RN c Z mrc = sum(matrix help,2); Form estimates Ûk based on vector Z mrc Uhat = sign(real(z mrc)) ; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 12

Deinterleaving and Channel Decoding MATLAB realization Calculate channel frequency response via FFT of zero-padded CIR h h zp = [h zeros(1,nc-nch)]; H = fft(h zp); Derotate channel phases associated with entries of received OFDM symbol Y Z = conj(h).* Y; Perform deinterleaving (N c =128, R=1/4) index matrix = [ 1 33 65 97 ; 2 34 66 98 ;... 32 64 96 128 ]; matrix help = Z(index matrix); Perform MRC Vector Z mrc of length RN c Z mrc = sum(matrix help,2); Form estimates Ûk based on vector Z mrc Uhat = sign(real(z mrc)) ; Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 12

Deinterleaving and Channel Decoding MATLAB realization (cont d) Count bit errors in current OFDM symbol and update error counter err count = err count + sum(abs(uhat-u))/2; After transmission of N real OFDM symbols calculate final BER ber = err count/(r*nc*nreal); Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 13

Simulation Results 10 0 Simulation Rayleigh fading (L=1, theory) Rayleigh fading (L=2, theory) Rayleigh fading (L=4, theory) Uncoded transmission N real =10, 000 OFDM symbols N c =128 subcarriers N ch =10 channel coefficients c att =2 for channel profile BER 10 1 10 2 10 3 10 4 0 2 4 6 8 10 12 14 16 18 20 2 1/σ n in db Comparison with analytical results for L = 1 Rayleigh fading branch (see Appendix) validates simulated BER curve Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 14

Simulation Results Repetition code (rate 1/2) No interleaving N real =10, 000 OFDM symbols N c =128 subcarriers N ch =10 channel coefficients c att =2 for channel profile BER 10 0 10 1 10 2 10 3 Simulation Rayleigh fading (L=1, theory) Rayleigh fading (L=2, theory) Rayleigh fading (L=4, theory) 10 4 0 2 4 6 8 10 12 14 16 18 20 2 1/σ n in db Repetition code yields significant gain, mostly due to increased received power per info bit; hardly any diversity gain as no interleaver is used Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 15

Simulation Results Repetition code (rate 1/2) With interleaving N real =10, 000 OFDM symbols N c =128 subcarriers N ch =10 channel coefficients c att =2 for channel profile BER 10 0 10 1 10 2 10 3 Simulation Rayleigh fading (L=1, theory) Rayleigh fading (L=2, theory) Rayleigh fading (L=4, theory) 10 4 0 2 4 6 8 10 12 14 16 18 20 2 1/σ n in db Comparison with analytical results for diversity reception over L = 2 i.i.d. Rayleigh fading branches (see Appendix) validates simulated BER curve Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 15

Simulation Results Repetition code (rate 1/4) No interleaving N real =10, 000 OFDM symbols N c =128 subcarriers N ch =10 channel coefficients c att =2 for channel profile BER 10 0 10 1 10 2 10 3 Simulation Rayleigh fading (L=1, theory) Rayleigh fading (L=2, theory) Rayleigh fading (L=4, theory) 10 4 0 2 4 6 8 10 12 14 16 18 20 2 1/σ n in db Repetition code yields significant gain, mostly due to increased received power per info bit; slight diversity gain visible even without interleaver Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 16

Simulation Results Repetition code (rate 1/4) With interleaving N real =10, 000 OFDM symbols N c =128 subcarriers N ch =10 channel coefficients c att =2 for channel profile BER 10 0 10 1 10 2 10 3 Simulation Rayleigh fading (L=1, theory) Rayleigh fading (L=2, theory) Rayleigh fading (L=4, theory) 10 4 0 2 4 6 8 10 12 14 16 18 20 2 1/σ n in db Comparison with analytical results for diversity reception over L = 4 i.i.d. Rayleigh fading branches shows that channel does not quite offer diversity order of 4 Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 16

Appendix Analytical results Analytical BER performance of binary antipodal transmission over L 1 i.i.d. Rayleigh fading branches with MRC at receiver was calculated according to ( ) L P b = 1 L 1 1 ( ) ( ) l L 1 + l 1 1 2 L 1 1 + σn 2 l 2 l 1 + 1 + σn 2 l=0 using MATLAB function proakis equalsnrs.m Details can be found in Chapter 14 of J. G. Proakis, Digital Communications, 4th ed., McGraw-Hill, 2001. MATLAB code The MATLAB code and these slides can be downloaded from my homepage (see Teaching ) www.ece.ubc.ca/ janm/ Jan Mietzner (janm@ece.ubc.ca) MATLAB Tutorial October 15, 2008 17