Lecture 19: Autocorrelation Mark Hasegawa-Johnson All content CC-SA - - PowerPoint PPT Presentation

lecture 19 autocorrelation
SMART_READER_LITE
LIVE PREVIEW

Lecture 19: Autocorrelation Mark Hasegawa-Johnson All content CC-SA - - PowerPoint PPT Presentation

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary Lecture 19: Autocorrelation Mark Hasegawa-Johnson All content CC-SA 4.0 unless otherwise specified. ECE 401: Signal and Image Analysis, Fall 2020 Review


slide-1
SLIDE 1

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Lecture 19: Autocorrelation

Mark Hasegawa-Johnson All content CC-SA 4.0 unless otherwise specified. ECE 401: Signal and Image Analysis, Fall 2020

slide-2
SLIDE 2

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-3
SLIDE 3

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-4
SLIDE 4

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Review: Energy Spectrum and Parseval’s Theorem

The energy spectrum of a random noise signal has the DTFT form |X(ω)|2, or the DFT form |X[k]|2. The easiest form of Parseval’s theorem to memorize is the DTFT energy spectrum form:

  • n=−∞

x2[n] = 1 2π π

−π

|X(ω)|2dω The DFT energy spectrum form is similar, but over a finite duration:

N−1

  • n=0

x2[n] = 1 N

N−1

  • k=0

|X[k]|2

slide-5
SLIDE 5

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Review: Power Spectrum and Parseval’s Theorem

Energy of an infinite-length signal might be infinite. Wiener defined the power spectrum in order to solve that problem: Rxx(ω) = lim

N→∞

1 N |X(ω)|2 where X(ω) is computed from a window of length N samples. The DTFT power spectrum form of Parseval’s theorem is lim

N→∞

1 N

(N−1)/2

  • n=−(N−1)/2

x2[n] = 1 2π π

−π

Rxx(ω)dω

slide-6
SLIDE 6

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

White Noise

White noise is a type of noise whose samples are uncorrelated (E[x[n]x[m]] = E[x[n]]E[x[m]], unless n = m). If it is also zero mean and unit variance, then E [x[n]x[m]] =

  • 1

n = m n = m The Fourier transform of any zero-mean random signal is, itself, a zero-mean random variable: E [X(ω)] = 0 The power spectrum is also a random variable, but its expected value is not zero. The expected power spectrum of white noise is flat, like white light: E [Rxx(ω)] = E 1 N |X(ω)|2

  • = 1
slide-7
SLIDE 7

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: DTFT and Power Spectrum of White Noise

slide-8
SLIDE 8

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Expected DTFT and Power Spectrum of White Noise

slide-9
SLIDE 9

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Colored Noise

Most colored noise signals are well modeled as filtered white noise, i.e., y[n] = h[n] ∗ x[n]. The filtering means that the samples of y[n] are correlated with one another. If x[n] is zero-mean, then so is y[n], and so is Y (ω): E [Y (ω)] = 0 The expected power spectrum is |H(ω)|2: E [Ryy(ω)] = E 1 N |Y (ω)|2

  • = |H(ω)|2
slide-10
SLIDE 10

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Filtered Noise

slide-11
SLIDE 11

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-12
SLIDE 12

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Finite-Duration Power Spectrum

In practice, we will very often compute the power spectrum from a finite-length window: Rxx(ω) = 1 N |X(ω)|2, Rxx[k] = 1 N |X[k]|2 where X(ω) is computed from a window of length N samples. The DTFT power spectrum form of Parseval’s theorem is then 1 N

N−1

  • n=0

x2[n] = 1 2π π

−π

Rxx(ω)dω = 1 N

N

  • k=0

Rxx[k]

slide-13
SLIDE 13

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Inverse DTFT of the Power Spectrum

Since the power spectrum of noise is MUCH more useful than the expected Fourier transform, let’s see what the inverse Fourier transform of the power spectrum is. Let’s call Rxx(ω) the power spectrum, and rxx[n] its inverse DTFT. Rxx(ω) = 1 N |X(ω)|2 = 1 N X(ω)X ∗(ω) where X ∗(ω) means complex conjugate. Since multiplying the DTFT means convolution in the time domain, we know that rxx[n] = 1 N x[n] ∗ z[n] where z[n] is the inverse transform of X ∗(ω) (we haven’t figured

  • ut what that is, yet).
slide-14
SLIDE 14

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Inverse DTFT of the Power Spectrum

So what’s the inverse DFT of X ∗(ω)? If we assume that x[n] is real, we get that X ∗(ω) =

  • n=−∞

x[n]e−jωn ∗ =

  • n=−∞

x[n]ejωn =

  • m=−∞

x[−m]e−jωm So if x[n] is real, then the inverse DTFT of X ∗(ω) is x[−n]!

slide-15
SLIDE 15

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Autocorrelation

