# Removal of noise by auto-correlation/cross-correlation

Aim: To verify the removal of noise by auto correlation/cross correlation.

EQUIPMENT:

PC with windows (95/98/XP/NT/2000).

MATLAB Software.

Theory:

Detection of a periodic signal masked by random noise is of great importance .The noise signal encountered in practice is a signal with random amplitude variations. A signal is uncorrelated with any periodic signal. If s(t) is a periodic signal and n(t) is a noise signal then

Qsn(T)= cross correlation function of s(t) and n(t) Then Qsn(T)=0

Detection of noise by Auto-Correlation:

S(t)=Periodic Signal (Transmitted) , mixed with a noise signal n(t).

Then f(t) is received signal is [s(t ) + n(t) ]

Let Qff(T) =Auto Correlation Function of f(t)

Qss(t) = Auto Correlation Function of S(t)

Qnn(T) = Auto Correlation Function of n(t)

The periodic signal s(t) and noise signal n(t) are uncorrelated

The Auto correlation function of a periodic signal is periodic of the same frequency and the Auto correlation function of a non periodic signal is tends to zero for large value of T since s(t) is a periodic signal and n(t) is non periodic signal so Qss(T) is a periodic where as aQnn(T) becomes small for large values of T Therefore for sufficiently large values of T Qff(T) is equal to Qss(T).

Detection by Cross Correlation:

f(t)=s(t)+n(t)

c(t)=Locally generated signal with same frequency as that of S(t)

T/2

Qfc (t) = Lim 1/T ? [s(t)+n(t)] [ c(t-T)] dt

T--8 -T/2

= Qsc(T)+Qnc(T)

C(t) is periodic function and uncorrelated with the random noise signal n(t). Hence Qnc(T0=0) Therefore Qfc(T)=Qsc(T).

Applications:detection of radar and sonal signals ,detection of cyclical component in brain analysis meterology etc.

Program-1 :  auto correlation

clear all

clc

t=0:0.1:pi*4;

s=sin(t);

k=2;

subplot(6,1,1)

plot(s);

title('signal s');

xlabel('t');

ylabel('amplitude');

n = randn([1 126]);

f=s+n;

subplot(6,1,2)

plot(f);

title('signal f=s+n');

xlabel('t');

ylabel('amplitude');

as=xcorr(s,s);

subplot(6,1,3)

plot(as);

title('auto correlation of s');

xlabel('t');

ylabel('amplitude');

an=xcorr(n,n);

subplot(6,1,4)

plot(an);

title('auto correlation of n');

xlabel('t');

ylabel('amplitude');

cff=xcorr(f,f);

subplot(6,1,5)

plot(cff);

title('auto correlation of f');

xlabel('t');

ylabel('amplitude');

hh=as+an;

subplot(6,1,6)

plot(hh);

xlabel('t');

ylabel('amplitude');

Output:

Program-2:  CROSS CORRELATION :

clear all

clc

t=0:0.1:pi*4;

s=sin(t);

k=2;

%sk=sin(t+k);

subplot(7,1,1)

plot(s);

title('signal s');xlabel('t');ylabel('amplitude');

c=cos(t);

subplot(7,1,2)

plot(c);

title('signal c');xlabel('t');ylabel('amplitude');

n = randn([1 126]);

f=s+n;

subplot(7,1,3)

plot(f);

title('signal f=s+n');xlabel('t');ylabel('amplitude');

asc=xcorr(s,c);

subplot(7,1,4)

plot(asc);

title(' correlation of s and c');xlabel('t');ylabel('amplitude');

anc=xcorr(n,c);

subplot(7,1,5)

plot(anc);

title(' correlation of n and c');xlabel('t');ylabel('amplitude');

cfc=xcorr(f,c);

subplot(7,1,6)

plot(cfc);

title(' correlation of f and c');xlabel('t');ylabel('amplitude');

hh=asc+anc;

subplot(7,1,7)

plot(hh);