MATLAB In Digital Signal Processing And Communications

3y ago
45 Views
4 Downloads
415.40 KB
35 Pages
Last View : 25d ago
Last Download : 3m ago
Upload by : Adele Mcdaniel
Transcription

MATLAB in Digital Signal Processing andCommunicationsJan Mietzner(janm@ece.ubc.ca)MATLAB TutorialOctober 15, 2008

Objective and FocusLearn how MATLAB can be used efficiently in order to perform tasks indigital signal processing and digital communicationsLearn something about state-of-the-art digital communications systems andhow to simulate/analyze their performanceFocusWireless multi-carrier transmission system based on OrthogonalFrequency-Division Multiplexing (OFDM) includingIIa simple channel coding scheme for error correctioninterleaving across subcarriers for increased frequency diversityOFDM is extremely popular and is used in e.g.IIIIIIWireless 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 systemsCable broadband access (ADSL/VDSL), power line communicationsJan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20081

Objective and FocusLearn how MATLAB can be used efficiently in order to perform tasks indigital signal processing and digital communicationsLearn something about state-of-the-art digital communications systems andhow to simulate/analyze their performanceFocusWireless multi-carrier transmission system based on OrthogonalFrequency-Division Multiplexing (OFDM) includingIIa simple channel coding scheme for error correctioninterleaving across subcarriers for increased frequency diversityOFDM is extremely popular and is used in e.g.IIIIIIWireless 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 systemsCable broadband access (ADSL/VDSL), power line communicationsJan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20081

Objective and FocusLearn how MATLAB can be used efficiently in order to perform tasks indigital signal processing and digital communicationsLearn something about state-of-the-art digital communications systems andhow to simulate/analyze their performanceFocusWireless multi-carrier transmission system based on OrthogonalFrequency-Division Multiplexing (OFDM) includingIIa simple channel coding scheme for error correctioninterleaving across subcarriers for increased frequency diversityOFDM is extremely popular and is used in e.g.IIIIIIWireless 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 systemsCable broadband access (ADSL/VDSL), power line communicationsJan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20081

System OverviewXUChannel Enc.InterleavingS/PIFFTxTransmitterCPChannel impulseresponse h AWGN nChannelCPReceiveryYÛChannel Dec.DeinterleavingP/SFFTNc : number of orthogonal carriers (Nc : 2n ); corresponds to (I)FFT sizeR: code rate of employed channel code (R : 1/2m 1)U: vector of info symbols (length RNc ), Û: corresponding estimated vectorX: transmitted OFDM symbol (length Nc ), Y: received OFDM symbol We will consider each block in detail, especially their realization in MATLABJan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20082

Info Vector UInfo symbols Uk carry the actual information to be transmitted (e.g., datafiles or digitized voice)Info symbols Uk 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 digitalcommunicationsMATLAB realizationGenerate vector U of length RNc with i.i.d. random entries Uk { 1, 1}U 2*round(rand(1,R*Nc))-1;Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20083

Info Vector UInfo symbols Uk carry the actual information to be transmitted (e.g., datafiles or digitized voice)Info symbols Uk 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 digitalcommunicationsMATLAB realizationGenerate vector U of length RNc with i.i.d. random entries Uk { 1, 1}U 2*round(rand(1,R*Nc))-1;Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20083

Channel EncodingChannel coding adds redundancy to info symbols in a structured fashionRedundancy can then be utilized at receiver to correct transmission errors(channel decoding)For each info symbol Uk the channel encoder computes N code symbolsXk,1 , ., Xk,N according to pre-defined mapping rule Code rate R : 1/NDesign of powerful channel codes is a research discipline on its ownWe focus on simple repetition code of rate R, i.e.,U [ ., Uk , Uk 1 , . ] 7 X [ ., Uk , Uk , ., Uk 1 , Uk 1 , . ]Example: Uk 1, R 1/4, received code symbols 0.9, 1.1, 0.1, 0.5 High probability that Uk 1 can be recoveredMATLAB realizationApply repetition code of rate R to info vector U Vector X of length NcX kron(U,ones(1,1/R));Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20084