The power spectrum, of an N-sample finite-length signal, is Rxx(ω) = 1 N |X(ω)|2 Its inverse Fourier transform is the autocorrelation, rxx[n] = 1 N x[n] ∗ x[−n] = 1 N

  • m=−∞

x[m]x[m − n] This relationship, rxx[n] ↔ Rxx(ω), is called Wiener’s theorem, named after Norbert Wiener, the inventor of cybernetics.

slide-16
SLIDE 16

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Autocorrelation of White Noise

slide-17
SLIDE 17

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

A warning about python

Notice, on the last slide, I defined autocorrelation as rxx[n] = 1 N x[n] ∗ x[−n] = 1 N

  • m=−∞

x[m]x[m − n] Python defines an “energy version” of autocorrelation, instead of the “power version” shown above, i.e., np.correlate computes: rpython[n] =

  • m=−∞

x[m]x[m − n] The difference is just a constant factor (N), so it usually isn’t

  • important. But sometimes you’ll need to be aware of it.
slide-18
SLIDE 18

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Autocorrelation is also a random variable!

Notice that, just as the power spectrum is a random variable, the autocorrelation is also a random variable. The autocorrelation is the average of N consecutive products, thus E [rxx[n]] = E

  • 1

N

N−1

  • m=0

x[m]x[m − n]

  • = E [x[m]x[m − n]]

The expected autocorrelation is related to the covariance and the mean: E [rxx[n]] = Cov (x[m], x[m − n]) + E [x[m]] E [x[m − n]] If x[n] is zero-mean, that means E [r[n]] = Cov (x[m], x[m − n])

slide-19
SLIDE 19

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Autocorrelation of white noise

If x[n] is zero-mean white noise, with a variance of σ2, then E [rxx[n]] = E [x[m]x[m − n]] =

  • σ2

n = 0

  • therwise

We can write E [r[n]] = σ2δ[n]

slide-20
SLIDE 20

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-21
SLIDE 21

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Filtered Noise

What happens when we filter noise? Suppose that x[n] is zero-mean white noise, and y[n] = h[n] ∗ x[n] What is y[n]?

slide-22
SLIDE 22

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Filtering of White Noise

slide-23
SLIDE 23

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Filtered Noise

y[n] = h[n] ∗ x[n] =

  • m=−∞

h[m]x[n − m] y[n] is the sum of zero-mean random variables, so it’s also zero-mean. y[n] = h[0]x[n] + other stuff, and y[n + 1] = h[1]x[n] + other stuff. So obviously, y[n] and y[n + 1] are not uncorrelated. So y[n] is not white noise. What kind of noise is it?

slide-24
SLIDE 24

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

The variance of y[n]

First, let’s find its variance. Since x[n] and x[n + 1] are uncorrelated, we can write σ2

y = ∞

  • m=−∞

h2[m]Var(x[n − m]) = σ2

x ∞

  • m=−∞

h2[m]

slide-25
SLIDE 25

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

The autocorrelation of y[n]

Second, let’s find its autocorrelation. Let’s define rxx[n] = 1

N x[n] ∗ x[−n]. Then

ryy[n] = 1 N y[n] ∗ y[−n] = 1 N (x[n] ∗ h[n]) ∗ (x[−n] ∗ h[−n]) = 1 N x[n] ∗ x[−n] ∗ h[n] ∗ h[−n] = rxx[n] ∗ h[n] ∗ h[−n]

slide-26
SLIDE 26

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Autocorrelation of Colored Noise

slide-27
SLIDE 27

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Expected autocorrelation of y[n]

ryy[n] = rxx[n] ∗ h[n] ∗ h[−n] Expectation is linear, and convolution is linear, so E [ryy[n]] = E [rxx[n]] ∗ h[n] ∗ h[−n]

slide-28
SLIDE 28

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Expected autocorrelation of y[n]

x[n] is zero-mean white noise if and only if its autocorrelation is a delta function: E [rxx[n]] = σ2

xδ[n]

If y[n] = h[n] ∗ x[n], and x[n] is zero-mean white noise, then E [ryy[n]] = σ2

x (h[n] ∗ h[−n])

In other words, x[n] contributes only its energy (σ2

x). h[n]

contributes the correlation between neighboring samples.

slide-29
SLIDE 29

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Expected Autocorrelation of Colored Noise

slide-30
SLIDE 30

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example

Here’s an example. The white noise signal on the top (x[n]) is convolved with the bandpass filter in the middle (h[n]) to produce the green-noise signal on the bottom (y[n]). Notice that y[n] is random, but correlated.

slide-31
SLIDE 31

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example

Here’s another example. The white noise signal on the left (x[n]) is convolved with an ideal lowpass filter, with a cutoff at π/2, to create the pink-noise signal on the right (y[n]). Notice that y[n] is random, but correlated.

slide-32
SLIDE 32

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example

