Вы находитесь на странице: 1из 4

Sequence of raised cosine pulses in Matlab

Ts=0.002; % Sampling frequency


bits = randn(1,10)>0; % Generate bits (a sequence of 1 and 0)
bits = 2*bits - 1; % Convert i's to 1 and 0's to -1
COMMUNICATION SYSTEMS Rs = 50;
f_cut_off = Rs/2;
% Symbol rate
% Cut-off frequency for raised-cosine pulse

Tsym = 1/Rs; % Symbol period


Lecture # 13 NSPS = Tsym/Ts; % Number of samples per symbol

roll_off = 0.5;
transition_bandwidth = 2*f_cut_off*roll_off; % Tr bandwidth for RC pulse
17th Mar 2007 rc_pulse = firrcos(64, f_cut_off, transition_bandwidth, 1/Ts);
len_rc = length(rc_pulse);
bb_signal = zeros(1,200); % create a vector to store baseband signal
Instructor for i = 1:length(bits) % copy raised cosine pulses with NSPS samples betwwen two succesive peaks
bb_signal((i-1)*NSPS+1 : (i-1)*NSPS + len_rc) = bb_signal((i-1)*NSPS+1 : (i-1)*NSPS + len_rc) +
WASEEM KHAN rc_pulse*bits(i);
end

plot(bb_signal);

Centre for Advanced Studies in Engineering

Probability Definitions
Probability is a number assigned to an event that An experiment is a situation involving chance or
indicates how likely it is that the event will occur when a probability that leads to results called outcomes.
random experiment is performed. An outcome is the result realized after performing the
If an experiment is performed N times and a particular experiment once.
event A occurs n times, probability of occurrence of A can Sample space S of a random experiment is the set of all
be expressed as n possible outcomes.
P ( A) lim
N N An event is a set of one or more outcomes.
Probability can also be expressed as Probability is the measure of how likely an event is.
Number of ways event A can occur
P ( A)
Total number of possible outcomes

Example Problem Some More Problems


A 6-sided die is rolled. What is the probability of each What is the sample space when 2 coins are tossed?
outcome? What is the probability of rolling an even
{HH, HT, TH, TT}
number? of rolling an odd number?

The possible outcomes of this experiment are 1, 2, 3, 4, 5 and 6. A large basket of fruit contains 3 oranges, 2 apples and
Hence sample space ={1, 2, 3, 4, 5, 6} 5 bananas. If a piece of fruit is chosen at random, what
P(1) = 1 / 6 [ Event = {1} ] is the probability of getting an orange or a banana?
P(3) = 1 / 6 [ Event = {3} ] P (orange or banana) = (3+5) / 10 = 4 / 5
P(even) = 3 / 6 = 1/ 2 [ Event = {even} ]
P(odd) = 3 / 6 = 1/ 2 [ Event = {odd} ] A pair of dice is rolled. What is the probability of getting a
P(outcome divisible by 3) = 2 / 6 =1 / 3 sum of 2?

1
Mutually Exclusive Events Properties of Probability
In general, events E and F are said to be mutually exclusive if and
1:
only if they have no elements in common.
e.g. sample space for rolling a die= S = {1, 2, 3, 4, 5, 6},
A is the event of even number outcome i.e. A = {2, 4, 6} and
2:
B is the event of odd number outcome i.e. B = {1, 3, 5},
A and B are mutually exclusive, because they have NO elements in common. 3:

If event C is an outcome less than 4 i.e C = {1, 2, 3}. 4: For mutually exclusive events E and F
Are events C and B are mutually exclusive? P(E F) P(E ) P(F )
No, because they have one element, the number 2, in common.
For events that are not mutually exclusive
P(E F) P(E ) P(F ) P(E F)

Some More Problems Conditional Probability


If you roll a dice what is the probability of not getting 6.
P(6) 1 / 6 If A and B are two events, the probability of event A, when we
P (not 6) = 1 1/ 6 = 5 / 6 already know that event B has occurred, is defined by the
relation
In a group of 20 members, there are 12 girls and 8 boys. Four P(A B)
P(A | B) for P ( B ) 0
are deaf out of which two are boys. If a member is chosen at P (B)
random, what is the probability of choosing a boy or a deaf
member? This conditional probability is read as the probability of A
P (boy) = 8 / 20 given B .
P (deaf) = 4 / 20 , P(deaf and boy) = 2 / 20
Event = {deaf} and event = {boy} are not mutually exclusive
P(deaf or boy) = P(deaf) + P(boy) P(deaf and boy)
P(deaf or boy) = 4 / 20 + 8 / 20 -2 / 20 = 10 / 20 = 1 / 2

Statistical Independence Problem


Two random events A and B are statistically independent if and only At a middle school, 18% of all students play football and
if basketball and 32% of all students play football. What is the
probability that a student plays basketball given that the student
Thus, if A and B are independent, then their joint probability can be plays football?
expressed as a simple product of their individual probabilities.

P(football and basketball) = 0.18


Equivalently, for two independent events A and B,
P(basketball | football) = P(football and basketball) / P(football)
= 0.18 / 0.32
and
= 0.5625
In other words, if A and B are independent, then the conditional
probability of A, given B is simply the individual probability of A
alone; likewise, the probability of B given A is simply the probability
of B alone.

2
Theorem of Total Probability Bayes Theorem
Let B1, B2, ., BN be mutually exclusive events whose union
Given that B1, B2, ., BN are N partitions of a sample space .
equals the sample space S. We refer to these sets as Suppose that event A occurs, what is the probability of event
partitions of S. Bk?
An event A can be expressed as
A=A S=A (B1 B2 .. BN) Using the definition of conditional probability and theorem of
= (A B1) (A B2) (A BN) total probability, we obtain
Since B1, B2, ., BN are mutually exclusive,so P ( A | B k ). P ( B k )
P ( Bk | A)
P(A) = P(A B1) + P(A B2) + + P(A BN) N
P ( A | B m ). P ( B m )
and therefore m 1
B1 B2 BN
P(A) = P(A|B1) P(B1) + .
A This is known as Bayes theorem or Bayes rule and is one of
+ P(A|BN) P(BN) the most useful relations in probability and statistics.
B3 B4 BN-1

Binary Symmetric Channel Probabilities in BSC


We define two sets of probabilities for this channel.
Consider a symmetric memoryless channel used to
The a priori probabilities of sending s0 and s1 given by
transmit binary data.
P(A0) = p0 P(A1) = p1
Due to noise in the system, errors are possible, i.e. where A0 and A1 are the events of sending s0 and s1 respectively.
transmitted symbol s0 and be detected by the receiver as The conditional probabilities of error are given by
s1 and vice versa. P(B1|A0) = P(B0|A1) = p
The channel is symmetric in the sense that both type of and the conditional probabilities of NO error are given by
errors are equally probable. P(B0|A0) = P(B1|A1) = 1 - p
The channel is termed as memoryless in the sense that A0 1 p B0
the channel output at any time depends only on the
channel input at that time. p
p

A1 1-p B1

3
This document was created with Win2PDF available at http://www.daneprairie.com.
The unregistered version of Win2PDF is for evaluation or non-commercial use only.

Вам также может понравиться