Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2010

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

Search the Archive

Re: 2-D Fourier Transform?

  • To: mathgroup at
  • Subject: [mg113770] Re: 2-D Fourier Transform?
  • From: "Nasser M. Abbasi" <nma at>
  • Date: Thu, 11 Nov 2010 06:10:59 -0500 (EST)
  • References: <ibdvnp$8tk$>
  • Reply-to: nma at

On 11/10/2010 3:30 AM, hadi motamedi wrote:
> Dear All
> Can you please let me know how can I obtain 2-D Fourier transform of a
> 2-D signal say an saved image ?
> Thank you

There might be a shorter way in the digital image
processing functions in version 7 as many new
ones where added.

But this is one way to do this. If you find
any errors pls let me know:

------ 2D spectrum of image ------------------------------
ImageDimensions[img] (*look at image*)

ImageChannels[img]  (*see how many channels*)

data=ImageData[img];  (*get data*)

Map[Image[data[[All,All,#]]]&,Range[1,nChannel]](*look at each channel*)

d=data[[All,All,2]]; (*get channel 2*)

(*center Image first*)
Map[(d[[  #[[1]],#[[2]] ]]=(-1)^(#[[1]]+#[[2]])*d[[#[[1]],#[[2]] ]])&,indx];

(*make FFT and look at spectrum and phase*)
fw= Fourier[d,FourierParameters->{1,1}];

fudgeFactor=100; (*adjust for better viewing as needed*)

ArrayPlot[Abs@(fudgeFactor * Log[1+fw]),PlotLabel->"Magnitude spectrum",ImageSize->400]
ArrayPlot[Arg[fw],PlotLabel->"Phase spectrum",ImageSize->400]

see my howto note #95


  • Prev by Date: Re: Numerical simulation
  • Next by Date: Re: 2-D Fourier Transform?
  • Previous by thread: Re: 2-D Fourier Transform?
  • Next by thread: Re: 2-D Fourier Transform?