# Re: how to display the fft image ?

richard wrote:
just a simple question, how to display the fft result,

I got the zr(i,j) and zi(i,j), I need to apply a log fuction

to show more detail, and need a shift to make the spectrum on the

center of the image, what is the equation to to do that ?

If you mean centering - where zero frequency is at the centre of the
image, then it depends on the particular FFT. I could give you code
that would work for the Numerical recipes FFT, but that would be no use
in general.

But maybe your question is simpler. Before log, you need to take
magnitude.
mag(i,j) = sqrt(zr(i,j)^2 + zi(i, j)).

You might want to normalise to decibels. dB(i,j) = 20
log_{10}(mag(i,j)/magmax); magmax is the maximum magnitude and that
will map to zero with all other values mapping to <= 0.

Since you are taking logs, you can dispense with the sqrt; or, if using
dBs, make the 20 a 10.

If you want to centre, you need a mapping which will map zero row
frequency to rc = nRows/1 + 1; row freq 1 to rc +1, row freq -1 to rc
-1, etc. and the same for columns. A simple way is to centre the column
data first (iterating over rows) and then the row data (iterating over
columns).

Best regards,

Jon C.

thank.

.

## Relevant Pages

• Re: Critique on my solution for an exercise. (check if a date is valid)
... Such a regular mapping allows for easy computation of ranges. ... zero numbers, ... we would state that the Anno Domini type is ... are fond of such a numbering scheme. ...
(comp.lang.forth)
• Re: Set the CheckBox.Checked without the OnClick being called
... When using an integer as a status code, zero means ... Booleans ARE NOT Integers, ... computers don't do strings, either, a mapping from ... a software engineer will encode ephemeral ...
(comp.lang.pascal.delphi.misc)
• Re: TV tonight
... southern latitudes are negative numbers. ... east and west of the zero meridian. ... and start iterating from zero again. ... ever reach that threshold for some n," (I can understand the following ...