[링크 : https://www.fftw.org/download.html]
./configure --prefix=/home/zhouxiaoyong/fftw3_test --disable-fortran --with-slow-timer --host=arm-none-linux-gnueabi --enable-single --enable-neon --enable-shared CC=arm-none-linux-gnueabi-gcc CFLAGS="-march=armv7-a -mfpu=neon -fPIC -ldl -mfloat-abi=softfp" |
[링크 : https://codeantenna.com/a/ztGG77F10Z]
The basic usage of FFTW is simple. A typical call to FFTW looks like: #include <fftw.h> ... { fftw_complex in[N], out[N]; fftw_plan p; ... p = fftw_create_plan(N, FFTW_FORWARD, FFTW_ESTIMATE); ... fftw_one(p, in, out); ... fftw_destroy_plan(p); } For example, code to perform an in-place FFT of a three-dimensional array might look like: #include <fftw.h> ... { fftw_complex in[L][M][N]; fftwnd_plan p; ... p = fftw3d_create_plan(L, M, N, FFTW_FORWARD, FFTW_MEASURE | FFTW_IN_PLACE); ... fftwnd_one(p, &in[0][0][0], NULL); ... fftwnd_destroy_plan(p); } The following is a brief example in which the wisdom is read from a file, a plan is created (possibly generating more wisdom), and then the wisdom is exported to a string and printed to stdout. { fftw_plan plan; char *wisdom_string; FILE *input_file; /* open file to read wisdom from */ input_file = fopen("sample.wisdom", "r"); if (FFTW_FAILURE == fftw_import_wisdom_from_file(input_file)) printf("Error reading wisdom!\n"); fclose(input_file); /* be sure to close the file! */ /* create a plan for N=64, possibly creating and/or using wisdom */ plan = fftw_create_plan(64,FFTW_FORWARD, FFTW_MEASURE | FFTW_USE_WISDOM); /* ... do some computations with the plan ... */ /* always destroy plans when you are done */ fftw_destroy_plan(plan); /* write the wisdom to a string */ wisdom_string = fftw_export_wisdom_to_string(); if (wisdom_string != NULL) { printf("Accumulated wisdom: %s\n",wisdom_string); /* Just for fun, destroy and restore the wisdom */ fftw_forget_wisdom(); /* all gone! */ fftw_import_wisdom_from_string(wisdom_string); /* wisdom is back! */ fftw_free(wisdom_string); /* deallocate it since we're done */ } } |
'프로그램 사용 > fft, fftw' 카테고리의 다른 글
fftw 예제 와 복소수 처리 (0) | 2022.10.19 |
---|---|
fftw 테스트(tests/bench) (0) | 2022.10.19 |
fft (0) | 2020.11.25 |
fftw (0) | 2020.11.25 |
ffmpeg fft 분석 예제 (0) | 2020.11.25 |