Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 57

M AT LA B S im u lat io n

Fr e que nc y Div er s i ty : W ide - B and S i gna ls

Simulation of Wireless Communication


Systems using MATLAB

Dr. B.-P. Paris


Dept. Electrical and Comp. Engineering
George Mason University

Fall 2007

P a r is E CE 73 2 1
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Outline

MATLAB Simulation

Frequency Diversity: Wide-Band Signals

P a r is E CE 73 2 2
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

MATLAB Simulation

Objective: Simulate a simple communication system and


estimate bit error rate.
System Characteristics:
BPSK modulation, b { 1, - 1 } with equal a priori
probabilities,
Raised cosine pulses,
AWGN channel,
oversampled integrate-and-dump receiver front-end,
digital matched filter.
Measure: Bit-error rate as a function of E s /N 0
and
oversampling rate.

P a r is E CE 73 2 3
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

System to be Simulated

Sampler,
N (t )
rate f s

bn s (t ) R (t ) R [n ] to
× p( t ) × h( t ) + Ts
(t )
DSP

d ( t - nT ) A

Figure: Baseband Equivalent System to be Simulated.

P a r is E CE 73 2 4
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

From Continuous to Discrete Time

The system in the preceding diagram cannot be simulated


immediately.
Main problem: Most of the signals are continuous-time
signals and cannot be represented in MATLAB.
Possible Remedies:
1. Rely on Sampling Theorem and work with sampled
versions of signals.
2. Consider discrete-time equivalent system.
The second alternative is preferred and will be pursued
below.

P a r is E CE 73 2 5
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Towards the Discrete-Time Equivalent System

The shaded portion of the system has a discrete-time input


and a discrete-time output.
Can be considered as a discrete-time system.
Minor problem: input and output operate at different rates.

Sampler,
N (t )
rate f s

bn s (t ) R (t ) R [n ]
to
× p( t ) × h( t ) + Ts
(t )
DSP

d ( t - nT ) A

P a r is E CE 73 2 6
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Discrete-Time Equivalent System


The discrete-time equivalent system
is equivalent to the original system, and
contains only discrete-time signals and components.
Input signal is up-sampled by factor f s
T to make input and
output rates equal.
Insert f s T - 1 zeros between input samples.

N [n ]

bn R [n ]
× fs T h [n ] + to DSP

P a r is E CE 73 2 7
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Components of Discrete-Time Equivalent System

Question: What is the relationship between the


components of the original and discrete-time equivalent
system?

Sampler,
N (t )
rate f s

bn s (t ) R (t ) R [n ]
to
× p( t ) × h( t ) + Ts
(t )
DSP

d ( t - nT ) A

P a r is E CE 73 2 8
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Discrete-time Equivalent Impulse Response


To determine the impulse response h [n ] of the
discrete-time equivalent system:
Set noise signal N t to zero,
set input signal b n to unit impulse signal d [n ],
output signal is impulse response h [ ]
n .
Procedure yields:

1 ( n + 1 ) Ts
h [n ] = p ( t ) * h ( t ) dt
Ts nT s

For high sampling rates (f s


T 1), the impulse response is
closely approximated by sampling p (t ) * h (t ) :

h [n ] ˜ p ( t ) * h ( t )| ( n + 1 ) T
2 s

P a r is E CE 73 2 9
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Discrete-time Equivalent Impulse Response


2

1.5

0.5

0
0 0.2 0.4 0.6 0.8 1
Time/T

Figure: Discrete-time Equivalent Impulse Response (f s T = 8)

P a r is E CE 73 2 10
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Discrete-Time Equivalent Noise

To determine the properties of the additive noise N [ n ] in


the discrete-time equivalent system,
Set input signal to zero,
let continuous-time noise be complex, white, Gaussian with
power spectral density N 0,
output signal is discrete-time equivalent noise.
Procedure yields: The noise samples N [n ]
are independent, complex Gaussian random variables, with
zero mean, and
variance equal to N 0 /T s .

P a r is E CE 73 2 11
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Received Symbol Energy


The last entity we will need from the continuous-time
system is the received energy per symbol E s
.
Note that E s is controlled by adjusting the gain A at the
transmitter.
To determine E s
,
Set noise N ( t ) to zero,
Transmit a single symbol b n,
Compute the energy of the received signal R ( t) .
Procedure yields:

