# Correlation and filtering

I am trying to get an understanding of white noise and how it can be filtered out, etc. For that I'd like to understand correlation.

What would the autocorrelation of white noise look like? If I am not mistaken, it should look like a delta function at t=0 since at all other values there is no correlation at all. Is this correct?

What about when this is added to a signal. Say you have a sine wave and you add white noise. What would happen if you autocorrelate this signal? Would the noise disappear or would it just stay the same or what?

And what if you simply cross-correlated a white noise signal with a sinusoid. Would the correlation always be zero? How is the phase affected?

And finally, the main question this all builds up to: How is correlation used to filter out noise from a signal? What has to be known about the signal for this method to work?

• You can probably get a good answer to this question here, but if you want to go deeper you might want to check out dsp.stackexchange.com. – The Photon Sep 29 '14 at 16:25
• I was under the impression that that site was not fully functional but I'll check it out. Thanks for the tip. I'd still like an answer from here if possible. – farid99 Sep 29 '14 at 16:34
• Traffic is lower there, but afaik the site is fully functional and there are several strong participants answering there. – The Photon Sep 29 '14 at 16:38
• Should also add, it's considered rude to cross-post --- better to wait and see if you get a good answer here; or request migration if you think the other site is a better one for your question. – The Photon Sep 29 '14 at 16:39
• Thanks for the warning. I've deleted my question on the other stack. – farid99 Sep 29 '14 at 16:42

What would the autocorrelation of white noise look like? If I am not mistaken, it should look like a delta function at t=0 since at all other values there is no correlation at all. Is this correct?

This is correct. Of course if you calculate the autocorrelation from samples taken over a non-inifinite time span the mean will be 0 for $t \ne 0$, but will be some noise in the output.

What about when this is added to a signal. Say you have a sine wave and you add white noise. What would happen if you autocorrelate this signal? Would the noise disappear or would it just stay the same or what?

I'm not 100% sure of this, but I believe autocorrelation is a linear process. So you would get an output that is the sum of the autocorrelations of the noise and the sine wave taken individually. This would be a delta at t=0 due to the noise, plus a $\pi/2$ shifted sine wave due to the sinusoid.

Again there would be artifacts if you don't have an inifinite span of samples to calculate from.

And what if you simply cross-correlated a white noise signal with a sinusoid. Would the correlation always be zero? How is the phase affected?

The cross-correlation would be zero.

I'm not sure what you mean about the phase. What is the phase of zero?

• Fantastic! I understand all of that. However, I'm not sure how correlation can be used for signal processing and filtering. How is white noise removed using correlation? I know this is a broad question but I'm just trying to gain a basic understanding of it. – farid99 Sep 29 '14 at 16:41
• You should edit your question, or ask a new one, making it clear what you want an answer to. – The Photon Sep 29 '14 at 16:58

How is white noise removed using correlation? I know this is a broad question but I'm just trying to gain a basic understanding of it.

In a simple example, if you recorded 10 seconds of audio and transmitted it through a noisy medium (or added white noise to it) the received audio may become very indistinct and difficult for your ears to make out the words. If you transmitted the same audio sample twice (each time becoming corrupted with "different" white noise) you'd end up with 2 versions of almost the same thing.

Both received messages would be individually hard to decipher but, if you mathematically added them together the magic starts to happen. Clearly the wanted audio part of the message would double in amplitude so that's a 6dB increase in the wanted signal but, the noise (because it is basically random) would add like this: -

Total noise = $\sqrt{A_{NOISE}^2 + B_{NOISE}^2}$ and this is only an increase in RMS of 3dB.

End result is a 3dB increase in signal to noise ratio. If you transmitted four samples of the same audio you'd add two pairs together and each would yield 3dB increase in SNR and then you added the two sums to get another 3dB.

It's a simple example of how noise can be removed.

• I would call that signal averaging. Correlated noise measurements are done to remove amplifier noise from a noise measurement. Here's the trick. Say you want to measure the Johnson noise of a resistor. The amplifier noise adds to it. But say instead you looked at one resistor with two identical amps. (Each adding their own uncorrelated noise.) And then you multiplied (not added) those two signals together. The correlated noise from the resistor remains and the uncorrelated noise from each amp cancels totally, (given enough time.) – George Herold Sep 29 '14 at 18:58

Fun, OK in theory the auto-correlation of white noise is a delta function. But in practice the noise will always have a finite bandwidth, (At high enough frequency this is set by Planks constant, the so called ultra-violet catastrophe of black body radiation, but we rarely get that high with electronics.) and the width of the auto-correlation function is determined by the bandwidth of the noise. Now the sum of a sine wave and noise, is as The Photon said. A delta and a sine.

Cross correlation of a sine and noise will on average go to zero, but on the short term it tells you something about noise at that frequency and phase. (at that time.) (I think about cross correlation as multiplying, so if I multiply a sine by noise what do I get?)

Now here's a fun way to see the auto-correlation function if you have a digital 'scope.
1.) Get a noise signal

2.) Gain it up so it fills the scope display. (but doesn't go off screen)

3.) set the trigger on normal and trigger at the very top of the noise. (The very top is a little hard to define since it's noise, but say so the 'scope triggers several times a second.)

4.) now set the scope to average, with the maximum number of traces. What you see is the auto-correlation function* of the noise. (I can post 'scope shots if there is any interest.)

*OK for the purist's this is not really the auto-correlation function. We call it the qacf (quasi-auto correlation function) and I think others might call it a conditional correlation. (because it looks at the correlation given some condition.. like the 'scope trace was rising and crossed the trigger threshold.) Still, I find this is a powerful 'scope trick for finding the bandwidth of noise. And to see if there is any correlated interference in my signal.

Edit: I just wanted to add that cross correlation is closely related to synchronous, (lockin) detection. Multiplying a noise signal and a sine wave, is a lockin with no signal at the input.