Re: question about fft2df

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 23 2012 - 21:42:12 MDT

Th actual code used is from fftpack5

http://people.sc.fsu.edu/~jburkardt/f77_src/fftpack5.1/fftpack5.1_reference.html

Specifically:

RFFT2I 2D real initialization
RFFT2B 2D real backward
RFFT2F 2D real forward

The RFFT2F call a complex fft.

Regards
D

On 3/23/12 1:46 PM, À×öª wrote:
>
> Hi, Shea,
>
> Thanks in advance for your time on my problem.
>
> After reading the doc on the link you gave and all other information I
> can get, I"m still not clear of the output of fft2df.
> Now, I downloaded the ncl 5.1.1 source code and try to study the source
> code for fft2df to, hopefully, resolve my problem.
> But, it is very silly that I failed to find the source code for ncl
> function fft2df in the whole source package.
>
> Could you give me any clue on where the function of fft2df function is ?
> Your help is appreciated.
> Best,
> Ting
>
>
> > Date: Tue, 20 Mar 2012 10:51:00 -0600
> > From: shea@ucar.edu
> > To: leiting2002@hotmail.com
> > CC: mai@ucar.edu; ncl-talk@ucar.edu
> > Subject: Re: [ncl-talk] question about fft2df
> >
> > A user contributed visualization of the fft2d is at:
> > http://www.cgd.ucar.edu/~shea/fft2d_image_ncl
> >
> > On 3/20/12 10:05 AM, À×öª wrote:
> > > Hi, Andy and All NCL users,
> > > With Andy's help, I think I find out the actual definition of
> > > output/return of ncl function fft2df ( it 's supposed to be the same as
> > > the sub rfft2f in the pack Andy provided). In their accompanying help
> > > document, it is found the definition for the 2d fft,
> > > ^^^^^^^^^^^^^^^^^^
> > >
> > > R Real output array of two dimensions. The full complex transform
> > > of r(i,j) is given by:
> > >
> > > L-1 M-1
> > > C(I,J) = 1/(L*M)*SUM SUM R(L1,M1)*
> > > L1=0 M1=0
> > >
> > > EXP(-SQRT(-1)*2*PI*(I*L1/L + J*M1/M))
> > >
> > > The complex transform of a real array has conjugate symmetry.
> > > That is, c(i,j) = congugate c(l-i,m-j) so only ha lf the transform
> > > is computed and packed back into the original array R.
> > >
> > >
> > > VVVVVVVVVVVVVVVV
> > >
> > > The L and M are the size of the input . Namely L is the N in my
> original
> > > question.
> > > So, the actual output of this sub and fft2df of ncl is of size ( L,
> M) (
> > > or (N,M)). But, since they are symmetric,only
> > > (N, M/2+1) are output.
> > > This perfectly answer my previous question.
> > > I think it will be helpful for NCL staff to put the above definition of
> > > the 2d fft on the help webpage for function fft2df.
> > >
> > > Andy , your help is appreciated and pls correct any
> > > confusion/misunderstanding in the above.
> > >
> > > Best wishes,
> > > Ting
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > & gt;
> > >
> > >
> > > > Date: Sat, 17 Mar 2012 20:42:28 -0600
> > > > From: mai@ucar.edu
> > > > To: leiting2002@hotmail.com
> > > > Subject: Re: [ncl-talk] question about fft2df
> > > >
> > > > On 03/17/2012 08:10 PM, À×öª wrote:
> > > >
> > > > > Would you pls tell me where I can see the fortran counterpart of
> > > the fft2df of NCL? So, I can
> > > > > understand why it has such dimension sizes.
> > > >
> > > > Two source files are attached. Why two? It's a long story. The one
> > > with comments (fftpack5.1.tar) is
> > > > not the version used in NCL. The one with no comments and explicit
> > > double precision
> > > > (fftpack5_dp.tar) is the one used in NCL. These were written at
> > > different times by the same two
> > > > people. The calling sequence is the same, I t hink. (See my test code
> > > and pay attention to the
> > > > leading dimension of the input array -- it must be larger than N
> > > because the output is complex
> > > > numbers which overwrite the input, a very bad programming style that
> > > was common many years ago. Paul
> > > > Swarztrauber died not very long ago. I talked to Richard Valent
> > > yesterday. He does not know or does
> > > > not remember much about these programs.)
> > > >
> > > > So I will also attach my little driver pro gram which prints out the
> > > same values as the NCL Example 1
> > > > and I will also attach a very slightly modified version of the NCL
> > > program (to get 64-bit floats
> > > > instead of 32-bit -- all actual calculations in NCL are done in
> > > 64-bit floating point precision,
> > > > even when the input is 32-bit). If you run th e two program, you
> > > should see the same numbers coming out.
> > > >
> > > > You will have to build the libraries or at least get all of the
> > > needed routines into your compile. I
> > > > used gfortran because that is what is used to build NCL.
> > > >
> > > > Run the test NCL program like this:
> > > >
> > > > % ncl -n testfft.ncl
> > > >
> > > > Please do not hesitate to contact me again if you have any more
> > > questions.
> > > >
> > > > Andy
> > >
> > >
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 23 21:42:21 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 27 2012 - 08:50:24 MDT