Page **1** of **1**

### problem with fourier spectrum

Posted: **2015-12-29T16:56:52-07:00**

by **guus_hiddink**

I need to show the Fourier spectrum of the image and determine one dimensional spectrum in the form: S(theta)=sum(Sr(theta)), where the limits of the sum are r=1 and r=Ro where Ro is the radius of a circle centered at the origin. Can someone help me? Thanks

### Re: problem with fourier spectrum

Posted: **2015-12-29T18:19:41-07:00**

by **fmw42**

Sorry, I am not sure I understand fully. Image spectra are 2D not 1D. Are you asking to create the 2D spectra and then average over all angles for each radius. If so, then create the 2D spectrum from

Code: Select all

`convert image -fft -delete 1 -evaluate log 10000 spectrum.png`

Then convert to polar coordinates using

Code: Select all

`convert spectrum.png -virtual-pixel Black -distort depolar 0 spectrum_polar.png`

Then average all columns to 1 column and the result is a 1D image of what you want.

You can then list the values using txt: format output

Code: Select all

`convert spectrum_polar.png -scale 1x! txt:`

see

http://www.fmwconcepts.com/imagemagick/ ... urier.html
http://www.imagemagick.org/Usage/fourier/
http://www.imagemagick.org/script/comma ... ns.php#fft
http://www.imagemagick.org/Usage/distorts/#depolar
http://www.imagemagick.org/script/comma ... .php#scale
http://www.imagemagick.org/script/comma ... p#geometry
http://www.imagemagick.org/Usage/files/#txt
In the future, when asking questions on this forum, please identify your Imagemagick version and platform, since syntax differs on Windows and Unix systems.

### Re: problem with fourier spectrum

Posted: **2015-12-31T06:52:45-07:00**

by **guus_hiddink**

Thanks a lot, but I need to implement that in matlab.

### Re: problem with fourier spectrum

Posted: **2015-12-31T10:07:44-07:00**

by **fmw42**

guus_hiddink wrote:Thanks a lot, but I need to implement that in matlab.

This is an Imagemagick forum. I doubt any one here uses Matlab. You should probably ask on a Matlab forum.