Re: 2d cross-correlation / convolution



PB wrote:

comp.dsp

but val = root(re^2+im^2) magnitude of complex num. angle may not be
important

Dear all,

I'm not sure if this is the right place for this so if not sorry.
I'm trying to get a 2D matrix correlated with a reference matrix.
I've been told I need to do this with convolution. I have the
convolution down but now i have a complex number that I don't know how
to convert back to a real number. But more over how can I get the
correlation coefficient from this matrix? Currently I'm using R to do
the analysis so the code below is from that.

Cheers,

Paul


m<-c(10,20,30,40,50,60)
i<-c(1,1,5,2,1,1)
m1<-cbind(m,i)
j<-c(0,10,50,20,10,0)
m2<-cbind(m,j)

aa<-fft(fft(m2)* fft(m1), inverse=TRUE)
aa
m j
[1,] 87000+0i 55800+0i
[2,] 97200+0i 60000-0i
[3,] 100680+0i 32520-0i
[4,] 97560-0i 28800-0i
[5,] 88800-0i 33000+0i
[6,] 69840+0i 44400+0i
.