E s = ss2 · A2 | p ( t ) * h ( t )| 2 dt

Here, s s2 denotes the variance of the source. For BPSK,


s s2 = 1.
s = A T.
For the system under consideration, E 2

P a r is E CE 73 2 12
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Simulating Transmission of Symbols

We are now in position to simulate the transmission of a


sequence of symbols.
The MATLAB functions previously introduced will be used
for that purpose.
We proceed in three steps:
1. Establish parameters describing the system,
By parameterizing the simulation, other scenarios are easily
accommodated.
2. Simulate discrete-time equivalent system,
3. Collect statistics from repeated simulation.

P a r is E CE 73 2 13
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Listing : SimpleSetParameters.m
3 % This script sets a structure named Parameters to be used by
% the system simulator.

%% Parameters
% construct structure of parameters to be passed to system simulator
8 % communications parameters
Parameters.T = 1/10000; % symbol period
Parameters.fsT = 8; % samples per symbol
Parameters.Es = 1; % normalize received symbol energy to 1 (0dB)
Parameters.EsOverN0 = 6; % Signal-to-noise ratio (Es/N0)
13 Parameters.Alphabet = [1 -1]; % BPSK
Parameters.NSymbols = 1000; % number of Symbols

% discrete-time equivalent impulse response (raised cosine pulse)


fsT = Parameters.fsT;
18 tts = ( (0:fsT-1) + 1/2 )/fsT;
Parameters.hh = sqrt (2/3) * ( 1 - cos (2* pi *tts)* sin ( pi /fsT)/( pi /fsT));

P a r is E CE 73 2 14
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Simulating the Discrete-Time Equivalent System

The actual system simulation is carried out in MATLAB


function MCSimple which has the function signature below.
The parameters set in the controlling script are passed as
inputs.
The body of the function simulates the transmission of the
signal and subsequent demodulation.
The number of incorrect decisions is determined and
returned.

function [NumErrors, ResultsStruct] = MCSimple( ParametersStruct )

P a r is E CE 73 2 15
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Simulating the Discrete-Time Equivalent System

The simulation of the discrete-time equivalent system uses


toolbox functions RandomSymbols , LinearModulation , and
addNoise .

A= sqrt (Es/T); % transmitter gain


N0 = Es/EsOverN0; % noise PSD (complex noise)
NoiseVar = N0/T*fsT; % corresponding noise variance N0/Ts
Scale = A*hh*hh’; % gain through signal chain
34
%% simulate discrete-time equivalent system
% transmitter and channel via toolbox functions
Symbols = RandomSymbols( NSymbols, Alphabet, Priors );
Signal = A * LinearModulation( Symbols, hh, fsT );
39 if ( isreal (Signal) )
Signal = complex(Signal);% ensure Signal is complex-valued
end
Received = addNoise( Signal, NoiseVar );

P a r is E CE 73 2 16
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Digital Matched Filter

The vector Received contains the noisy output samples from


the analog front-end.
In a real system, these samples would be processed by
digital hardware to recover the transmitted bits.
Such digital hardware may be an ASIC, FPGA, or DSP chip.
The first function performed there is digital matched
filtering .
This is a discrete-time implementation of the matched filter
discussed before.
The matched filter is the best possible processor for
enhancing the signal-to-noise ratio of the received signal.

P a r is E CE 73 2 17
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Digital Matched Filter

In our simulator, the vector Received is passed through a


discrete-time matched filter and down-sampled to the
symbol rate.
The impulse response of the matched filter is the conjugate
complex of the time-reversed, discrete-time channel
response h [n ].

R [n ] bˆn
h * [- n ] fs T Slicer

P a r is E CE 73 2 18
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

MATLAB Code for Digital Matched Filter

The signature line for the MATLAB function implementing


the matched filter is:
function MFOut = DMF( Received, Pulse, fsT )

The body of the function is a direct implementation of the


structure in the block diagram above.

% convolve received signal with conjugate complex of


% time-reversed pulse (matched filter)
Temp = conv ( Received, conj ( fliplr (Pulse) ) );
21
% down sample, at the end of each pulse period
MFOut = Temp( length (Pulse) : fsT : end );

P a r is E CE 73 2 19
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

DMF Input and Output Signal

