Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
39 views

Matlab Exercises (Round I) : ELEC-E7210 - Communications Theory Comnet - Aalto University

The document describes Matlab exercises for a communications theory course. Problem 1a involves simulating a QPSK system over an AWGN channel and calculating and comparing theoretical and simulated bit and symbol error rates. Problem 1b adds Rayleigh fading to the channel and tests diversity techniques, simulating a SIMO system using maximal ratio combining. Key steps include generating symbols, passing through random Rayleigh channels, maximal ratio combining at the receiver, and comparing error rates to theory. Problem 1c involves a MISO system using Alamouti space-time coding.

Uploaded by

Farrah Vauzia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Matlab Exercises (Round I) : ELEC-E7210 - Communications Theory Comnet - Aalto University

The document describes Matlab exercises for a communications theory course. Problem 1a involves simulating a QPSK system over an AWGN channel and calculating and comparing theoretical and simulated bit and symbol error rates. Problem 1b adds Rayleigh fading to the channel and tests diversity techniques, simulating a SIMO system using maximal ratio combining. Key steps include generating symbols, passing through random Rayleigh channels, maximal ratio combining at the receiver, and comparing error rates to theory. Problem 1c involves a MISO system using Alamouti space-time coding.

Uploaded by

Farrah Vauzia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Matlab Exercises [round I]

ELEC-E7210 - Communications Theory


Comnet - Aalto University

1
Summary of problems 1a, 1b and 1c. Block diagram of link simulator

Transmitter Channel Receiver


Compare symbols
Symbols SER
(I = I_hat) ?
Uniform RNG
Compare bits BER
I Link level
simulator:
Gray-encode Symbol / bits Gray-decoder
symbols in the channel. I_hat
S Channel S_hat
BER
X Y
Symbol mapping . Detector
SNR

Problems: Problem 1a
AWGN AWGN SISO

Problem 1b
Rayleigh SISO
Rayleigh SIMO - Diversity MRC
Rayleigh

Problem 1c (second ML tutorial)


Rayleigh MISO - Alamouti STC
2
Rayleigh
Problem 1a QPSK - BER/SER Simulation - AWGN - SISO

-Perform a Monte Carlo simulation to estimate the eror rate


performance of a SISO communication system using QPSK
symbol mapping with AWG noise channel.

- Calculate bit and symbol error ratios.


- Plot the theoretical SER and BER curves as function of the SNR.
- Plot the simulated SER and BER curves as function of the SNR.
- Introduce a rotation in the channel and equalize the received
symbols.

3
Problem 1a Block diagram of simulator

Compare symbols
Symbols SER
(I = I_hat) ?
Uniform RNG
Compare bits BER
vtI

Gray-encode
Gray-decoder
symbols vtI_hat
vtS Channel vtS_hat
BER
vtX vtY
Symbol mapping + Detector
SNR

Problem 1a
AWGN AWGN SISO

RNG: Random Number Generator


SISO: Single Input – Single Output
SER: Symbol Error Ratio
BER: Bit Error Ratio
4
Problem 1a – Settings QPSK, Theoretical BER/SER

Transmitted average energy per bit:

Eav _ s Eav _ s
Eav _ bit = = M =4
log 2 M 2
SNR bit:

Eb Eav _ bit Eav _ s E E E


SNRbit = = = = = →σ =
No N0 2 N 0 2 ⋅ 2σ 2
4σ 2 4 SNRbit
Theoretical Bit Error Probability for BPSK = QPSK

(
Pb = Q 2 SNRbit )
Approximation of Theoretical Symbol Error Probability for M >= 4

 π 
Ps = 2 ⋅ Q 2 SNRbit ⋅ sin 
 M 5
Problem 1a – Matlab exercise

-Download the file from the course web page and open with an editor
-Set PROBLEM = PROBLEM_A; and sNummSymbols = 10; (easier to visualize variables)

STEP 1 : Transform SNR [dB] to SNR [abs]


