Re: one-dimensional and two-dimensional convolution
- To: mathgroup at smc.vnet.net
- Subject: [mg69103] Re: one-dimensional and two-dimensional convolution
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Wed, 30 Aug 2006 06:33:06 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ed0v1q$qe$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
bd satish wrote:
> Hi buddies ,
>
> Here is the definition of a 1-dimensional discrete-time convolution
> (encountered in Signals & Systems ,etc) of two functions x[n] and
> h[n] :
>
> y[n] = Sum[ x[k] * h[n-k] , { k , -Infiniy , Infinity }]
>
> The above command works when x[n] and y[n] are functions in the strict
> sense (say , x[n] = Exp[-2*pi*n/6] UnitStep[n] and h[n] = Exp[-4*Pi*n/7]
> UnitStep[n] )
> But in Signal processing , we often have lists :
>
> X= { 1,2,3,1,-1 } , H = { 1,-4,5,6} etc. where the entries are the
> function's values at different values of n . i.e.
>
> X = { x[0] , x[1] , x[2] , x[3] , x[4] } . Similarly H = { h[0] , h[1]
> , h[2] , ... } (, say )
>
> Without using Sum ( and DiscreteDelta ) , is there any way to directly (&
> quickly) find the convolution sum.
> I'm finding convolution of lists whose lengths are typically 700 to 1000. So
> the code needs be really fast.
>
> The Mathematica command " ListConvolve " did not help me. Anybody plz help
> me out !!
>
> Also , the 2-dimensional convolution of two-variable functions ,
> f[x,y] and h[x,y] is defined as :
>
> z[x,y] = Sum[ Sum[ f[m,n] * h[x-m , y-n] , { m , -Infinity, Infinity } ] ,
> { n , -Infinity , Infinity } ]
>
> But in image processing , we often have nested lists. In this case ,
> f[x,y] and h[x,y] are matrices :
>
> f = { { 1,2,3 } , { 4,5,6 } ,{7,8,9} } etc. Similarly h . There are no
> restrictions on the dimensions of matrices f and h .
>
> Mathgroup , plz help me in solving these 1-D and 2-D convolutions !!
>
>
Have you look at the Mathematica built-in function ListConvolve?
http://documents.wolfram.com/mathematica/functions/ListConvolve
Jean-Marc