D MF I nput
4 00

2 00

-2 00

-4 00
0 1 2 3 4 5 6 7 8 9 10
Tim e (1/ T)

D M F Out put
15 00

10 00

5 00

-5 00

-10 00
0 1 2 3 4 5 6 7 8 9 10
Tim e (1/ T)

P a r is E CE 73 2 20
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

IQ-Scatter Plot of DMF Input and Output

D M F Input
300

200

100

-100

-200

-800 - 600 -400 -200 0 200 400 600 800


R eal P ar t
D M F Output

500

-500

-2000 -1500 -1000 - 500 0 500 1000 1500 2000


R eal P ar t

P a r is E CE 73 2 21
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Slicer

The final operation to be performed by the receiver is


deciding which symbol was transmitted.
This function is performed by the slicer .
The operation of the slicer is best understood in terms of
the IQ-scatter plot on the previous slide.
The red circles in the plot indicate the noise-free signal
locations for each of the possibly transmitted signals.
For each output from the matched filter, the slicer
determines the nearest noise-free signal location.
The decision is made in favor of the symbol that
corresponds to the noise-free signal nearest the matched
filter output.
Some adjustments to the above procedure are needed
when symbols are not equally likely.

P a r is E CE 73 2 22
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

MATLAB Function SimpleSlicer

The procedure above is implemented in a function with


signature
function [Decisions, MSE] = SimpleSlicer( MFOut, Alphabet, Scale )

%% Loop over symbols to find symbol closest to MF output


for kk = 1: length ( Alphabet )
% noise-free signal location
28 NoisefreeSig = Scale*Alphabet(kk);
% Euclidean distance between each observation and constellation point
Dist = abs ( MFOut - NoisefreeSig );
% find locations for which distance is smaller than previous best
ChangedDec = ( Dist < MinDist );
33
% store new min distances and update decisions
MinDist( ChangedDec) = Dist( ChangedDec );
Decisions( ChangedDec ) = Alphabet(kk);
end

P a r is E CE 73 2 23
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Entire System

The addition of functions for the digital matched filter


completes the simulator for the communication system.
The functionality of the simulator is encapsulated in a
function with signature
function [NumErrors, ResultsStruct] = MCSimple( ParametersStruct )

The function simulates the transmission of a sequence of


symbols and determines how many symbol errors occurred.
The operation of the simulator is controlled via the
parameters passed in the input structure.
The body of the function is shown on the next slide; it
consists mainly of calls to functions in our toolbox.

P a r is E CE 73 2 24
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Listing : MCSimple.m
%% simulate discrete-time equivalent system
% transmitter and channel via toolbox functions
Symbols = RandomSymbols( NSymbols, Alphabet, Priors );
38 Signal = A * LinearModulation( Symbols, hh, fsT );
if ( isreal (Signal) )
Signal = complex(Signal);% ensure Signal is complex-valued
end
Received = addNoise( Signal, NoiseVar );
43
% digital matched filter and slicer
MFOut = DMF( Received, hh, fsT );
Decisions = SimpleSlicer( MFOut(1:NSymbols), Alphabet, Scale );

48 %% Count errors
NumErrors = sum ( Decisions ~= Symbols );

P a r is E CE 73 2 25
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Monte Carlo Simulation

The system simulator will be the work horse of the Monte


Carlo simulation.
The objective of the Monte Carlo simulation is to estimate
the symbol error rate our system can achieve.
The idea behind a Monte Carlo simulation is simple:
Simulate the system repeatedly,
for each simulation count the number of transmitted
symbols and symbol errors,
estimate the symbol error rate as the ratio of the total
number of observed errors and the total number of
transmitted bits.

P a r is E CE 73 2 26
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Monte Carlo Simulation

The above suggests a relatively simple structure for a


Monte Carlo simulator.
Inside a programming loop:
perform a system simulation, and
accumulate counts for the quantities of interest

43 while ( ~Done )
NumErrors(kk) = NumErrors(kk) + MCSimple( Parameters );
NumSymbols(kk) = NumSymbols(kk) + Parameters.NSymbols;

% compute Stop condition


48 Done = NumErrors(kk) > MinErrors || NumSymbols(kk) > MaxSymbols;
end

P a r is E CE 73 2 27
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Confidence Intervals

Question: How many times should the loop be executed?


