Welcome to 6.111! Introductory Digital Systems Laboratory

advertisement
ELEC1200: A System View of
Communications: from Signals to Packets
Lecture 9
• Review:
– Analyzing Bit Errors in the Binary Channel Model
• Inside the Binary Channel
– Average Power in Signals
– Modeling random noise
– Calculating the probability of error conditioned on the
input
• Calculating bit error rate
– Effect of changing threshold
– Effect of changing signal
– Effect of changing noise
• Signal to Noise Ratio
ELEC1200
1
Binary Channel Model
0
1  Pe 0
P [I N = 0 ]
Pe 0
IN
OUT
Pe 1
1
P [I N = 1]
0
1  Pe 1
1
• Binary: input/output are either 0/1.
• Usually, the input and output are the same, but
occasionally (with probability Pe0 or Pe1), a bit is
flipped.
• The BER can be calculated by
B E R  Pe 0  P [I N = 0 ]  Pe 1  P [I N = 1]
ELEC1200
2
Inside the Binary Channel
IN = 0/1
channel
r
binary channel
y=r+x
>T
OUT = 0/1
x (noise)
• Under our simplifying assumptions, we can consider one bit at
a time.
• The channel adds an offset rmin and scaling by rmax-rmin

 rm in
r  

 rm a x
if IN  0
if IN  1
• The noise is additive: y = r + x
• The output is obtained by thresholding y:
ELEC1200

0
out  

1
if y  T
if y  T
T  threshold
3
Noise leads to bit errors
IN
1
0
0
2
4
6
8
10
y = r+x
12
14
16
18
20
rmax
T
rmin
0
2
4
6
8
2
4
6
8
2
4
6
8
1
0
0
1
0
0
ELEC1200
10
12
14
16
18
20
10
12
14
16
18
20
10
12
14
16
18
20
OUT
bit errors
4
Parameters that determine BER
0
0
Pe 0
IN
1
1  Pe 0
P [I N = 0 ]
OUT
Pe 1
P [I N = 1]
1
1  Pe 1
• In order to predict the BER, we need to know
– P[IN=0] (we can find P[IN=1] = 1 - P[IN=0])
– Pe0
– Pe1
• Usually, the transmitter determines P[IN=0]
– e.g. P[IN=0] = P[IN=1] = 0.5
• Pe0 and Pe1 depend on
– the transmit levels (rmin,rmax)
– the power in the noise
ELEC1200
This lecture examines
this dependency
5
Intuition
• The probabilities of error, Pe0 and Pe1, should be
small if
– The transmit levels are widely separated, i.e.
• rmax - rmin is large
• The power used to transmit the signal is large
– The noise is small, i.e.
• The values of the noise do not vary over a wide range
• The power of the noise is small
• In this case, the BER will also be small
– Remember that the BER lies between Pe0 and Pe1
• Implicit in these definitions is the idea of the
power in signals.
ELEC1200
6
Average Power in Signals
• For communication, we usually have signals that vary around
an average value
rave = average value
Dr
• For communication, we are interested in how much the signals
differ from their average:
Dr = r - rave
• Since this changes over time and can be both positive and
negative, we average the squared value over a number of
samples
P 
ELEC1200
1
N
N
  D r (n ) 
2
n 1
7
Average Power for Bit Signals
rmax
Dr
rmin
•
rave
Psignal 
•
If 0 and 1’s are equally likely,
rave = ½ rmin + ½ rmax
If IN = 0,
Δr = rmin – rave
= rmin – (½ rmin + ½ rmax) = ½ (rmin - rmax)
•
If IN = 1,
1
N
N
  D r (n ) 
2
n 1
Δr = rmax – (½ rmin + ½ rmax) = ½ (rmax – rmin)
•
The average power is
Psignal 
ELEC1200
1
1 1
 21 (rm ax  rm in )  
 2 (rm ax  rm in ) 



2
2 
2
2

 rm ax  rm in 
