Using ListCorrelate with Inner
- To: mathgroup at smc.vnet.net
- Subject: [mg87284] Using ListCorrelate with Inner
- From: Art <grenander at gmail.com>
- Date: Sun, 6 Apr 2008 06:45:05 -0400 (EDT)
I have a matrix of filter vectors h which I would like to ListCorrelate with a column of data vectors d as (pseudocode) r = Inner[ListCorrelate, h, d, Plus]. I haven't been able to write this in a neat form with Inner, which I suspect will also be faster than the below: {l,m,n,o} = {5,5,8,1000}; h = RandomReal[1., {l,m,n}]; d = RandomReal[1., {m,o}]; r = Total /@ Table[ListCorrelate[h[[i, j]], d[[j]]], {i, l}, {j,m}] Thanks, Art