kml_fft(f/h)_set_timelimit
Sets the timeout interval for the FFT PATIENT mode.
Interface Definition
void kml_fft_set_timelimit(double tlim)
void kml_fftf_set_timelimit(double tlim)
void kml_ffth_set_timelimit(double tlim)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
tlim |
Sets the timeout interval for the FFT PATIENT mode, in seconds. If this API is not called, there is no time limit. |
double A negative value or 0 indicates that there is no time limit. The plan API will perform a complete search in PATIENT mode. A positive value sets the timeout interval to the specified number of seconds. The internal search loop checks for timeout after each evaluation. If a timeout occurs, the optimal solution in the evaluated list is output. |
Input |
Dependencies
C: "kfft.h"
Examples
C interface:
int N = 16;
kml_fft_complex *in;
kml_fft_complex *out;
kml_fft_plan plan;
in = (kml_fft_complex*)kml_fft_malloc(sizeof(kml_fft_complex) * N);
out = (kml_fft_complex*)kml_fft_malloc(sizeof(kml_fft_complex) * N);
for (int i = 0; i < N; i++){
in[i][0] = (double)i;
in[i][1] = (double)i;
}
kml_fft_set_timelimit(10);
plan = kml_fft_plan_dft_1d(N, in , out, KML_FFT_FORWARD, KML_FFT_PATIENT);
kml_fft_execute_dft(plan, in, out);
kml_fft_destroy_plan(plan);
kml_fft_free(in);
kml_fft_free(out);
/*
* out = {{1.200000e+02, 1.200000e+02}, {-4.821872e+01, 3.221872e+01},
* {-2.731371e+01, 1.131371e+01}, {-1.997285e+01, 3.972846e+00},
* {-1.600000e+01, 0.000000e+00}, {-1.334543e+01, -2.654571e+00},
* {-1.131371e+01, -4.686292e+00}, {-9.591299e+00, -6.408701e+00},
* {-8.000000e+00, -8.000000e+00}, {-6.408701e+00, -9.591299e+00},
* {-4.686292e+00, -1.131371e+01}, {-2.654571e+00, -1.334543e+01},
* {0.000000e+00, -1.600000e+01}, {3.972846e+00, -1.997285e+01},
* {1.131371e+01, -2.731371e+01}, {3.221872e+01, -4.821872e+01}}
*/
Parent topic: Common Function Syntax