DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected].

17
DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]. uk

Transcript of DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected].

Page 1: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

DCSP-21

Jianfeng Feng

Department of Computer Science Warwick Univ., UK

[email protected]

Page 2: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

Stochastic Processes

Random variables: x Stochastic processes: x(t), x(n)

• P(x=1)=0.5 P (x(n)=1)=0.5

• Toss a coin toss a coin many times

A sequence here

Page 3: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

Stochastic ProcessesRandom variables: x Stochastic processes: x(t), x(n)

• P(x=1)=0.5 P (x(n)=1)=0.5

• mean E x =0.5 mean E x(n) = 0.5• Variance

var (x) = var ( x(n) ) =

• correlation between

x(0) and x (n)

rxx(n) = E (x(0) – E x(0)) (x(n) – E x(n))

Page 4: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

• x=randn(1000,1);• hold on• y=zeros(1000);• z=zeros(1000);• plot(x);• for i=1:900• y(i)=x(i+100);• z(i+100)=x(i+100);• mxy(i)=x(i)*y(i);• end• plot(z+10,'r')• plot(y+20,'g')• plot(mxy+30,'b')

Page 5: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.
Page 6: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

• mean(mxy)

• ans =

• 0.0218

Page 7: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.
Page 8: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

plot(abs(fft(autocorr(x)))) hold on plot(abs(fft((x))),'r')

Page 9: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

White noise: the spectrum of its autorrelation is flat

Page 10: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

Stochastic Processes

Random variables: x Stochastic processes: x(t), x(n)

The summation of two normal random variables Is again a normal random variable

Z = X + Y

mean (Z) = mean (X) + mean(Y)

var(Z) = var (X) + var(Y)

(if X and Y are independent)

The summation of two white noise processes is again a white noise process

Z(n) = X(n) + Y(n)

mean (Z) = mean (X) + mean(Y)

var(Z) = var (X) + var(Y)

(if X and Y are independent)

Page 11: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

Stochastic Processes

Random variables: x Stochastic processes: x(t), x(n)

The summation of two normal random variables Is again a normal random variable

Z = X + Y

mean (Z) = mean (X) + mean(Y)

var(Z) = var (X) + var(Y)

(if X and Y are independent)

The summation of two white noise processes is again a white noise process

Z(n) = X(n) + Y(n)

mean (Z) = mean (X) + mean(Y)

var(Z) = var (X) + var(Y)

(if X and Y are independent)

Page 12: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

Application: Matched FilterAssume

an n bit signal

a(i) = S(-i)

Y(n)= a(0) X(n) + a(1) X(n-1) + … + a(N) X(n-N)

Actual input X(i) = S(i)+ (i)

[1,1, 1] /S N

Page 13: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

2 2 2 2

2

2

(0) (0) (1) (2) ( )

[ (0) ( )] /

1 [ (0) ( )] /

([ (0) ( )] / ) 0

var([ (0) ( )] / )

var( (0))

Y S S S S N

N N

N N

mean N N

N N

The variance is not enlarged due to the summation of many noise terms

Page 14: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.

• clear all• close all• mag=0.3;• for i=1:500• x(i)=0;• v(i)=randn(1,1);• w(i)=x(i)+v(i);• end• for i=501:600• x(i)=mag;• v(i)=randn(1,1);• w(i)=x(i)+v(i);• end• for i=601:1000• x(i)=0;• v(i)=randn(1,1);• w(i)=x(i)+v(i);• end• for i=1:100• h(i)=1;• end• • for j=101:1000• dec(j)=h*w([j-100:j-1])';• end• figure(1)• plot(v);• hold on• plot(x,'r');• • figure(2)• plot(dec);• figure(3)• plot(w,'r');

Page 15: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.
Page 16: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.
Page 17: DCSP-21 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk.