A1122 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A11 · Lesson 22 · Covariance and correlation

When two noises move together

A differential pair carries a signal as the difference between two wires. Interference couples into both wires, 10 mV of noise on each. If the two noises were unrelated, the difference would carry 14 mV of noise. But the wires run side by side, so the noise on them rises and falls together, and the difference carries much less. How much less depends on one number, the correlation between the two noises. It also explains when adding noisy signals helps and when it hurts.

  • The shading is the joint density of two noise voltages X and Y, each with standard deviation 1, and correlation ρ.
  • At ρ=0 the contours are circles. Raise ρ: the density stretches along the line y=x, because the two tend to move together.
  • The readouts give the spread of the sum and of the difference. Which one a differential receiver uses explains why twisted pairs work.

Predict

Each wire of a differential pair picks up noise of 10 mV RMS, with correlation 0.9 between the wires. What noise is left in the difference?

Name it

Covariance

Cov(X,Y)=E[(X−μX)(Y−μY)]=E[XY]−μXμY

It's positive when X and Y tend to be above their means together, negative when one tends to be high while the other is low. Cov(X,X)=Var(X).

Correlation

Covariance depends on units. Dividing by both standard deviations gives a pure number, the correlation coefficient:

ρ=Cov(X,Y)σXσY,−1≤ρ≤1

ρ=±1 means Y is exactly a straight-line function of X. ρ=0 means uncorrelated.

Variance of sums and differences

Var(aX+bY)=a2σX2+b2σY2+2abCov(X,Y)
  • Sum: σX2+σY2+2ρσXσY. Correlated noises add more than in quadrature.
  • Difference: σX2+σY2−2ρσXσY. Positively correlated noise cancels: common-mode rejection.

The root-sum-square rule of lesson 9 is the special case ρ=0.

Independent versus uncorrelated

Independent variables have Cov=0, because E[XY]=E[X]E[Y] when the joint density factors. The reverse fails: correlation only measures straight-line association. With X uniform on [−1,1] and Y=X2, Y is completely determined by X, yet Cov(X,Y)=E[X3]−E[X]E[X2]=0. For jointly Gaussian variables, and only then in general, uncorrelated does mean independent.

Worked example

Two sensors read the same temperature. Each has noise of 0.2 °C RMS, and their noises have correlation 0.3 (they share a power supply). How noisy is their average?

Show the solution
  1. Variance of the average. Var(X+Y2)=14(0.04+0.04+2×0.3×0.04)=0.1044=0.026 so the RMS is 0.161 °C.
  2. Compare with uncorrelated sensors. They would give 0.22=0.141∘C
  3. Why. The shared noise doesn't average away.

Answer their average has 0.161 °C RMS of noise, against 0.141 °C for uncorrelated sensors.

Worked example

X has mean 2 and Y has mean 3, with E[XY]=7, σX=1 and σY=2. Find the covariance and correlation.

Show the solution
  1. Covariance. Subtract the product of the means from E[XY]: Cov=7−2×3=1
  2. Correlation. Divide by the two standard deviations: ρ=11×2=0.5

Answer the covariance is 1 and the correlation 0.5.

Worked example

Two sensors each have 0.2 °C of noise, with correlation 0.5. How noisy is the difference of their readings?

Show the solution
  1. Variance of the difference. Var(X−Y)=σX2+σY2−2ρσXσY=0.04+0.04−0.04=0.04 so the difference has 0.2 °C of noise, the same as either sensor alone.
  2. Why. Positive correlation helps differences and hurts sums: common-mode noise cancels when you subtract, which is why differential measurements are used.

Answer the difference has 0.2 °C of noise, the same as either sensor alone.

Check

E[XY] = 7, E[X] = 2 and E[Y] = 4. What is Cov(X,Y)?

Check

Cov(X,Y) = 0.5, σX = 1 and σY = 3. What is the correlation coefficient?

Check

Noises with RMS 3 and 2 mV and correlation −0.5 add. What is the RMS of the sum?

Check

Both wires of a differential pair pick up 5 mV RMS of noise, with correlation 0.8. How much noise is in the difference?

Check

X and Y are independent with standard deviations 2 and 3. What is the standard deviation of 2X−1Y?

Check

X and Y have zero covariance. What follows?

Check

Two sensors each have noise 0.1 with correlation 0.3.

(a)

What is the noise of their difference?

(b)

What is the noise of their average?

Check

X and Y have means mx and my and E[XY]=Exy.

Step 1

What is their covariance?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why does a differential receiver reject noise that couples equally into both wires?

Practice

Keep practicing

9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.