#43 closed enhancement (fixed)
psVectorFFT/psImageFFT direction parameter should be bool
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | minor | Keywords: | |
| Cc: |
Description
I suggest that the direction parameter of psVectorFFT/psImageFFT be changed to
bool instead of int as only two options really exist: forward or reverse.
Could also change the parameter name to 'isForward' to make it easy to figure
out that TRUE is forward.
-rdd
Change History (3)
comment:1 by , 22 years ago
comment:2 by , 22 years ago
Sorry for the poor line-wrapping of the last post.
Basically, a forward FFT would look like:
out = psImageFFT(in,PS_FFT_FORWARD);
a reverse FFT would look like:
out = psImageFFT(in,PS_FFT_REVERSE);
and a reverse FFT with a real resultant would look like:
out = psImageFFT(in,PS_FFT_REVERSE+PS_FFT_REAL_RESULT);
(or, if you prefer bitwise operators)
out = psImageFFT(in,PS_FFT_REVERSE | PS_FFT_REAL_RESULT);

Given the issue of communicating if a real-result is desired for an IFFT or not,
I suggest that the direction parameter be converted to a bit flag with the
following enum driving it:
typedef enum {
perform a forward FFT.
perform a reverse FFT.
flag parameter
} psFftFlags;