AbstractFFTs.jl icon indicating copy to clipboard operation
AbstractFFTs.jl copied to clipboard

Improve documentation

Open appleparan opened this issue 7 years ago • 2 comments

I had a misunderstanding of plan_* functions.

Main reason of this was from the term "inverse" on documentation

It says

You can compute the inverse-transform plan by inv(P) and apply the inverse plan with P \ Â (the inverse plan is cached and reused for subsequent calls to inv or ), and apply the inverse plan to a pre-allocated output array A with ldiv!(A, P, Â).

The purpose of this explanation was

  • you have FORWARD transform plan
    • using mul! : FORWARD transform
    • using ldiv! : BACKWARD transform

plan_fft is for FORWARD transform so it doesn't matter.

However, other plan_* documentation says basically "Same as plan_fft", so if you apply this structure to BACKWARD transform, documentation have two meaning

  • you have BACKWARD transform plan
    • using mul! : BACKWARD transform
    • using ldiv! : FORWARD transform or
  • you have BACKWARD transform plan
    • using ldiv : BACKWARD transform

because the term "INVERSE" and "BACKWARD" are often used interchangeably. It was hard to distinguish without investigating source code. I know there is a "-" between inverse and transform, but it is really confusing.

Would we have more clear explanation of this?

appleparan avatar Mar 16 '18 17:03 appleparan

"forward" and "backward" just refer to the sign of the exponent in the Fourier transform. To get the inverse of a given transform, you have to flip the sign of the exponent (going from forward to backward or vice versa) and also scale by 1/n where n is the length of the transform.

The inverse of a plan (as computed by inv or applied by ldiv!) is actually this inverse: e.g. the inverse of a forwards transform is a backwards transform scaled by 1/n. The inverse of an inverse plan is the original plan.

stevengj avatar Mar 16 '18 18:03 stevengj

That's what I wanted on documentation. My last questions was bad, I mean can I add your comments on documentation?

appleparan avatar Mar 16 '18 18:03 appleparan