Answer: It depends
on the desired level of accuracy (confidence), and
(most importantly) on the symbol error rate.
Confidence Intervals:
Assume we form an estimate of the symbol error rate P e as
described above.
Then, the true error rate ˆ Pe is (hopefully) close to our
estimate.
Put differently, we would like to be reasonably sure that the
absolute difference | Pˆe - P e | is small.

P a r is E CE 73 2 28
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Confidence Intervals
More specifically, we want a high probability p c
(e.g.,
pc = 95%) that | Pˆ e - P e | < s c .
The parameter s c is called the confidence interval ;
it depends on the confidence level p c , the error probability
P e , and the number of transmitted symbols N.
It can be shown, that

Pe ( 1 - Pe )
sc = z c ·
N,

where z depends on the confidence level p


c c
.
Specifically: Q ( zc ) = ( 1 - p c ) /2.
Example: for p c = 95%, z c = 1.96.

Question: How is the number of simulations determined


from the above considerations?

P a r is E CE 73 2 29
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Choosing the Number of Simulations

For a Monte Carlo simulation, a stop criterion can be


formulated from
a desired confidence level p c (and, thus, z c )
an acceptable confidence interval s c ,
the error rate P e .

Solving the equation for the confidence interval for N , we


obtain
N = P e · (1 - P e ) · ( z c /s c )2 .

A Monte Carlo simulation can be stopped after simulating N


transmissions.
Example: For p c = 95%, P e = 10 -3 , and s c = 10 -4 , we
find N ˜ 400, 000.

P a r is E CE 73 2 30
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

A Better Stop-Criterion
When simulating communications systems, the error rate is
often very small.
Then, it is desirable to specify the confidence interval as a
fraction of the error rate.
The confidence interval has the form s c
= ac · Pe (e.g.,
ac = 0.1 for a 10% acceptable estimation error).
Inserting into the expression for N and rearranging terms,

P e · N = ( 1 - P e ) · ( zc / ac ) 2 ˜ ( zc / ac )2 .

Recognize that P e · N is the expected number of errors!


Interpretation: Stop when the number of errors reaches
( zc / a c )2 .
Rule of thumb: Simulate until 400 errors are found
(p c = 95%, a = 10%).

P a r is E CE 73 2 31
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Listing : MCSimpleDriver.m
9 % comms parameters delegated to script SimpleSetParameters
SimpleSetParameters;

% simulation parameters
EsOverN0dB = 0:0.5:9; % vary SNR between 0 and 9dB
14 MaxSymbols = 1e6; % simulate at most 1000000 symbols

% desired confidence level an size of confidence interval


ConfLevel = 0.95;
ZValue = Qinv( ( 1-ConfLevel )/2 );
19 ConfIntSize = 0.1; % confidence interval size is 10% of estimate
% For the desired accuracy, we need to find this many errors.
MinErrors = ( ZValue/ConfIntSize )^2;

Verbose = true; % control progress output


24
%% simulation loops
% initialize loop variables
NumErrors = zeros ( size ( EsOverN0dB ) );
NumSymbols = zeros ( size ( EsOverN0dB ) );

P a r is E CE 73 2 32
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Listing : MCSimpleDriver.m
for kk = 1: length ( EsOverN0dB )
32 % set Es/N0 for this iteration
Parameters.EsOverN0 = dB2lin( EsOverN0dB(kk) );
% reset stop condition for inner loop
Done = false;

37 % progress output
if (Verbose)
disp ( sprintf ( ’Es/N0: %0.3g dB’, EsOverN0dB(kk) ) );
end

42 % inner loop iterates until enough errors have been found


while ( ~Done )
NumErrors(kk) = NumErrors(kk) + MCSimple( Parameters );
NumSymbols(kk) = NumSymbols(kk) + Parameters.NSymbols;

47 % compute Stop condition


Done = NumErrors(kk) > MinErrors || NumSymbols(kk) > MaxSymbols;
end

P a r is E CE 73 2 33
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Simulation Results

10 -1

10 -2

-3
10

10 -4

10 -5
-2 0 2 4 6 8 10
E /N ( dB)
s 0

P a r is E CE 73 2 34
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Summary

Introduced discrete-time equivalent systems suitable for


