Sunteți pe pagina 1din 9

Signals and Systems

Problem Set:
Power Spectral Density and White Noise
Problem Set
For all questions, time signals x[n] are real-valued and wide sense stationary.
Problem 1
Show that the auto-correlation function is even, that is
R
xx
[k] = R
xx
[k] .
Problem 2
Show that the power spectral density function is even, that is
S
xx
() = S
xx
() .
Problem 3
Show that the power spectral density is real.
Problem 4
Show that the power spectral density is nonnegative, that is
S
xx
() 0 .
Note: This is not an easy question!
Problem 5
Let
y [n] =
x[n] +x[n 1]
2
,
where x[n] is white noise. Calculate the auto-correlation function R
yy
[k] and the power spectral
density S
yy
().
Problem 6
Let
y [n] = x
1
[n] +x
2
[n] ,
where x
1
[n] and x
2
[n] are independent and zero mean, implying that
E (x
1
[n
1
] x
2
[n
2
]) = 0 n
1
, n
2
.
Show that
S
yy
() = S
x
1
x
1
() +S
x
2
x
2
() .
2
Problem 7
Show that the cross-correlation function satises
R
xy
[k] = R
yx
[k]
and that
S
xy
() = S
yx
() .
Problem 8
Come up with a simple example where the power spectral density S
xy
() is complex.
Problem 9
Using Matlab, calculate the auto-correlation function and the power spectral density of the
signal
x[n] = sin
_
10n
N
_
+N (0, 1) ,
where N = 1024 is the number of elements of x, and N (0, 1) is Gaussian noise with mean zero
and variance one.
Note: When numerically calculating the auto-correlation function of an N-sample signal, we can
use the following denition:
1
N
N1

n=0
x[n] x[n k]
which assumes that x[n] is periodic. An example of code that performs this summation appears
in the le white noise.m, available on the course website. When calculating the power spectral
density, use the Discrete Fourier Transform. (i.e. The Matlab command fft)
Plot the signal, its auto-correlation, and its power spectral density. Conrm that the power
spectral density is real and positive. (Hint: numerical errors may result in small imaginary
values, so you may wish to use the command real.) Also calculate the signals DFT and
compare the square of the absolute value of the Fourier coecients with the power spectral
density. By what factor do they dier? Can you explain this?
3
Sample Solutions
Problem 1 (Solution)
The auto-correlation function is dened as
R
xx
[k] = E(x[n] x[n k])
which gives us
R
xx
[k] = E(x[n] x[n +k]) .
Substituting m = n +k we get
R
xx
[k] = E(x[mk] x[m]) ,
which is exactly R
xx
[k].
Problem 2 (Solution)
The power spectral density is the Fourier Transform of the auto-correlation function:
S
xx
() =
+

k=
R
xx
[k] e
jk
which gives us
S
xx
() =
+

k=
R
xx
[k] e
+jk
Substituting l = k we get
S
xx
() =
+

l=
R
xx
[l] e
jl
Using the result of Problem 1 (R
xx
[k] = R
xx
[k]) this is identical to
S
xx
() =
+

l=
R
xx
[l] e
jl
,
which is S
xx
().
Problem 3 (Solution)
We can rewrite the power spectral density as
S
xx
() =
1

k=
R
xx
[k] e
jk
+R
xx
[0] +

k=1
R
xx
[k] e
jk
.
Again using the result that R
xx
[k] = R
xx
[k], this is identical to
S
xx
() = R
xx
[0] +

k=1
R
xx
[k]
_
e
jk
+e
+jk
_
,
where the complex conjugates can be rewritten as
S
xx
() = R
xx
[0] +

k=1
R
xx
[k] (2 cos (k)) .
4
Problem 4 (Solution)
First proof
We may consider the autocorrelation as an innite sum
R
xx
[k] = E (x[n] x[n k])
= lim
N
1
2N + 1
N

n=N
x[n] x[n k] .
Using the denition of power spectral density we may then write
S
xx
() =

k=
R
xx
[k] e
jk
=

k=
lim
N
1
2N + 1
N

n=N
x[n] x[n k] e
jk
= lim
N
1
2N + 1
N

n=N
x[n]

k=
x[n k] e
jk
= lim
N
1
2N + 1
N

n=N
x[n]

m=
x[m] e
j(nm)
= lim
N
1
2N + 1
N

n=N
x[n] e
jn

m=
x[m] e
jm
.
Now consider that since for N 0,
1
2N + 1
> 0.
Using this, and the fact that x[n] is a real-valued sequence, we nd that
sgn (S
xx
()) = sgn
_

n=
x[n] e
jn

m=
x[m] e
jm
_
= sgn (X () X ())
= sgn
_
X () X ()
_
= sgn
_
|X () |
2
_
= 1.
Second proof
Assume that the signal x[n] is the input signal into a system. Now suppose our system is an
ideal bandpass lter H () of the following form:
5
1

0
w

0
w
|H ()|
When applying an linear time-invariant system to our input signal, the power spectral density
of the output is
S
yy
() = |H ()|
2
S
xx
() .
We now apply the inverse Fourier Transform to calculate the auto-correlation of the output
signal R
yy
[0] of the bandpass lter:
R
yy
[0] =
1
2
_

