Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using Fourier and InverseFourier instead of Convolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85939] Re: Using Fourier and InverseFourier instead of Convolve
  • From: "Dana DeLouis" <dana.del at gmail.com>
  • Date: Thu, 28 Feb 2008 02:50:04 -0500 (EST)

Just to add.  You may want to adjust FourierParameters to "signal
processing"

list1 = {3, 1, 4, 2}; 
list2 = {1, 2, 3, 4}; 

Out1 = ListConvolve[list1, list2, {1, -1}, 0]

{3, 7, 15, 25, 20, 22, 8}

SetOptions[{Fourier, InverseFourier}, FourierParameters -> {1, -1}]; 

n = Length[list1] + Length[list2] - 1

7

v1 = PadRight[list1, n, 0]

{3, 1, 4, 2, 0, 0, 0}

v2 = PadRight[list2, n, 0]

{1, 2, 3, 4, 0, 0, 0}

Out2 = Round[InverseFourier[Chop[Fourier[v1]*Fourier[v2]]]]

{3, 7, 15, 25, 20, 22, 8}

Out1 == Out2

True

-- 
Dana DeLouis


"Solomon, Joshua" <J.A.Solomon at city.ac.uk> wrote in message
news:fpooi0$1cg$1 at smc.vnet.net...
> OK, I must admit that I do not understand everything ListConvolve does,
but
> I get the convolution I need when I do
> ListConvolve[list1, list2, {1, -1}, 0]
> In particular, the output has the appropriate length:
> Length[list1]+Length[list2]-1.
> Now, I would like to get the identical using Fourier and InverseFourier.
> Is this possible? What is the appropriate syntax?
> j
> 
>




  • Prev by Date: Re: Deleting elements from a Table
  • Next by Date: Re: find and count partially identical sublist
  • Previous by thread: Re: Using Fourier and InverseFourier instead of Convolve
  • Next by thread: Re: Using Fourier and InverseFourier instead of Convolve