STEP 2 : Generate N random symbols with an uniform distribution (values from 0 to 3)
STEP 3: Gray-encode symbols, use bin2gray()
STEP 4: Introduce a rotation in the channel
STEP 5: Generate AWGN
STEP 6: Equalize the channel
STEP 7: De-map QPSK by using pskdemod()
STEP 8: Plot using the code in the file. Increment the number of symbols (sNummSymbols = 3000;)
Observe:
- symbol error probabilities and compare to theoretical results
- bit error probabilities and compare to theoretical results
- The symbols rotated
- The symbols rotated + noise
- The symbols after the equalizer
6
Symbol/Bit error probabilities. QPSK
0
10

-1
10

-2
10

Bit/Symbol Error Probability


-3
10

-4
10

SER theoretical - AWGN SISO


BER theoretical - AWGN SISO
-5
10 SER simulation - AWGN Num.Rx: 1 SISO
BER simulation - AWGN Num.Rx: 1 SISO

-6
10
0 1 2 3 4 5 6 7 8 9 10

Eb/No

7
Problem 1b Rayleigh fading - SIMO -Diversity

• Introduce a flat fading Rayleigh channel to the previous problem.


• Consider the cases:
• SISO
• SIMO with Maximal Ratio Combining (MRC) Diversity
• NR receive antennas
• Assume that the channel is know at the receiver

- Calculate bit and symbol error ratios.


- Plot the theoretical SER and BER curves as function of the SNR.
- Plot the simulated SER and BER curves as function of the SNR.

• Flat fading Rayleigh channel


• Convolution in the channel is simplified to a simple multiplication
• Each transmitted symbol gets multiplied by a randomly varying complex channel gain
• The real and imaginary parts are Gaussian distributed
• The channel experience by each receive antenna is independent from the
channel experienced by other receive antennas

8
Problem 1b Diversity

9
Problem 1b Block diagram with diversity representation

Symbols
Uniform RNG
vtI

Gray-encode
Gray-decoder
symbols vtI_hat
vtS Channel vtS_hat

vtX vtY
Symbol mapping . Detector
↓ ↓ ↓ Diversity representation ↓ ↓ ↓
vtY
x channel 1
h1
+ receiver 1

n1 mY

x channel 2
h2
+ receiver 2 combiner

n1 MRC: NR branches
x channel NR combined by in a
hNR
+ receiver NR weighted sum
Rayleigh
channels 10
nNR
Problem 1b Block diagram of simulator

Compare symbols
Symbols SER
(I = I_hat) ?
Uniform RNG
Compare bits BER
vtI

Gray-encode
Gray-decoder
symbols vtI_hat
vtS Channel vtS_hat
BER
vtX vtY
Symbol mapping . Detector
SNR

Problem 1a
AWGN AWGN SISO

Problem 1b
Rayleigh SISO
Rayleigh SIMO - Diversity MRC
Rayleigh

SISO: Single Input – Single Output The figure shows 3 antennas as an example.
SIMO: Single Input – Multiple Output Simulation with NR antennas is possible. We will
MRC: Maximal Ratio Combining use 1, 2 and 4 receiver antennas in the exercise.
11
Problem 1b – Matlab exercise

- Set PROBLEM = PROBLEM_B;

STEP 1 : Execute the simulation with one receive antenna


Keep the plot open

STEP 2 : Execute the simulation with two receive antenna


Keep the plot open

STEP 3 : Execute the simulation with four receive antenna


Copy and paste the curves obtained in the previous steps in one
plot, refresh the labels, and compare the improvement in
performance attained by increasing the number of antennas

STEP 4 : Reduce the number of symbols to a low number,


for example 10 symbols.
sNummSymbols = 10;
Set a breakpoint in the MRC combiner, observe the state
of the vectors and function of the combiner as indicated by the assistant.

12
Problem 1b – Program output (for different number of Rx antennas)

Symbol/Bit error probabilities. QPSK


0
10

-1
10

-2
10
Bit/Symbol Error Probability

-3
10

SER theoretical - AWGN SISO


BER theoretical - AWGN SISO
-4
10 SER simulation - AWGN Num.Rx: 1 SISO
BER simulation - AWGN Num.Rx: 1 SISO

