![]() |
![]() |
Gwyddion Data Processing Library Reference Manual | ![]() |
|
---|---|---|---|---|
Top | Description |
#include <libprocess/gwyprocess.h> void gwy_fft_simple (GwyTransformDirection dir
,gint n
,gint istride
,const gdouble *in_re
,const gdouble *in_im
,gint ostride
,gdouble *out_re
,gdouble *out_im
); void gwy_fft_window (gint n
,gdouble *data
,GwyWindowingType windowing
); void gwy_fft_window_data_field (GwyDataField *dfield
,GwyOrientation orientation
,GwyWindowingType windowing
);
The simple one-dimensional FFT algorithm gwy_fft_simple()
is used as
a fallback by other functions when a better implementation (FFTW3) is not
available.
You should not use it directly, as it is a waste of resources
if FFTW3 backed is in use, neither you should feel any need to, as
high-level functions such as gwy_data_field_2dfft()
are available.
Up to version 2.7 simpleFFT works only with certain tranform sizes, mostly powers of 2. Since 2.8 it can handle arbitrary tranform sizes, although sizes with large prime factors can be quite slow (still O(n*log(n)) though).
void gwy_fft_simple (GwyTransformDirection dir
,gint n
,gint istride
,const gdouble *in_re
,const gdouble *in_im
,gint ostride
,gdouble *out_re
,gdouble *out_im
);
Performs a DFT algorithm.
This is a low-level function used by other FFT functions when no better backend is available.
Strides are distances between samples in input and output arrays. Use 1
for normal `dense' arrays. To use gwy_fft_simple()
with interleaved arrays,
that is with alternating real and imaginary data, call it with
istride
=2, in_re
=complex_array
, in_im
=complex_array
+1 (and similarly
for output arrays).
The output is symmetrically normalized by square root of n
for both
transform directions. By performing forward and then backward transform,
you will obtain the original array (up to rounding errors).
|
Transformation direction. |
|
Number of data points. Note only certain transform sizes are
implemented. If gwy_fft_simple() is the current FFT backend, then
gwy_fft_find_nice_size() can provide accepted transform sizes.
If gwy_fft_simple() is not the current FFT backend, you should not
use it. |
|
Input data stride. |
|
Real part of input data. |
|
Imaginary part of input data. |
|
Output data stride. |
|
Real part of output data. |
|
Imaginary part of output data. |
void gwy_fft_window (gint n
,gdouble *data
,GwyWindowingType windowing
);
Multiplies data by given window.
|
Number of data values. |
|
Data values. |
|
Method used for windowing. |
void gwy_fft_window_data_field (GwyDataField *dfield
,GwyOrientation orientation
,GwyWindowingType windowing
);
Performs windowing of a data field in given direction.
|
A data field. |
|
Windowing orientation (the same as corresponding FFT orientation). |
|
The windowing type to use. |