2
4
8
Power Consumption
• Power consumption directly affects battery life.
• Power is energy used per unit time
• Batteries contain a fixed amount of energy. The
higher the power consumption of the device they are
powering, the faster this energy is used up.
• Calculating the amount of energy in a battery
– Batteries are typically rated at fixed voltage in volts (V) and
a charge capacity in milliamp-hours (mAh)
– Multiplying these together gives total energy in milliwatthours (mWh)
– For example, a mobile phone battery rated at 3.7V and
1000mAh contains 3700mWh of energy
• Typical power consumption of
–
–
–
–
–
ELEC1200
A
A
A
A
A
microwave oven 1000W
desktop computer 120W
notebook computer 40W
human brain 10W
mobile phone 1W
9
Noise levels in Mobile Phones
• It determines the minimum signal that can be
received by radios and receivers
• What is the typical noise power present at the
input of a mobile phone?
• Extremely, extremely small 10-15W
• 1 Watt = Unit of Power
• Lifting an apple (~100g) up by 1 m in 1s requires
approximately 1W
• When your received signal falls to about this level
your phone will lose its connection
• The exact level is determined by
• Quality of circuits and components
• Symbol (bit) rate
ELEC1200
10
• As we collect more samples, the
histogram gets smoother and
smoother.
ELEC1200
% of samples
– Height at each sample value is
the percentage of samples near
that sample value.
% of samples
• Even though the value of the
noise is quite random, the
statistics of a large number of
samples are quite stable.
• Create histograms of samples
% of samples
% of samples
Statistics of the Noise
11
Probability Density Function
• The histogram is still not smooth since we count
the samples in bins of finite width.
• As the bins get smaller and smaller, the curve gets
smoother and smoother, and approaches a function
known as the probability density function (pdf)
sum of all
columns
= 1 (100%)
bin width
ELEC1200
12
Gaussian Density Function
• The probability density function
of many naturally occurring
random quantities, such as noise
or measurement errors, tends to
have a hill or bell-like shape,
known as a Gaussian distribution.
• This very important result is due
to a mathematical result known
as the Central-Limit Theorem.
• This random variable is so
common that it is also called the
“normal” random variable.
• Applications:
– Noise voltages that corrupt
transmission signals.
– Position of a particle undergoing
Brownian motion
– Voltage across a resistor
ELEC1200
Gaussian PDF
The wider the PDF,
the larger the noise.
13
Parameters controlling the shape
• The mean (m) of a Gaussian random variable is
– Its average value over many samples
– The center location of the pdf
• The standard deviation (σ) is
– An indication of how “spread out” the samples are
– A measure of the width of the pdf
• The variance (σ2) is
– The square of the standard deviation
– The average power over many samples
1
pdf
2 s
e
 0 .5
f X ( x) 
2 s
~60% of
peak
ELEC1200
f X (x)
1
2 s
(xm )
e
2s
2
s
m
x
14
2
Changing the Mean and Variance
• Changes in mean shift the center of mass of PDF
• Changes in variance narrow or broaden the PDF
– Note that area of PDF must always remain equal to one
1
2 s
sx
1
2 s
ELEC1200
sx
15
Calculating Probability by Integrating
• The probability that the noise x is in (x1,x2) is the
area under the probability density function
between x1 and x2
P[x1 < noise < x2]
ELEC1200
16
Example Probability Calculation
• Verify that overall area is 1:
– Since the curve defines a rectangle, the area is base ×
height:
1
2 
2
 1
• Probability that x is between 0.5 and 1.0:
– The area of the shaded region is
– Thus,
ELEC1200
1
2

1
2

1
4
1
P  0.5  x  1.0  
4
17
The Q-function
• The Q-function gives the
probability that a Gaussian
random variable X with m = 0
and s = 1 is greater than a
particular value T
fX
P[X>T]=Q(T)
P[X≤T]=1-Q(T)
m = 0, s = 1
• Properties
P[X ≤ T] = 1 – Q(T)
Q(0) = ½
• There is no closed-form
expression for Q(T). Its value
must be found from tables or
the MATLAB function
qfunc(T)
ELEC1200
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3 1-Q(x)
0.2
P[X<x]
0.1
0
-3
-2
-1
T
P[X>x]
Q(x)
0
T
1
2
3
18
Linear Transformations of Gaussian
•
•
•
Suppose X is Gaussian with
m=0 and s=1.
If Y=aX+b, then
Y is Gaussian
with m=b and s=a!
We can compute probabilities
for X using the Q function,
e.g.
P[ X  T ]  Q
•
T
We can also compute
probabilities for Y using the Q
function, since
T  m 
P[ Y  T ]  Q 

s


