Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Low-pass filtering via FFTW: wrong scaling

Status
Not open for further replies.

norpoth

Electrical
Joined
May 5, 2006
Messages
2
Location
DE
Dear members,
in order to convolve a greyscale image with a gaussian I used FFTW code (release 3.1.1) to work in fourier domain. In detail my initial data is lying on a 1000x10000 point grid, correspondingly I put the gaussian bell on a 1000x1000 grid too. The gaussian distribution is normalized (i.e. integration over complete 2D equals 1) and centered on the grid around (500.5, 500.5). After transforming both via complex-to-complex 2D dft to fourier domain, complex multiplication and subsequent backward trafo are performed. Since the input is real (data and gaussian), the output is real too. The output shows the favoured, low-pass filtered features like unsharpening, but one problem occurs:
the absolute values of the output data is several orders of magnitude larger than in the input (i.e. the average intensity of the image is enormously increased), even though I scaled the output with 1/N^2 (where N=1000 is the number of grid points per axis). I feel like this point has sth. to do with the variance of the chosen gaussian.

Thanks in advance for any help on this.
Greetings
J.Norpoth
 
Look at your Gaussian kernal values. Is the sum of all 1,000,000 points just under one? If not, it may be your filter tap values. They might not have a DC gain of one.

Also, as an unsolicited comment:
You kernal is way too big, it should always be much less than your smallest signal dimension. In this case, it should be less than 1000X1000, maybe 100X100.


jsolar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top