simulation in MATLAB.
Relationship between original, continuous-time system and
discrete-time equivalent was established.
Digital post-processing: digital matched filter and slicer.
Monte Carlo simulation of a simple communication system
was performed.
Close attention was paid to the accuracy of simulation
results via confidence levels and intervals.
Derived simple rule of thumb for stop-criterion.

P a r is E CE 73 2 35
Di s c r et e- Ti m e E qui v ale nt S y s t em
M AT LA B S im u lat io n
Di git al M at c he d Fi lt er and S l ic er
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M on te C ar lo S i mu lat io n

Where we are ...

Laid out a structure for describing and analyzing


communication systems in general and wireless systems
in particular.
Saw a lot of MATLAB examples for modeling diverse
aspects of such systems.
Conducted a simulation to estimate the error rate of a
communication system and compared to theoretical
results.
To do: consider selected aspects of wireless
communication systems in more detail, including:
modulation and bandwidth,
wireless channels,
advanced techniques for wireless communications.

P a r is E CE 73 2 36
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Outline

MATLAB Simulation

Frequency Diversity: Wide-Band Signals

P a r is E CE 73 2 37
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Frequency Diversity through Wide-Band Signals

We have seen above that narrow-band systems do not


have built-in diversity.
Narrow-band signals are susceptible to have the entire
signal affected by a deep fade.
In contrast, wide-band signals cover a bandwidth that is
wider than the coherence bandwidth.
Benefit: Only portions of the transmitted signal will be
affected by deep fades (frequency-selective fading).
Disadvantage: Short symbol duration induces ISI; receiver
is more complex.
The benefits, far outweigh the disadvantages and
wide-band signaling is used in most modern wireless
systems.

P a r is E CE 73 2 38
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Illustration: Built-in Diversity of Wide-band Signals

We illustrate that wide-band signals do provide diversity by


means of a simple thought experiments.
Thought experiment:
Recall that in discrete time a multi-path channel can be
modeled by an FIR filter.
Assume filter operates at symbol rate T s
.
The delay spread determines the number of taps L.
Our hypothetical system transmits one information symbol
in every L-th symbol period and is silent in between.
At the receiver, each transmission will produce L non-zero
observations.
This is due to multi-path.
Observation from consecutive symbols don’t overlap (no ISI)
Thus, for each symbol we have L independent
observations, i.e., we have L-fold diversity.

P a r is E CE 73 2 39
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Illustration: Built-in Diversity of Wide-band Signals

We will demonstrate shortly that it is not necessary to


leave gaps in the transmissions.
The point was merely to eliminate ISI.
Two insights from the thought experiment:
Wide-band signals provide built-in diversity.
The receiver gets to look at multiple versions of the
transmitted signal.
The order of diversity depends on the ratio of delay spread
and symbol duration.
Equivalently, on the ratio of signal bandwidth and coherence
bandwidth.
We are looking for receivers that both exploit the built-in
diversity and remove ISI.
Such receiver elements are called equalizers.

P a r is E CE 73 2 40
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Equalization

Equalization is obviously a very important and well


researched problem.
Equalizers can be broadly classified into three categories:
1. Linear Equalizers: use an inverse filter to compensate for
the variations in the frequency response.
Simple, but not very effective with deep fades.
2. Decision Feedback Equalizers: attempt to reconstruct ISI
from past symbol decisions.
Simple, but have potential for error propagation.
3. ML Sequence Estimation: find the most likely sequence
of symbols given the received signal.
Most powerful and robust, but computationally complex.

P a r is E CE 73 2 41
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Maximum Likelihood Sequence Estimation

Maximum Likelihood Sequence Estimation provides the


most powerful equalizers.
Unfortunately, the computational complexity grows
exponentially with the ratio of delay spread and symbol
duration.
I.e., with the number of taps in the discrete-time equivalent
FIR channel.

P a r is E CE 73 2 42
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Maximum Likelihood Sequence Estimation

The principle behind MLSE is simple.


Given a received sequence of samples R [n ], e.g., matched
filter outputs, and
a model for the output of the multi-path channel:
rˆ [n ] = s [n ] * h [n ], where
s [n ] denotes the symbol sequence, and
h [n ] denotes the discrete-time channel impulse response,
i.e., the channel taps.
Find the sequence of information symbol s [n ] that
minimizes
N
D2 = | r [n ] - s [n ] * h [n ] |2 .
n

