ex5m6_6.doc

advertisement
Random Signals for Engineers using MATLAB and Mathcad
Copyright  1999 Springer Verlag NY
Example 6.6 Power Density Functions
In the example we will compute the power density function of several correlation functions of
random processes. We make use of the integrals of Equation. 6.6-1,2 and perform the direct integration. In
some situations we make use of the Fourier transform theorems to simplify our work.
The two-elementary power density spectrums to be evaluated are associated with a process that is a random
constant. The correlation function for this process is given as
R   C
Direct substitution into Equation. 6.6-1 with n instead of  so we can take the limit, gives
syms om tau C n
Som=int(exp(-i*om*tau)*C,tau,-n,n);
pretty(simplify(Som))
C sin(n om)
2 ----------om
As we let n -> , the sin(x) / x approximates a pulse that is /n wide and this pulse is scaled by n resulting
in a pulse that has an area 2  that is independent of n and, therefore, is an impulse of strength 2 . The
power density spectrum is
S    C  2      
The complimentary case where the correlation function is an impluse will yield a power density function of
a constant since the transform pairs, Equation. 6.6-1,2, are symmetrical except for scaling. Performing
these operations we have
R     
maple('int','Dirac(t)*exp(-i*om*t),t=-inf..inf')
ans =
1
The power density spectrum integral can be evaluated by the definition of the impulse integral as the value
of the kernel at  = 0
S    e  j 0  1
We next evaluate the correlation function
R   e  c 
Substitution in the power density integral we have
syms tau c om
cgt=sym('c>0');
maple('assume',cgt);
Som=int(exp((c-i*om)*tau),tau,-inf,0)+int(exp((-ci*om)*tau),tau,0,inf);
pretty(Som)
1
1
- ---------- + ---------c~ + i om
c~ + i om
Matlab evaluated the integral at the limit using the assume statement. Simplifying we have
simplify(Som)
ans =
-2*c/(-c+i*om)/(c+i*om)
Expand the denominator
den=expand((-c+i*om)*(c+i*om))
den =
-c^2-om^2
Combining we obtain
pretty(2*c/-den)
c~
2 --------2
2
c~ + om
We may plot the correlation and power density function
tp=-4:.05:4;
omp=-4:.05:4;
Rtau=exp(-abs(tp));
Somp=2./(1+omp.^2);
subplot(1,2,1); plot(tp,Rtau);xlabel 'tau - sec';ylabel 'R(tau)'
subplot(1,2,2);plot(omp,Somp);xlabel 'om - rad/sec';ylabel 'S(om)'
2
0.9
1.8
0.8
1.6
0.7
1.4
0.6
1.2
S(om)
R(tau)
1
0.5
1
0.4
0.8
0.3
0.6
0.2
0.4
0.1
0.2
0
-4
-2
0
tau - sec
2
4
0
-4
-2
0
2
om - rad/sec
4
The next correlation function is associated with the binary transmission waveform in example 5.6 or
 

R   1  T
 0
 T
otherwize
The power spectrum can be derived directly from the integral or may be derived using transform theorems.
We will illustrate the latter technique. Let us find the power spectrum of a bandlimited correlation function
 T
1
R   
0 otherwize
Direct evaluation of the power spectrum integral yields
syms T
Som=simplify(int(exp(-i*om*tau),tau,-T/2,T/2))
Som =
2*sin(1/2*T*om)/om
We may notice that the binary transmission correlation function can be found by convolving the limited
correlation function with itself. This can be illustrated by having Matlab numerically evaluate this
convolution integral. First define the function for the correlation as
function y= f6_6(t,T)
% amplitude limited function
for i=1:length(t)
if abs(t(i)) < T/2
y(i)=1;
else
y(i)=0;
end
and then the kernel of the convolution integral
function y= fint6_6(a,t,T)
% convolution integral kernel
y=f6_6(t+a,T).*f6_6(a,T);
and perform the numerical integration and ignoring the error messages
t=-3:.05:3;
T=1;
for i=1:length(t)
f(i)=quad('fint6_6',-T/2,T/2,[],[],t(i),T);
end
figure
plot(t,f)
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3
-2
-1
0
1
2
3
The TOL of the numerical integration was chosen to speed up the computation and therefore the
representation of the integral is not entirely accurate
The power density function for the binary transmission waveform can therefore be computed by taking the
product of the bandlimited power density spectrum with itself. This is in accordance with the Fourier
transform theorem the states that convolution in the time domain is equivalent to multiplication in the
frequency domain or
syms om T
Sb=(2/om*sin(1/2*om*T))^2;
pretty(Sb)
2
sin(1/2 T om)
4 -------------2
om
syms x
Sbp=subs(Sb,[om T], [x 1])
ezplot(Sbp,[-40 40])
axis([-40 40 0 1.5])
Sbp =
4*sin(1/2*x)^2/x^2
4*sin(1/2*x)^2/x^2
1.5
1
0.5
0
-40
-30
-20
-10
0
x
10
20
30
40
The last two pairs to be evaluated are associated with the shifting or frequency translation theorem that
states that translation in the frequency domain by 0 or f( - 0) is equivalent to multiplication by e-j0 
in the time domain. When we take the correlation function of
R( )  cos( 0 )
Expanding the cosine we obtain
R( ) 
e i0  e i0
2
which can be recognized as the sum of two constants equal to 1/2 multiplied by the exponential. We have
already found the power density spectrum of a constant and to compute the power spectrum of a cosine we
apply the shifting theorem.
omgt=sym('om>0');
maple('assume',omgt);
fcos=maple('fourier','cos(om*t),t,w')
fcos =
pi*Dirac(w-om)+pi*Dirac(w+om)
The complex exponential correlation function can also be found directly or by using the shifting theorem
noted above
fcosx=maple('fourier','cos(om*t)*exp(-c*abs(t)),t,w')
fcosx =
c/(c^2+(w-om)^2)+c/(c^2+(w+om)^2)
Reentering the expression to Matlab to allow pretty printing
syms w
fcosx=c/(c^2+(w-om)^2)+c/(c^2+(w+om)^2);
pretty(fcosx)
c~
c~
---------------- + ----------------
2
c~
2
+ (w - om~)
2
c~
2
+ (w + om~)

Download