Here’s a third example. The white noise signal on the left (x[n]) is convolved with an ideal highpass filter, with a cutoff at π/2, to create the blue-noise signal on the right (y[n]). Here, it’s a lot less

  • bvious that the samples of y[n] are correlated with one another,

but they are: in fact, they are negatively correlated. If y[n] > 0, then y[n + 1] < 0 with a probability greater than 50%.

slide-33
SLIDE 33

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-34
SLIDE 34

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Power Spectrum of Filtered Noise

So we have ryy[n] = rxx[n] ∗ h[n] ∗ h[−n]. What about the power spectrum? Ryy(ω) = F {ryy[n]} = F {rxx[n] ∗ h[n] ∗ h[−n]} = Rxx(ω)|H(ω)|2

slide-35
SLIDE 35

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example

Here’s an example. The white noise signal on the top (|X[k]|2) is multiplied by the bandpass filter in the middle (|H[k]|2) to produce the green-noise signal on the bottom (|Y [k]|2 = |X[k]|2|H[k]|2).

slide-36
SLIDE 36

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Units Conversion

The DTFT version of Parseval’s theorem, assuming a finite window

  • f length N samples, is

1 N

  • n

x2[n] = 1 2π π

−π

Rxx(ω)dω Let’s consider converting units to Hertz. Remember that ω = 2πf

Fs ,

where Fs is the sampling frequency, so dω = 2π

Fs df , and we get that

1 N

  • n

x2[n] = 1 Fs Fs/2

−Fs/2

Rxx 2πf Fs

  • df

So we can use Rxx

  • 2πf

Fs

  • as if it were a power spectrum in

continuous time, at least for − Fs

2 < f < Fs 2 .

slide-37
SLIDE 37

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Power Spectrum of Colored Noise

slide-38
SLIDE 38

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Expected Power Spectrum of Colored Noise

slide-39
SLIDE 39

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-40
SLIDE 40

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Parseval’s Theorem

Now we have everything we need to prove Parseval’s theorem. Let’s prove the DTFT power form of the theorem, for a finite-length signal: 1 N

N−1

  • n=0

x2[n] = 1 2π π

−π

Rxx(ω)dω where Rxx(ω) = 1 N |X(ω)|2

slide-41
SLIDE 41

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Parseval’s Theorem

1 N

N−1

  • n=0

x2[n] = 1 2π π

−π

Rxx(ω)dω Notice that the left-hand side is the autocorrelation, with a lag of 0: rxx[m] = 1 N

N−1

  • n=0

x[n]x[n − m] So Parseval’s theorem is just saying that rxx[0] = 1 2π π

−π

Rxx(ω)dω

slide-42
SLIDE 42

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Wiener’s Theorem

Wiener’s theorem says that the power spectrum is the Fourier transform of the autocorrelation: rxx[n] = 1 2π π

−π

Rxx(ω)ejωndω But notice what happens if we plug in n = 0: rxx[0] = 1 2π π

−π

Rxx(ω)dω Q.E.D.

slide-43
SLIDE 43

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-44
SLIDE 44

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Autocorrelation of White Noise

slide-45
SLIDE 45

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Power Spectrum of White Noise

slide-46
SLIDE 46

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Expected Power Spectrum of White Noise

slide-47
SLIDE 47

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Filtering of White Noise

slide-48
SLIDE 48

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Power Spectra of White and Colored Noises

slide-49
SLIDE 49

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Autocorrelation of Colored Noise

slide-50
SLIDE 50

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Power Spectrum of Colored Noise

slide-51
SLIDE 51

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Example: Expected Power Spectrum of Colored Noise

slide-52
SLIDE 52

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Outline

1

Review: Power Spectrum

2

Autocorrelation

3

Autocorrelation of Filtered Noise

4

Power Spectrum of Filtered Noise

5

Parseval’s Theorem

6

Example

7

Summary

slide-53
SLIDE 53

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Wiener’s Theorem and Parseval’s Theorem

Wiener’s theorem says that the power spectrum is the DTFT

  • f autocorrelation:

rxx[n] = 1 2π π

−π

Rxx(ω)ejωndω Parseval’s theorem says that average power in the time domain is the same as average power in the frequeny domain: rxx[0] = 1 2π π

−π

Rxx(ω)dω

slide-54
SLIDE 54

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

Filtered Noise

If y[n] = h[n] ∗ x[n], x[n] is any noise signal, then ryy[n] = rxx[n] ∗ h[n] ∗ h[−n] Ryy(ω) = Rxx(ω)|H(ω)|2

slide-55
SLIDE 55

Review Autocorrelation Autocorrelation Spectrum Parseval Example Summary

White Noise and Colored Noise

If x[n] is zero-mean unit variance white noise, and y[n] = h[n] ∗ x[n], then E [rxx[n]] = δ[n] E [Rxx(ω)] = 1 E [ryy[n]] = h[n] ∗ h[−n] E [Ryy(ω)] = |H(ω)|2