P a r is E CE 73 2 43
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Maximum Likelihood Sequence Estimation

The criterion
N
D 2 = | r [n ] - s [n ] * h [n ]|2 .
n

performs diversity combining (via s [n ] * h [n ]), and


removes ISI.
The minimization of the above metric is difficult because it
is a discrete optimization problem.
The symbols s [n ] are from a discrete alphabet.
A computationally efficient algorithm exists to solve the
minimization problem:
The Viterbi Algorithm .
The toolbox contains an implementation of the Viterbi
Algorithm in function va .

P a r is E CE 73 2 44
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

MATLAB Simulation

A Monte Carlo simulation of a wide-band signal with an


equalizer is conducted
to illustrate that diversity gains are possible, and
to measure the symbol error rate.
As before, the Monte Carlo simulation is broken into
set simulation parameter (script VASetParameters ),
simulation control (script MCVADriver ), and
system simulation (function MCVA ).

P a r is E CE 73 2 45
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

MATLAB Simulation: System Parameters

Listing : VASetParameters.m
Parameters.T = 1/1e6; % symbol period
Parameters.fsT = 8; % samples per symbol
Parameters.Es = 1; % normalize received symbol energy to 1 (0dB)
Parameters.EsOverN0 = 6; % Signal-to-noise ratio (Es/N0)
13 Parameters.Alphabet = [1 -1]; % BPSK
Parameters.NSymbols = 500; % number of Symbols per frame

Parameters.TrainLoc = floor (Parameters.NSymbols/2); % location of training seq


Parameters.TrainLength = 40;
18 Parameters.TrainingSeq = RandomSymbols( Parameters.TrainLength, ...
Parameters.Alphabet, [0.5 0.5] );

% channel
Parameters.ChannelParams = tux(); % channel model
23 Parameters.fd = 3; % Doppler
Parameters.L = 6; % channel order

P a r is E CE 73 2 46
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

MATLAB Simulation

The first step in the system simulation is the simulation of


the transmitter functionality.
This is identical to the narrow-band case, except that the
baud rate is 1 MHz and 500 symbols are transmitted per
frame.
There are 40 training symbols.

Listing : MCVA.m
41 % transmitter and channel via toolbox functions
InfoSymbols = RandomSymbols( NSymbols, Alphabet, Priors );
% insert training sequence
Symbols = [ InfoSymbols(1:TrainLoc) TrainingSeq ...
InfoSymbols(TrainLoc+1: end )];
46 % linear modulation
Signal = A * LinearModulation( Symbols, hh, fsT );

P a r is E CE 73 2 47
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

MATLAB Simulation

The channel is simulated without spatial diversity.


To focus on the frequency diversity gained by wide-band
signaling.
The channel simulation invokes the time-varying multi-path
simulator and the AWGN function.

% time-varying multi-path channels and additive noise


Received = SimulateCOSTChannel( Signal, ChannelParams, fs);
51 Received = addNoise( Received, NoiseVar );

P a r is E CE 73 2 48
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

MATLAB Simulation

The receiver proceeds as follows:


Digital matched filtering with the pulse shape; followed by
down-sampling to 2 samples per symbol.
Estimation of the coefficients of the FIR channel model.
Equalization with the Viterbi algorithm; followed by removal
of the training sequence.

MFOut = DMF( Received, hh, fsT/2 );

% channel estimation
57 MFOutTraining = MFOut( 2*TrainLoc+1 : 2*(TrainLoc+TrainLength) );
ChannelEst = EstChannel( MFOutTraining, TrainingSeq, L, 2);

% VA over MFOut using ChannelEst


Decisions = va( MFOut, ChannelEst, Alphabet, 2);
62 % strip training sequence and possible extra symbols
Decisions( TrainLoc+1 : TrainLoc+TrainLength ) = [ ];

P a r is E CE 73 2 49
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Channel Estimation

Channel Estimate:

hˆ = ( S S ) - 1 ·Sr,

where
S is a Toeplitz matrix constructed from the training
sequence, and
r is the corresponding received signal.

TrainingSPS = zeros (1, length (Received) );


14 TrainingSPS(1:SpS: end ) = Training;

% make into a Toepliz matrix, such that T*h is convolution