Channel EncodingChannel coding adds redundancy to info symbols in a structured fashionRedundancy can then be utilized at receiver to correct transmission errors(channel decoding)For each info symbol Uk the channel encoder computes N code symbolsXk,1 , ., Xk,N according to pre-defined mapping rule Code rate R : 1/NDesign of powerful channel codes is a research discipline on its ownWe focus on simple repetition code of rate R, i.e.,U [ ., Uk , Uk 1 , . ] 7 X [ ., Uk , Uk , ., Uk 1 , Uk 1 , . ]Example: Uk 1, R 1/4, received code symbols 0.9, 1.1, 0.1, 0.5 High probability that Uk 1 can be recoveredMATLAB realizationApply repetition code of rate R to info vector U Vector X of length NcX kron(U,ones(1,1/R));Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20084

Channel EncodingChannel coding adds redundancy to info symbols in a structured fashionRedundancy can then be utilized at receiver to correct transmission errors(channel decoding)For each info symbol Uk the channel encoder computes N code symbolsXk,1 , ., Xk,N according to pre-defined mapping rule Code rate R : 1/NDesign of powerful channel codes is a research discipline on its ownWe focus on simple repetition code of rate R, i.e.,U [ ., Uk , Uk 1 , . ] 7 X [ ., Uk , Uk , ., Uk 1 , Uk 1 , . ]Example: Uk 1, R 1/4, received code symbols 0.9, 1.1, 0.1, 0.5 High probability that Uk 1 can be recoveredMATLAB realizationApply repetition code of rate R to info vector U Vector X of length NcX kron(U,ones(1,1/R));Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20084

InterleavingCode symbols in vector X (length Nc ) will be transmitted in parallel over theNc orthogonal subcarriers (via IFFT operation)Each code symbol ‘sees’ frequency response of underlying channel onparticular subcarrierChannel impulse response (CIR) is typically considered random in wirelesscommunications (see slide ‘Channel Model’)Channel frequency response of neighboring subcarriers usually correlated;correlation between two subcarriers with large spacing typically lowIdea: Spread code symbols Xk,1 , ., Xk,N associated with info symbol Ukacross entire system bandwidth instead of using N subsequent subcarriersWe use maximum distance pattern for interleavingExample: Nc 128 subcarriers, code rate R 1/4 Use subcarriers #k, #(k 32), #(k 64), and #(k 96)for code symbols associated with info symbol Uk (k 1, ., 32)Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20085

InterleavingCode symbols in vector X (length Nc ) will be transmitted in parallel over theNc orthogonal subcarriers (via IFFT operation)Each code symbol ‘sees’ frequency response of underlying channel onparticular subcarrierChannel impulse response (CIR) is typically considered random in wirelesscommunications (see slide ‘Channel Model’)Channel frequency response of neighboring subcarriers usually correlated;correlation between two subcarriers with large spacing typically lowIdea: Spread code symbols Xk,1 , ., Xk,N associated with info symbol Ukacross entire system bandwidth instead of using N subsequent subcarriersWe use maximum distance pattern for interleavingExample: Nc 128 subcarriers, code rate R 1/4 Use subcarriers #k, #(k 32), #(k 64), and #(k 96)for code symbols associated with info symbol Uk (k 1, ., 32)Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20085