ELEC1200
Y=2X
Y=X+2
0.4
0.4
fX
0.2
0.2
0
-5
1
0
x
5
Y=X+2
fY
0
-5
0
0.5
0.5
0
T
5
x
5
Y=2X
1
Q(T)
Q(T-2)
Q(T)
0
-5
fX
fY
Q(T/2)
0
-5
0
T
19
5
PDF of Received Signal + Noise
• Assume the noise x is Gaussian with zero mean and variance
(power) σ2.
• The PDF of y = r+x depends upon whether IN = 0 or 1
– If
•
– If
•
IN=0, y = rmin + x
y is Gaussian with mean rmin and variance σ2
IN=1, y = rmax + x
y is Gaussian with mean rmax and variance σ2
IN = 0
f(y if IN=0)
ELEC1200
rmin
rmax
IN = 1
f(y if IN=1)
rmin
rmax
20
Pe0 (Probability of Error if IN=0)
• If IN = 0,
– y = rmin + x
– y is a Gaussian with mean rmin
and variance σ2
f(y if IN=0)
Pe0
• There is an error if
– OUT = 1
– The noise pushes y above T
rmin
T
rmax
y
rmax
T
Pe 0  P[ y> T if IN = 0 ]



• The probability of error
decreases as T increases.
Pe0
1
probability
 T  rm in
 Q 

s

0
ELEC1200
rmin
21
Pe1 (Probability of Error if IN=1)
• If IN = 1,
– y = rmax + x
– y is a Gaussian with mean rmax and
variance σ2
f(y if IN=1)
Pe1
• There is an error if
– OUT = 0
– The noise pushes y below T
rmin
T
rmax
y
rmax
T
Pe 1  P[ y< T if I N = 1]



• The probability of error
increases with T.
• Thus, choosing T is a tradeoff
between minimizing Pe0 and Pe1.
ELEC1200
Pe1
1
probability
 T  rm a x
 1  Q 

s

0
rmin
22
Predicting BER
If 0 and 1 input bits are equally likely,
BER 
1
2
Pe 0 
1
2
Pe 1
f(y if IN=0)
f(y if IN=1)
Pe0
rmin
T
rmax
Pe1
½
½
y
½ f(y if IN=0)
rmin
T
rmax
y
½ f(y if IN=1)
BER
ELEC1200
rmin
T
rmax
y
23
BER under changing threshold
BER
1
0.5
0
rmin
rmax
T
½ f(y if IN=1)
½ f(y if IN=0)
½ Pe1
rmin
T
rmax
y
½ Pe0
rmin
T
y
rmax
best threshold
T = ½ (rmin+rmax)
rmin
ELEC1200
T
rmax
y
24
Signal-to-Noise Ratio
• It is not the absolute signal or noise power that is
important, but rather the Signal-to-Noise Ratio (SNR).
rmax
Psignal 
rave
Dr
rmin
(rm ax  rm in )
4
2
y
Pnoise  s
2
SNR 

• SNR is often measured in decibels (dB):
Psign a l
Pn oise
(rm a x  rm in )
S N R  1 0 lo g 1 0
4s
2
2
Psign a l
Pn oise
(d B )
– SNR = 0dB means signal and noise power are equal
– SNR = 10dB means signal power is 10 times noise power
– SNR = 20dB means signal power is 100 times noise power
ELEC1200
25
Factors affecting SNR
•
•
•
•
Received power decreases as the receiver moves away
The noise remains pretty constant
Decrease in received signal power leads to decreased SNR
Once SNR falls below around 10dB, the receiver will stop
functioning- for a mobile phone this is around 10-14W
noise
ELEC1200
26
BER under changing Signal Power
BER
0
pdf
10
10
-1
10
-2
pdf
rmin T rmax
T
rmax
pdf
rmin
-3
rmin
ELEC1200
T
rmax
10
-10
-5
0
5
SNR (dB)
10
27
BER under changing Noise Power
BER
0
pdf
10
rmin
T
rmax
rmin
T
rmax
10
rmax
10
-10
-1
pdf
10
pdf
-2
-3
rmin
ELEC1200
T
-5
0
5
SNR (dB)
10
28
Summary
• In digital systems noise leads to bit errors
• Noise can be modeled by statistical distributions
• By using our models of noise it is possible to find
exact expressions for the Bit Error Rate (BER) as
– The signal power changes
– The noise power changes
– The threshold changes
• The key parameter determining BER is the Signal
to Noise Ratio (SNR)
• BER decreases as SNR increases
ELEC1200
29
Download