TrainMatrix = toeplitz ( TrainingSPS, [Training(1) zeros (1, Order-1)]);

19 ChannelEst = Received * conj ( TrainMatrix) * ...


inv (TrainMatrix’ * TrainMatrix);

P a r is E CE 73 2 50
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Simulated Symbol Error Rate with MLSE Equalizer

10- 1

-2
10

10- 3

-4
10

10- 5

10
-6 Si m ul ated V A
L=1
L=2
L=3
10- 7
L=4
L=5
AW GN
-8
10
0 2 4 6 8 10 12
E /N (dB )
s 0

Figure: Symbol Error Rate with Viterbi Equalizer over Multi-path


Fading Channel; Rayleigh channels with transmitter diversity shown
for comparison. Baud rate 1MHz, Delay spread ˜ 2 µ s.

P a r is E CE 73 2 51
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Conclusions
The simulation indicates that the wide-band system with
equalizer achieves a diversity gain similar to a system with
transmitter diversity of order 2.
The ratio of delay spread to symbol rate is 2.
comparison to systems with transmitter diversity is
appropriate as the total average power in the channel taps
is normalized to 1.
Performance at very low SNR suffers, probably, from
inaccurate estimates.
Higher gains can be achieved by increasing bandwidth.
This incurs more complexity in the equalizer, and
potential problems due to a larger number of channel
coefficients to be estimated.
Alternatively, this technique can be combined with
additional diversity techniques (e.g., spatial diversity).

P a r is E CE 73 2 52
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

More Ways to Create Diversity

A quick look at three additional ways to create and exploit


diversity.
1. Time diversity.
2. Frequency Diversity through OFDM.
3. Multi-antenna systems (MIMO)

P a r is E CE 73 2 53
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Time Diversity
Time diversity: is created by sending information multiple
times in different frames.
This is often done through coding and interleaving.
This technique relies on the channel to change sufficiently
between transmissions.
The channel’s coherence time should be much smaller than
the time between transmissions.
If this condition cannot be met (e.g., for slow-moving
mobiles), frequency hopping can be used to ensure that the
channel changes sufficiently.
The diversity gain is (at most) equal to the number of
time-slots used for repeating information.
Time diversity can be easily combined with frequency
diversity as discussed above.
The combined diversity gain is the product of the individual
diversity gains.

P a r is E CE 73 2 54
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

OFDM

OFDM has received a lot of interest recently.


OFDM can elegantly combine the benefits of narrow-band
signals and wide-band signals.
Like for narrow-band signaling, an equalizer is not required;
merely the gain for each subcarier is needed.
Very low-complexity receivers.
OFDM signals are inherently wide-band; frequency
diversity is easily achieved by repeating information (really
coding and interleaving) on widely separated subcarriers.
Bandwidth is not limited by complexity of equalizer;
High signal bandwidth to coherence bandwidth is possible;
high diversity.

P a r is E CE 73 2 55
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

MIMO
We have already seen that multiple antennas at the
receiver can provide both diversity and array gain.
The diversity gain ensures that the likelihood that there is
no good channel from transmitter to receiver is small.
The array gain exploits the benefits from observing the
transmitted energy multiple times.
If the system is equipped with multiple transmitter
antennas, then the number of channels equals the product
of the number of antennas.
Very high diversity.
Recently, it has been found that multiple streams can be
transmitted in parallel to achieve high data rates.
Multiplexing gain
The combination of multi-antenna techniques and OFDM
appears particularly promising.

P a r is E CE 73 2 56
I nt r odu c ti on to E q ual iz at io n
M AT LA B S im u lat io n
M AT LA B S im ul at ion
Fr e que nc y Div er s i ty : W ide - B and S i gna ls
M or e W ay s t o Cr e at e Div er s i ty

Summary

A close look at the detrimental effect of typical wireless


channels.
Narrow-band signals without diversity suffer poor
performance (Rayleigh fading).
Simulated narrow-band system.
To remedy this problem, diversity is required.
Analyzed systems with antenna diversity at the receiver.
Verified analysis through simulation.
Frequency diversity and equalization.
Introduced MLSE and the Viterbi algorithm for equalizing
wide-band signals in multi-path channels.
Simulated system and verified diversity.
A brief look at other diversity techniques.

P a r is E CE 73 2 57

You might also like