Numerit[WIN32][1700][1703]t! A qffffff)@j@fffffvq@?@ffffff9@?@ffffff9@ffffff)@ffffff)@         Times New RomanArialSymbol Courier New??? G )\b@\(F@n1xn1n2xn2>@>@>@>@>@>@>@ >@ >@ >@>@>@>@>@>@ >@  >==>>??0.010.010.010.01G )\b@\(F@ss1xss1ss2xss2>@>@>@>@>@>@>@ >@ >@ >@>@>@>@>@>@ >@  >==>>??0.010.010.010.01G )\b@\(F@s1xs1s2xs2s3xs3>@>@>@>@>@>@>@ >@ >@ >@>@>@>@>@>@ >@  >==>>??0.010.010.010.01G )\b@\(F@corr12xxs1:s2corr13xxs1:s3>@>@>@>@>@>@ >@ >@ >@>@>@>@>@>@ >@ >@  >==>>??0.010.010.010.01G )\b@\(F@corrf12xxs1:s2corrf13xxs1:s3>@>@>@>@>@>@ >@ >@ >@>@>@>@>@>@ >@ >@  >==>>??0.010.010.010.01vvvpvvvpvvvpvvvpvvvpvvvp"vvvQB0Correlation Of Noisy Signalsvvv When we measure signals in a noisy environment and calculate correlations between the measured signals we must take into account the noise that we have in the system. In the following demonstration we measure three signals in a noisy environment. The noise consists of a low frequency sine wave with an additional small random noise. We define two noise signals, n1, and n2, where n2 has twice the frequency of n1. Figure 1 shows these signals:"vvv  ! . The noise signalsvvvpvvv The signals that we want to measure are chirp waves, ss1, ss2, where ss2 has a larger frequency modulation. These are shown in Fig. 2.$vvv ! " . The source signalsvvvpvvv We take three measurements. The first, s1, is ss1 measured in the presence of noise n1; the second, s2, is the same ss1 measured in the presence of noise n2; and the third s3, is ss2 measured in the presence of noise n1. These signals are shown in Fig. 3:&vvv ' # . The measured signals.vvvpvvv In order to compare the measured signals we calculate the cross-correlation of s1 with s2 and with s3. These correlations are shown in Fig. 4. Looking at the results we see that s1 and s3 have a good correlation while the correlation between s1 and s2 is much smaller. 0vvv ( $ . Correlations without filtering.vvvp vvv So, by just measuring the signals and calculating the correlations we conclude that it is more likely that the first and the third measured signals were originated from the same source signal while the second measured signal was originated from another signal - which is wrong, of course.vvv To get the right answer we must use our knowledge about the low frequency noise in the system. So, before calculating the correlations, we have to remove the low frequency components from the measured signals. When we do so, we get the following correlations:-vvv + % . Correlations with filtering.vvvpJvvv Now we see that s1 and s2 have a good correlation, while s3 is different. vvv Qvvv Looking at the function #corrf, which applies the low-pass filter while calculating the correlation, we see that we had to filter out only the first two low frequency components in the spectrum of each signal, namely, elements 2 and 128 which represent the first harmonic, and elements 3 and 127 which represent the second harmonic.vvv  q8ffffff)@j@fffffvq@?@ffffff9@?@ffffff9@ffffff)@ffffff)@         Times New RomanArialSymbol Courier New -E` This sample program demonstrates correlation of noisy signals usingF` the fast Fourier transform (FFT) algorithm. We show how important itH` is to correctly filter the signals before calculating the correlation.&` -> Run and see results in the Report+x = 0..2*pi len 128 ` a single cycle/noise = 0.2..0.2 len 128 ` amplitude of noise randomize/n1 = sin(x)+rand(noise) ` first noise signal0n2 = sin(2*x)+rand(noise) ` second noise signal0ss1 = 0.25*cos(x^2) ` first source signal1ss2 = 0.25*cos(2.5*x^2) ` second source signal2s1 = ss1+n1 ` first measured signal3s2 = ss1+n2 ` second measured signal2s3 = ss2+n1 ` third measured signal` correlation without filteringfunc corr(y1,y2)ft1 = fft(y1) ft2 = fft(y2)!return real(ifft(ft1*conj(ft2)))` correlation with filteringfunc corrf(y1,y2)+i = 2,3,127,128 ` low freq. components ft1 = fft(y1)ft1[i] = 0 ` filter out ft2 = fft(y2)ft2[i] = 0 ` filter out!return real(ifft(ft1*conj(ft2)))` compute the correlations2` (to display the correlations around zero we must*` shift the arrays after the computation)&` correlations without low-pass filtercorr12 = shifft(corr(s1,s2))corr13 = shifft(corr(s1,s3))#` correlations with low-pass filtercorrf12 = shifft(corrf(s1,s2))corrf13 = shifft(corrf(s1,s3))+xx = x-pi ` -pi to pi; used in the graphsd:\num\num1.5\release\pro\ x noisen1 n2 ss1 ss2 s1 s2 s3 corr12 corr13 corrf12 corrf13 xx  _ B f   f @  B @  EB   EBB  @  @  @%  < &  < )  < *  < , A corrcorry1y2ft1ft2     B=> corrfcorrfy1y2ift1ft2 %    5  4   4   B=> 02@128`@0.2?0.25?2.5@3@127_@