{"id":60247,"library":"fftw3","title":"FFTW","description":"FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).","status":"active","version":"3.3.10","language":"cpp","source_language":null,"source_url":null,"tags":["fft","dsp","numerical","signal-processing"],"install":[{"cmd":"vcpkg install fftw3","lang":"bash","label":"vcpkg"},{"cmd":"# CMakeLists.txt\nfind_package(fftw3 CONFIG REQUIRED)\ntarget_link_libraries(main PRIVATE FFTW3::fftw3)","lang":"cmake","label":"CMake"}],"dependencies":[],"imports":[{"symbol":"fftw3.h","correct":"#include <fftw3.h>"}],"quickstart":{"code":"#include <fftw3.h>\n#include <cmath>\n#include <iostream>\n\nint main() {\n    int n = 8;\n    double *in = (double*) fftw_malloc(sizeof(double) * n);\n    fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);\n    fftw_plan p = fftw_plan_dft_r2c_1d(n, in, out, FFTW_ESTIMATE);\n    for (int i = 0; i < n; i++) in[i] = sin(2 * M_PI * i / n);\n    fftw_execute(p);\n    std::cout << \"FFT computed.\" << std::endl;\n    fftw_destroy_plan(p);\n    fftw_free(in); fftw_free(out);\n    return 0;\n}","lang":"cpp","description":"Computes a 1D real-to-complex FFT."},"warnings":[{"fix":"Always use fftw_malloc for arrays passed to FFTW plans.","message":"FFTW uses its own memory allocation functions (fftw_malloc) for proper alignment; using standard malloc may cause crashes on SIMD-enabled builds.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'arbitrari':21 'c':5 'complex':29 'comput':9 'cosine/sine':40 'data':30,36 'dct/dst':43 'dft':14 'dimens':19 'discret':11,39 'dsp':45 'even/odd':35 'fft':44 'fftw':1,2 'fourier':12 'i.e':37 'input':22 'librari':7 'numer':46 'one':16 'process':49 'real':27 'signal':48 'signal-process':47 'size':23 'subroutin':6 'transform':13,41 'well':32","created_at":"2026-06-16T19:22:48.151644+00:00","updated_at":"2026-06-16T19:22:48.151644+00:00","problems":[],"ecosystem":"vcpkg","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["other"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}