Digital Signal Processing Reference
In-Depth Information
a
UNIFORM RANDOM VARIABLE IN [0,1]
b
UNIFORM RANDOM VARIABLE IN [0,1]
1.2
1.2
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
0
0.2
0.4
0.6
0.8
1
0
0.2
0.4
0.6
0.8
1
x
x
Fig. 2.20 ( a ) PDF and ( b ) distribution of the uniform random variable in the interval [0, 1]
The uniform variable in the interval [0, 1] can be generated in MATLAB using
the file rand.m. Figure 2.21a shows the generated uniform variable X with
N ¼ 10,000 values, while Fig. 2.21b shows only the first 1,000 samples. From
Fig. 2.21 , it is evident why the variable is called “uniform” (Its values uniformly
occupy all of the range).
In order to estimate the PDF of the random variable X , we divide the range of the
variable [0, 1] into M equidistant cells
Dx .
The histogram , NN ¼ hist( x , M ) shows the values Ni , i ¼ 1,
, M (i.e., how
many values of the random variable X are in each cell), where M is the number of
cells. If we use M ¼ 10, we get for example, the following result:
...
NN ¼ ½ 952
;
994
;
993
;
1
;
012
;
985
;
1
;
034
;
1
;
006
;
998
;
1
;
047
;
979 :
(2.99)
The result ( 2.99 ) shows that from N ¼ 10,000 values of the random variable,
952 are in the first cell, 994 in the second cell, and so on. We can also note that the
number of values in the cells do not vary significantly.
UNIFORM RANDOM VARIABLE in [0,1], N=10000
FIRST 1000 SAMPLES OF UNIFORM RV in [0,1]
1
0.9
0.8
0.7
0.6
0.5
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0.4
0.3
0.2
0.1
0
n
n
Fig. 2.21 Uniform variable generated in MATLAB
Search WWH ::




Custom Search