DSP 4
DSP 4
Correlation by convolution nx=-3:3 x=[3 11 7 0 -1 4 2] [x12 n12]=sigshift(x,nx,2) subplot(3,2,1) stem(n12,x12) w=randn(1, length(x12)) nw=n12 [h nh]=sigadd(x,nw,x12,n12) subplot(3,2,2) stem(nh,h) [x nx]=sigfold(x,nx) [y ny]=conv_m(x,nx,h,nh) subplot(3,2,3) stem(ny,y) Auto-correlation [y1 ny1]=xcorr(x); subplot(3,2,4) stem(ny1,y1) Cross correlation [y2 ny2]=xcorr(x,h) subplot(3,2,5) stem(ny2,y2) Noise [y3 ny3]=sigadd(y,ny,-1*y1,ny1) subplot(3,2,6) stem(ny3,y3)
sig shift 20 0 -20 -2 400 200 0 -5 500 0 -500 -10 50 0 -50 -2 200 100 0 -10 500 0 -500 -10
sig add
2 sig fold
Auto correlation
10
-5
0 noise
10
cross correlation
-5
10
-5
10