BER simulation - Rayleigh Num.Rx: 1 SISO


SER simulation - Rayleigh Num.Rx: 1 SISO
-5 BER simulation - Rayleigh Num.Rx: 2 SIMO - Diversity MRC
10
SER simulation - Rayleigh Num.Rx: 2 SIMO - Diversity MRC
BER simulation - Rayleigh Num.Rx: 4 SIMO - Diversity MRC
SER simulation - Rayleigh Num.Rx: 4 SIMO - Diversity MRC

-6
10
0 1 2 3 4 5 6 7 8 9 10

Eb/No 13
Problem 2 – Equalization

 Simulate a communications system, with a multipath channel,


implemented with a Tapped Delay Line (TDL).
 Equalize the received symbols with MMSE and ZF equalizers using a
transversal filter.
 Observe performance for different number of taps in the equalization
filter.

14
Problem 2 – Multi-path Channel Modeling

• Let f(t) be defined as the composite equivalent low-pass impulse response


consisting of the transmitter pulse shape, channel, and matched filter impulse
responses:

• Then the matched filter output is given by

15
Problem 2 – Multi-path Channel Modeling

Past symbols

Convolution

ISI 16
Problem 2 – 3 Taps TDL

Past 2 symbols Impulse response of the channel

Amplitude
y[n] =d n f [0] + d n −1 f [1] + d n − 2 f [2] + v[n]

Cases
considered case1:[ f [0], f [1], f [2]] = [1, 0.75, 0.25 ] Ts
in the
problem case 2 :[ f [0], f [1], f [2]] = [1, 0.75e j 2πϕ1 , 0.25e j 2πϕ2 ]

Using Toeplitz matrix:=


y Hx + n
 d −1 
 
 y1   f2 f1 f0 0 0 0 0   d 0   n1 
 y 2  
   0 f2 f1 f0 0 0 0   d1   n 2 
 
 y3   0 0 f2 f1 f0 =0 0   d 2  +  n3  , Nr 5
     
 y 4  0 0 0 f2 f1 f 0 0   d3   n4 
   
 y5   0 0 0 0 f2 f 1 f 0   d 4   n5 
d 
 5 17
Problem 2 – Equalization using a transversal filter

w-2 w-1 w0 w1 w2

18
Problem 2 – ZF - MMSE

===========================
% Zero forcing filter
===========================
FiltZF = H(:,D)'*inv(H*H');

============================
% MMSE filter
============================
FiltMMSE = H(:,D)'*inv(H*H'+N0*eye(Nr));

19
Problem 2 – Simulator structure

Initial settings Source bits Symbol


and calculations generator mapping
Transmitted inf. bits
Channel
Noise and convolution

Equalization
hard bits

BLER Received bits Symbol


Hard detection
calculation storage demapping

Comparing
BER
Bits in error

MMSE Equalization by using conv() → STAT_BERmmse1


Equalization MMSE Equalization by linear algebra → STAT_BERmmse2
ZF Equalization by using conv() → BERzf
20
Problem 2 – Matlab functions

 Toeplitz matrix
T = toeplitz(c,r)

 Convolution
w = conv(u,v)
conv example

>> a = 1:10
a =
1 2 3 4 5 6 7 8 9 10

>> b = [2 10]
b =
2 10

>> conv(a,b)
ans =
2 14 26 38 50 62 74 86 98 110 100

>> 21
Problem 2 – Tasks

 Understand the implementation of the channel model and equalizer (explained in class).
 MMSE and ZF are already implemented in the code
 Compare performance for different number of taps in the equalization filter:
 Nr=5;
 Nr=11;
 Nr=19;
 Select different symbol mapping options
 SYMBOL_MAPPING = MBPSK;
 SYMBOL_MAPPING = MQPSK;
 Use the proposed Tapped Delay Line impulse responses
 TDL = [1, 3/4, 1/4 ];
 TDL = [1, 3/4*exp(2*pi*i*rand(1)), 1/4*exp(2*pi*i*rand(1))];

22
Problem 2 – Program output example

23

You might also like