Transcript Week2_2

Physical Layer Continued
Review
• Discussed how to design the communication scheme depending on the
physical mediums – pulling voltage up and down for wired connections
• Mentioned some important terms
– Symbol: usually occupies a fixed length of time, carrying one or multiple bits.
– Link speed: usually measured by bps (bits per second)
• Discussed bandwidth and noise, and their influence on the maximum
speed that can be achieved by the link. Roughly speaking,
– Bandwidth determines how fast can we send symbols. For example, if the link
does not allow the sudden change from 0v-5v, such a change will be
smoothed out. So (roughly speaking) you cannot send symbols with durations
shorter than the smoothing period.
– Noise determines how close the constellations can be. For binary systems, the
constellation lies in a line and is {-1, 1} where -1 is 0V and 1 is 5V, for example.
This is called BPSK. The constellation can also be in a plane and take complex
numbers when we send two voltages simultaneously, one representing the
real component and the other representing the imaginary component, like
{1+j, -1+j, -1-j, 1-j} , which is called QPSK. More points on the plane will result
in something like 16QAM, 64QAM, 256QAM.
More on Bandwidth
• Let’s dig a little deeper about bandwidth.
• First Fact: Bandwidth is measured by Hz, so it
is a frequency concept.
Frequency
• Second Fact: Most of the signals we care
about in communications can be represented
by the summation of sine waves on different
frequencies at certain magnitudes – Fourier
transform.
• So, when sending any signal waveform, think
it as sending a whole bunch of sine waves all
together.
Frequency Domain
•
http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Freq/Freq4.html
time
frequency
Frequency
• Third Fact: Most of the systems do NOT respond to all
frequencies. What usually happens is that a system
will respond only to a continuous range of frequencies.
• For example, the human ear can pick up something like
[0,20000]Hz. Our ears will not respond to a sound (a
sine wave) produced by the dolphin on 120,000 Hz.
• So, we say sine waves on frequency higher than
20000Hz are filtered out by our ears, and our ear is a
low pass filter with a cutoff frequency of 20000Hz, or,
the bandwidth of the human mouth to human ear link
is no more than 20000Hz.
Bandwidth
• So, for communication systems, the
bandwidth is defined as the range of
frequencies it passes.
• The wider this range, i.e., the larger the
bandwidth, the faster the signals are allowed
to change, because there are higher frequency
components in the signal.
Exercise
• Suppose we are sending a signal
cos(25000πt)cos(5000πt). It then passes
through a Low Pass Filter with cut-off
frequency of 12500Hz. What will be the signal
coming out of the LPF?
• For a signal like cos(2πft), the frequency is f,
because it repeats every 1/f seconds.
Exercise
• Suppose we are sending a signal
cos(25000πt)cos(5000πt). It then passes through
a Low Pass Filter with cut-off frequency of
12500Hz. What will be the signal coming out of
the LPF?
• Note that cos(25000πt)cos(5000πt)=1/2[cos(20000πt)+cos(30000πt)],
so, while the frequency of the first sine wave is
10000Hz and the second is 15000Hz. So only the
first one will stay.
Nyquist Theorem
• If the bandwidth is limited to B, in the ideal case when
there is no noise, how fast can you send/receive symbols?
– Note that the channel capacity is infinity because each symbol
can carry infinite number of bits
• Nyquist Theorem says that it only makes sense for you to
send/receive symbols at a speed of 2B – if B is 4KHz, you
send/receive 8K symbols per second – the baud rate is 8K
per second.
• Why? If a signal is band-limited by BHz, by taking 2B
samples per second, you can completely reconstruct it.
Nothing more can be reconstructed, so no point of sending.
More on Noise
• In communication systems, we usually take a
sample from the received waveform to
determine what the transmitted symbol is.
• With noise, the signal is added with noise.
• For example, let’s say 0 is 0 volt 1 is 5 volts. When
we send a `0’, the receiver could receive 0.6v,
when we send `1’, the receiver could receive 4.2v.
The receiver has to output a bit to the upper
layer. So the problem is, given the received
voltage, what bit should be output?
More on Noise
• It’s all about guessing, because you don’t
know what the noise is when this symbol is
sent as noise is random.
• You may know some statistics of the noise,
based on which you make your best guess.
• For example, suppose you know that very
rarely the noise exceeds 2.5 volts. If you
received a 2.2 volts, you would guess it to be 0
or 1? What is the chance that you got it
right/wrong?
Detection
• Detection – given a received signal, determine
which of the possible original signals was sent.
There are finite number of possible original
signals (2 for the binary case – 0 or 1)
Detection – An Example
• Detection really depends on the noise. In the
binary case when the transmitted signal is
either 0 or 5V with equal probability, if we
know that noise takes values -3V and 2V with
probability 0.7 and 0.3, respectively. How
would you design the detector?
Detection – An Example
• Detection really depends on the noise. In the binary
case when the transmitted signal is either 0 or 5V with
equal probability, if we know that noise takes values 3V and 2V with probability 0.7 and 0.3, respectively.
How would you design the detector?
• First step, check the possible outcomes:
– If send 0V, two possible outcomes:
• -3V. Prob: 0.7.
• 2V. Prob: 0.3.
– If send 5V, two possible outcomes:
• 2V. Prob: 0.7.
• 7V. Prob: 0.3.
– So, a total of only 3 possible outcomes.
Detection – An Example
•
•
Detection really depends on the noise. In the binary case when the transmitted
signal is either 0 or 5V with equal probability, if we know that noise takes values 3V and 2V with probability 0.7 and 0.3, respectively. How would you design the
detector?
First step, check the possible outcomes:
– If send 0V, two possible outcomes:
•
•
-3V. Prob: 0.7.
2V. Prob: 0.3.
– If send 5V, two possible outcomes:
•
•
2V. Prob: 0.7.
7V. Prob: 0.3.
– So, a total of only 3 possible outcomes.
•
Second step, check for each outcome, what should the output be.
– No ambiguity when received -3V and 7V, 0 and 1, respectively.
– What should we say when received 2v? From 0V, probability 0.5*0.3= 0.15. From 5V,
0.5*0.7=0.35. So will say when received 2V, the bit is 1.
– What is the probability that we give the wrong detection result? When received 2V and was
from bit 0 and we say it is from bit 1, so it is 0.15.
Maximum Likelihood Detection
• There are two inputs, x1 and x2. Noise is n.
What we receive is y.
• If sent x1, we receive y=x1 + n. If sent x2, we
receive y=x2+n. We don’t know
– what was sent
– how large n is.
• The rule is:
– if P(Y=y|X=x1) > P(Y=y|X=x2), say sent x1, else
say sent x2.
– That is, compare the conditional probability.
Maximum Likelihood Detection
• The noise n follows some probability distribution known
beforehand.
• Note that
– P(Y=y|X=x1) = P(n=y-x1)
– P(Y=y|X=x2) = P(n=y-x2)
• So the detection rule is
if P(n=y-x1)>P(n=y-x2)
output x1
else
output x2
• This will tell us for any received y whether to guess as x1 or
as x2. That’s all.
Some Comments
• When implemented in software, a BPSK
detector (input signal from is a voltage level
could be negative and the output is either bit
0 or bit 1 ) will be (for Gaussian noise)
int BPSKDector(float sample)
{
return (sample > 0) ? 1 : 0;
}
Beyond MLD – MAP (maximum a
posteriori probability)
• Wait, what if you know that x1 is more likely to be sent
than x2?
• The rule is:
– if P(X=x1|Y=y) > P(X=x2|Y=y), say sent x1, else say sent x2.
• Let’s say that the probability that x1 is sent is p1 and x2 is
p2, where p1!= p2. The detection rule should be changed
to
if p1 P(n=y-x1)> p2 P(n=y-x2)
output x1
else
output x2