Ok thank you, it works. This is the good normalization factor.
Reply by Rune Allnor●April 20, 20062006-04-20
greg838 skrev:
> Hi all,
>
> I am currently doing a fftw_2d_r2c and i want to know if I must normalize
> my datas to get a relevant representation of the real part and the
> imaginary part in the frequency domain.
I don't think you *have* to do that, unless your application uses
some image intensity to estimate some physical parameter.
In those cases, the sensors as well as each step in the
processing chain are meticulously calibrated.
There aren't very many applications of that sort around.
> Assuming that i have an image of
> size nx*ny, I have supposed that I should divide by sqrt(nx*ny), is this
> right?
Seems right to me. To check, try and see if Parseval's identity
holds (matlab notation):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
N = 512;
M = 512;
x=rand(N,M);
X = fft2(x)/sqrt(N*M);
Ex = 0;
EX = 0;
for n=1:N
for m=1M
Ex = Ex + abs(x(n,m))^2;
EX = EX + abs(X(n,m))^2;
end
end
r=Ex/EX;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
If r==1 at the end of this script, you have found the correct
scaling constant.
Rune
Reply by greg838●April 20, 20062006-04-20
Hi all,
I am currently doing a fftw_2d_r2c and i want to know if I must normalize
my datas to get a relevant representation of the real part and the
imaginary part in the frequency domain. Assuming that i have an image of
size nx*ny, I have supposed that I should divide by sqrt(nx*ny), is this
right?
Greetings,
Greg