Download Lab1 Presentation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
Communication Theory
Lab (1)
Prepared by:
Eng.Nerin Ashraf
Agenda




Random Variable Definition
Types of Random Variables
Types and Features
Task
Random Experiment


It is an experiment whose outcome cannot be predicted with
certainty
Examples:
Tossing a Coin
Rolling a Die
Random Variable Definition


A variable that results due to a random process
Example:
1.
2.
Rolling a dice
Tossing a coin
Types of Random variables
Discrete Random Variables
The random variable can only take a finite number of values (ex: tossing
a coin)
Continuous Random Variables
The random variable can take a continuum of values (phase of the carrier)
Mean of a Random Variable
Discrete Random Variable
n
  E( X )   xi P( X  xi )
i 1
E (.) is called expectatio n of (.)
Continuous Random Variable

  E( X )   x f X ( x) dx

f X (x) is probabilit y density function of x
Mean of Discrete Random Variable


Probability mass function P[X=x]
Mean: Weighted average
  (1  0.2)  (3  0.5)  (7  0.3)  3.8
  ( 16)  (1  2  3  4  5  6)  3.5
Probability Density Functions: (Continuous random
variables)
f X x 


a
 f x dx
X


b
P(a  x  b)   f X ( x)
a
Probability density f(x)

P X  a  
X
x
takes on
f X x 
• Properties of probability density function:
f X ( x) 1
 f x dx

a
gives the probability that a random variable x
A probability density function:
values within a range.

P X  a  
a
x
0 a
b
Variance of the random variable

Variance is a measure of the randomness of the
random variable i.e it is a measure of the amount of
variation within the values of the random variable.
Variance of the random variable
• Discrete
Random Variable:
n
Var ( X )  E[( X   ) 2 ]
Var(X)   ( xi   ) P( X  xi )
2
i 1
• Continuous
Random Variable:
Var ( X ) 

 x   

2
f X ( x) dx
where   E ( X ) is the mean of the r.v. X
and f X ( x) is the probabilit y density function
Example: Gaussian Random Variable

Probability density function:
2

1
 x   x  
f X ( x) 
exp 

2
2
2 x
 2 x

Where


 x is the mean of the random variable x.
 x2 is the variance of x.
Gaussian (Normal) RV
Fx [ x] 

1
2
m: mean
 2 : variance
2
e
( xm)2
2 2
Task 1

It is required to generate 1000 normally distributed
samples with mean 3 and variance 2
Add the previous samples to another 1000 normally
distributed samples with mean 4 and variance 3
Get the mean and the variance of the resulted signal

What do you notice ?




Variancetotal = Variance1 + Variance2
meantotal = mean1 + mean2
Task 2


Plot the probability density functions of the previous
example on the same graph
Notice the mean of the plotted functions from the graph
Useful Commands

normrnd(mean, standard deviation, number of rows,
number of columns)