|H ()|
2
S
xx
() d
=
1

_

0
+
w
2

w
2
S
xx
() d .
For the output signal to be real, R
yy
[0] must be nonnegative. If we let w go to zero, the limit
case can be expressed as
R
yy
[0] lim
w0
w

S
xx
(
0
) .
For R
yy
[0] to be nonnegative, S
xx
(
0
) must be nonnegative. Since
0
was arbitrarily chosen,
this must hold for all . Therefore,
S
xx
() 0 .
Problem 5 (Solution)
The auto-correlation function is
R
yy
[k] = E (y [n] y [n k])
= E
_
x[n] +x[n 1]
2
x[n k] +x[n k 1]
2
_
=
1
4
E(x[n] x[n k] +x[n] x[n k 1] +x[n 1] x[n k] +x[n 1] x[n k 1]) .
Since R
yy
[k] only depends on the dierence of the indices, this can be rewritten as
R
yy
[k] =
1
4
(2E (x[n] x[n k]) +E (x[n] x[n k 1]) +E (x[n] x[n k + 1])) ,
which, assuming x to be white noise, gives
R
yy
[k] =
_

_
0 for |k| 2 ,
1
4
for |k| = 1 ,
1
2
for k = 0 .
6
The Fourier Transform is then easy to apply:
S
yy
() =
+

k=
R
yy
[k] e
jk
S
yy
() =
1
4
e
j
+
1
2
+
1
4
e
j
=
1
2
+
1
2
cos ()
Problem 6 (Solution)
The auto-correlation function is
R
yy
[k] = E(y [n] y [n k])
= E((x
1
[n] +x
2
[n]) (x
1
[n k] +x
2
[n k]))
= E(x
1
[n]x
1
[n k] +x
1
[n]x
2
[n k] +x
2
[n]x
1
[n k] +x
2
[n]x
2
[n k]) .
Because of the independance of x
1
and x
2
, the middle two terms are zero and we can rewrite
the correlation function to
R
yy
[k] = E(x
1
[n]x
1
[n k]) +E (x
2
[n]x
2
[n k])
= R
x
1
x
1
[k] +R
x
2
x
2
[k]
Due to the linearity of the Fourier Transform,
S
yy
() = S
x
1
x
1
() +S
x
2
x
2
()
Problem 7 (Solution)
We write down the denition of cross-correlation, then use the fact that reindexing does not
change it, and see that this immediately produces the desired result:
R
xy
[k] = E (x[n] y [n +k])
= E (x[n k] y [n])
= R
yx
[k]
We use the above result to prove the cross-power spectral densities relationship:
S
xy
() =

k=
R
xy
[k] e
jk
=

k=
R
yx
[k] e
jk
=

m=
R
yx
[m] e
jm
= S
yx
()
7
Problem 8 (Solution)
Assuming real signals x and y, R
xy
[k] is always real. Therefore, signals resulting in a complex
power spectral density must fulll
R
xy
[k] = R
xy
[k] ,
meaning that the decomposition used in Problem 3 does not eliminate the complex components.
A simple example of this can be constructed assuming x[n] to be white noise and
y [n] = x[n 1] ,
resulting in
R
xy
[1] = E (x[n]x[n 2]) = 0 ,
R
xy
[1] = E (x[n]x[n]) = 1 .
It is easy to show that R
xy
[k] is zero for all k = 1. The power spectral density is then
S
xy
() =
+

k=
R
xy
[k] e
jk
S
xy
() = 1e
j
= cos () +j sin ()
Problem 9 (Solution)
The following are Matlab commands. We begin by creating the signal and plotting it:
>> N = 1024;
>> n = 1:N; n = n(:);
>> x = sin(10*pi*n/N) + randn(N,1);
>> figure; plot(x);
Now we use some code from white noise.m (see announcement of 12 Nov on the class website)
to estimate the signals auto-correlation function. We then plot it:
>> xx = [x;x];
>> r = zeros(N,1);
>> for k = 1:N r(k) = sum(x.*xx(k:N+k-1) ); end
>> r = r/N;
>> figure; plot(r);
We now calculate its power spectral density, and check that it is real positive:
>> s = fft(r);
>> max(abs(imag(s)))
>> min(real(s))
The second command above returned 2.1839e-11. We assume that this is small enough to be
explained by numerical error, and that the power spectral density is therefore real. The last
command returned 6.2887, which conrms that the power spectral density is positive.
To compare to square of the absolute value of the Fourier coecients with the power spectral
density, we do:
8
>> plot(abs(fft(x)).^2./real(s))
We see from this that the square of the absolute value of the Fourier coecients are exactly N
times larger than the power spectral density. When Matlab calculates the DFT with fft, it
does not use the divisor N. (This may be seen by typing help fft at the Matlab command
prompt.) An inspection of the rst proof of Problem 4 shows that using this denition of the
DFT, the only dierence between the power spectral density and the square of the absolute
value of the Fourier coecients, is the factor of N calculated above.
9

S-ar putea să vă placă și