Why does the cross-correlation of a sine wave with white noise also show harmonic properties?

1k Views Asked by At

If we find the cross-correlation of a sine wave with a white noise process, why does the resulting signal also show harmonic properties with the same frequency as the input sine wave?

I would have thought that as the processes are separate and unique we would see no correlation?

The python code I'm using to generate the image is:

import numpy as np
import matplotlib.pyplot as plt
fs = 500 # Sample rate
l = int(1*fs) # Length of correlation to calculate
sine_wave = np.sin(3*2*np.pi*np.arange(0,30,1/fs)) 
white_noise = np.random.normal(0,1,len(sine_wave))
corr = np.correlate(white_noise,sine_wave[:-l+1],mode='valid')

plt.close('all')
fg,ax = plt.subplots()
ax.plot(np.arange(0,l/fs,1/fs),corr,'k')
ax.set_xlabel('Time [s]')
ax.set_ylabel('Amplitude')

1 second cross-correlation signal between 30 seconds of a 3Hz sine wave and a white noise process:

1 Second cross-correlation signal between 30 seconds of a 3Hz sine wave and a white noise process

The background to the problem is that I'm looking at a signal processing problem for extracting harmonic behaviour from structures excited by white noise. Several methods for extracting this behaviour use the auto-correlation of the structures acceleration response. The basis for this is that there is no correlation between the white noise forcing and the past structural response.

However when I look at the residual errors (difference in measured autocorrelation and the expected autocorrelation) in the methods they exhibit this same behaviour where there is this additional correlation between the white noise and the structures response. I've mimicked these results by taking the cross-correlation of the sine wave and a stochastic response, something which I assumed would be close to zero and stochastic. However instead its showing these oscillations.

2

There are 2 best solutions below

0
On BEST ANSWER

$$R (t_1, t_2) := \mathbb E \left[ \sin(\omega_0 t_1) \, w (t_2) \right] = \underbrace{\mathbb E \left[ \sin(\omega_0 t_1) \right]}_{= \sin(\omega_0 t_1)} \, \underbrace{\mathbb E \left[ w (t_2) \right]}_{=: \mu_w} = \color{blue}{\mu_w \sin(\omega_0 t_1)}$$

0
On

Rodrigo gave the formal mathematical answer. Here is the less formal, more intuitive explanation:

  • For real signals, cross-correlation is equivalent to convolution where one of the signals is reversed in time.
  • A sine wave reversed in time is basically the same sine wave (it's just a phase shift)
  • So, what you're doing is equivalent to convolving with a sine wave.
  • Convolution in the time domain is equivalent to multiplication in the frequency domain.
  • The frequency spectrum of a sine wave is just a single point at the frequency of the sine wave - it is zero everywhere else.
  • Therefore, the frequency spectrum of the convolved signal is zero everywhere, except at the sine frequency where it is the product of the sine amplitude and the energy at that frequency in the input signal.
  • If the input signal doesn't have any energy at the frequency of the sine wave, then the output frequency spectrum is zero everywhere, and therefore the output signal is zero (silence).
  • But your input signal is white noise. White noise by definition has energy at all frequencies.
  • Therefore, the output frequency spectrum is non-zero at the sine frequency, and zero everywhere else.
  • A signal whose frequency spectrum is zero at all frequencies except one is by definition a sine wave.
  • Therefore, you get a sine wave as output, with the same frequency as the sine wave you cross-correlated with.

Another way to think about this is that cross-correlating (or convolving) with a sine wave is a way to extract a single frequency component out of the input signal. Since white noise contains all frequencies, all you're doing is extracting that particular frequency out of the noise.