InterleavingNo InterleavingWith Interleaving1.81.8Channel Frequency Response (Magnitude)Channel Frequency Response 0.40.2204060Carrier No.801000120204060Carrier No.80100120MATLAB realizationInterleave vector X according to maximum distance pattern(Nc 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 TutorialOctober 15, 20086

OFDM ModulationOFDM symbol X ( ˆ frequency domain) converted to time domain via IFFToperation Vector x (length Nc )Assume CIR h of length Nch To avoid interference between subsequentOFDM symbols, guard interval of length Nch 1 requiredOften cyclic prefix (CP) is used, i.e., last Nch 1 symbols of vector x areappended to x as a prefix Vector of length Nc Nch 1Details can be found inZ. Wang and G. B. Giannakis, “Wireless multicarrier communications –Where Fourier meets Shannon,” IEEE Signal Processing Mag., May 2000.MATLAB realizationPerform IFFT of vector X and add CP of length Nch 1x ifft(X)*sqrt(Nc);x [ x(end-Nch 2:end) x ];Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20087

OFDM ModulationOFDM symbol X ( ˆ frequency domain) converted to time domain via IFFToperation Vector x (length Nc )Assume CIR h of length Nch To avoid interference between subsequentOFDM symbols, guard interval of length Nch 1 requiredOften cyclic prefix (CP) is used, i.e., last Nch 1 symbols of vector x areappended to x as a prefix Vector of length Nc Nch 1Details can be found inZ. Wang and G. B. Giannakis, “Wireless multicarrier communications –Where Fourier meets Shannon,” IEEE Signal Processing Mag., May 2000.MATLAB realizationPerform IFFT of vector X and add CP of length Nch 1x ifft(X)*sqrt(Nc);x [ x(end-Nch 2:end) x ];Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20087

Channel ModelOFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length Nch 1In wireless scenarios channel coefficients h0 , ., hNch 1 considered randomWe consider baseband transmission model, i.e., channel coefficients hl arecomplex-valued (equivalent passband model involves real-valued quantities)In rich-scattering environments, Rayleigh-fading channel model has provenuseful, i.e., channel coefficients hl are complex Gaussian random variables:Re{hl }, Im{hl } N (0, σl2 /2) hl CN (0, σl2 )We assume exponentially decaying channel power profile, i.e.,σl2σ02: exp( l/catt ),l 0, ., Nch 1We assume block-fading model, i.e., CIR h stays constant during entireOFDM symbol and changes randomly from one OFDM symbol to the nextNoiseless received vector given by convolution of vector x with CIR hNoise samples are i.i.d. complex Gaussian random variables CN (0, σn2 )Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20088

Channel ModelOFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length Nch 1In wireless scenarios channel coefficients h0 , ., hNch 1 considered randomWe consider baseband transmission model, i.e., channel coefficients hl arecomplex-valued (equivalent passband model involves real-valued quantities)In rich-scattering environments, Rayleigh-fading channel model has provenuseful, i.e., channel coefficients hl are complex Gaussian random variables:Re{hl }, Im{hl } N (0, σl2 /2) hl CN (0, σl2 )We assume exponentially decaying channel power profile, i.e.,σl2σ02: exp( l/catt ),l 0, ., Nch 1We assume block-fading model, i.e., CIR h stays constant during entireOFDM symbol and changes randomly from one OFDM symbol to the nextNoiseless received vector given by convolution of vector x with CIR hNoise samples are i.i.d. complex Gaussian random variables CN (0, σn2 )Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20088

Channel ModelOFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length Nch 1In wireless scenarios channel coefficients h0 , ., hNch 1 considered randomWe consider baseband transmission model, i.e., channel coefficients hl arecomplex-valued (equivalent passband model involves real-valued quantities)In rich-scattering environments, Rayleigh-fading channel model has provenuseful, i.e., channel coefficients hl are complex Gaussian random variables:Re{hl }, Im{hl } N (0, σl2 /2) hl CN (0, σl2 )We assume exponentially decaying channel power profile, i.e.,σl2σ02: exp( l/catt ),l 0, ., Nch 1We assume block-fading model, i.e., CIR h stays constant during entireOFDM symbol and changes randomly from one OFDM symbol to the nextNoiseless received vector given by convolution of vector x with CIR hNoise samples are i.i.d. complex Gaussian random variables CN (0, σn2 )Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20088

Channel ModelOFDM typically employed for communication systems with large bandwidth Underlying channel is frequency-selective, i.e., CIR h has length Nch 1In wireless scenarios channel coefficients h0 , ., hNch 1 considered randomWe consider baseband transmission model, i.e., channel coefficients hl arecomplex-valued (equivalent passband model involves real-valued quantities)In rich-scattering environments, Rayleigh-fading channel model has provenuseful, i.e., channel coefficients hl are complex Gaussian random variables:Re{hl }, Im{hl } N (0, σl2 /2) hl CN (0, σl2 )We assume exponentially decaying channel power profile, i.e.,σl2σ02: exp( l/catt ),l 0, ., Nch 1We assume block-fading model, i.e., CIR h stays constant during entireOFDM symbol and changes randomly from one OFDM symbol to the nextNoiseless received vector given by convolution of vector x with CIR hNoise samples are i.i.d. complex Gaussian random variables CN (0, σn2 )Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 20088

Channel ModelMATLAB realizationGenerate exponentially decaying channel power profile Variances σl2var ch exp(-[0:Nch-1]/c att);Normalize channel power profile such that overall average channel energy is 1var ch var ch/sum(var ch);Generate random CIR realization with independent complex Gaussian entriesand specified channel power profileh sqrt(0.5)*(randn(1,Nch) j*randn(1,Nch)) .* sqrt(var ch);Calculate noiseless received vector via convolution of vector x with CIR hy conv(x,h);Add additive white Gaussian noise (AWGN) samples with variance σn2n 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 TutorialOctober 15, 20089

Channel ModelMATLAB realizationGenerate exponentially decaying channel power profile Variances σl2var ch exp(-[0:Nch-1]/c att);Normalize channel power profile such that overall average channel energy is 1var ch var ch/sum(var ch);Generate random CIR realization with independent complex Gaussian entriesand specified channel power profileh sqrt(0.5)*(randn(1,Nch) j*randn(1,Nch)) .* sqrt(var ch);Calculate noiseless received vector via convolution of vector x with CIR hy conv(x,h);Add additive white Gaussian noise (AWGN) samples with variance σn2n 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 TutorialOctober 15, 20089

OFDM DemodulationReceived vector resulting from convolution of transmitted vector x withCIR h has length (Nc Nch 1) Nch 1 Received vector is truncated to same length Nc Nch 1 as vector xThen CP is removed to obtain received vector y of length NcFinally, FFT is performed to convert received vector y back to frequencydomain received OFDM symbol Y of length NcMATLAB realizationTruncate vector y by removing last Nch 1 entries, remove CP (first Nch 1entries), and perform FFT to obtain received OFDM symbol Yy(end-Nch 2:end) [];y(1:Nch-1) [];Y fft(y)/sqrt(Nc);Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 200810

OFDM DemodulationReceived vector resulting from convolution of transmitted vector x withCIR h has length (Nc Nch 1) Nch 1 Received vector is truncated to same length Nc Nch 1 as vector xThen CP is removed to obtain received vector y of length NcFinally, FFT is performed to convert received vector y back to frequencydomain received OFDM symbol Y of length NcMATLAB realizationTruncate vector y by removing last Nch 1 entries, remove CP (first Nch 1entries), and perform FFT to obtain received OFDM symbol Yy(end-Nch 2:end) [];y(1:Nch-1) [];Y fft(y)/sqrt(Nc);Jan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 200810

Deinterleaving and Channel DecodingFor coherent detection of the info symbols Uk , the channel phases associatedwith the entries of the received OFDM symbol Y have to be derotated We need to calculate the channel frequency response via FFT of CIR hPerform deinterleaving based on employed interleaver patternIf repetition code is used, all entries of Y that are associated with same infosymbols Uk are optimally combined using maximum ratio combining (MRC)Finally, estimates Ûk are formed based on the RNc output symbols Zmrc,kof the MRC stepIn simulation, determine the number of bit errors in current OFDM symbolby comparing Û with UUpdate error counter and finally determine average bit error rate (BER) bydividing overall number of errors by overall number of transmitted info bitsJan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 200811

Deinterleaving and Channel DecodingFor coherent detection of the info symbols Uk , the channel phases associatedwith the entries of the received OFDM symbol Y have to be derotated We need to calculate the channel frequency response via FFT of CIR hPerform deinterleaving based on employed interleaver patternIf repetition code is used, all entries of Y that are associated with same infosymbols Uk are optimally combined using maximum ratio combining (MRC)Finally, estimates Ûk are formed based on the RNc output symbols Zmrc,kof the MRC stepIn simulation, determine the number of bit errors in current OFDM symbolby comparing Û with UUpdate error counter and finally determine average bit error rate (BER) bydividing overall number of errors by overall number of transmitted info bitsJan Mietzner (janm@ece.ubc.ca)MATLAB TutorialOctober 15, 200811

Deinterleaving and Channel DecodingMATLAB realizationCalculate channel frequency response via FFT of zero-padded CIR hh zp [h zeros(1,Nc-Nch)];H fft(h zp);Derotate channel phases associated with entries of received OFDM symbol YZ conj(H) .* Y;Perform deinterleaving (Nc 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 Zmrc of length RNcZ mrc sum(matrix help,2);Form estimates Ûk based on vector ZmrcUhat sign(real(Z mrc))’;Jan Mietzner (janm@ece.ubc.ca)MA

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

Related Documents:

MATLAB Functionality for Digital Speech Processing MATLAB Speech Processing Code MATLAB GUI Implementations Lecture_3_2013 1. . MATLAB signal array is to be stored - for wavwrite the MATLAB array xoutneeds to be scaled to the range 1 xin 1 whereas for savewav the MATLAB array xoutneeds to be .

most of the digital signal processing concepts have benn well developed for a long time, digital signal processing is still a relatively new methodology. Many digital signal processing concepts were derived from the analog signal processing field, so you will find a lot o f similarities between the digital and analog signal processing.

Digital Signal and Image Processing using MATLAB . Signal processing--Digital techniques--Data processing. 2. MATLAB. I.Charbit, Maurice. II. Title. TK5102.9.B545 2006 621.382'2--dc22 2

MATLAB tutorial . School of Engineering . Brown University . To prepare for HW1, do sections 1-11.6 – you can do the rest later as needed . 1. What is MATLAB 2. Starting MATLAB 3. Basic MATLAB windows 4. Using the MATLAB command window 5. MATLAB help 6. MATLAB ‘Live Scripts’ (for algebra, plotting, calculus, and solving differential .

19 MATLAB Excel Add-in Hadoop MATLAB Compiler Standalone Application MATLAB deployment targets MATLAB Compiler enables sharing MATLAB programs without integration programming MATLAB Compiler SDK provides implementation and platform flexibility for software developers MATLAB Production Server provides the most efficient development path for secure and scalable web and enterprise applications

MATLAB tutorial . School of Engineering . Brown University . To prepare for HW1, do sections 1-11.6 – you can do the rest later as needed . 1. What is MATLAB 2. Starting MATLAB 3. Basic MATLAB windows 4. Using the MATLAB command window 5. MATLAB help 6. MATLAB ‘Live Scripts’ (for

3. MATLAB script files 4. MATLAB arrays 5. MATLAB two‐dimensional and three‐dimensional plots 6. MATLAB used‐defined functions I 7. MATLAB relational operators, conditional statements, and selection structures I 8. MATLAB relational operators, conditional statements, and selection structures II 9. MATLAB loops 10. Summary

– Image Denoising using Wavelets . 4 nd02 Sep Signal Processing with MATLAB Bangalore 5 04th Sep Image Processing with MATLAB Bangalore 6 18th Sep MATLAB to C with MATLAB Coder Bangalore 7 13th Nov Generating HDL Code from Simulink Bangalore . CONFIDENTIAL 25