Skip to content

Add FFTW rectangular/polar round-trip benchmark with dynamic loading and SFDR metrics#70

Merged
falseywinchnet merged 1 commit into
mainfrom
t5cqr7-main/add-fftw-round-trip-benchmark-with-sfdr-metrics
Jun 27, 2026
Merged

Add FFTW rectangular/polar round-trip benchmark with dynamic loading and SFDR metrics#70
falseywinchnet merged 1 commit into
mainfrom
t5cqr7-main/add-fftw-round-trip-benchmark-with-sfdr-metrics

Conversation

@falseywinchnet

Copy link
Copy Markdown
Owner

Motivation

  • Provide a focused example that compares BFFT and FFTW round-trip quality and throughput in both rectangular and polar domains for double and float precisions.
  • Use FFTW’s planner with selectable modes (default MEASURE) while keeping the build independent of FFTW headers or link-time libraries by using dynamic dlopen/dlsym resolution.
  • Add meaningful polar-quality diagnostics (magnitude-dB, phase-radians) and simple SFDR spur metrics to evaluate polar reconstructions.

Description

  • New example examples/fftw_polar_roundtrip_benchmark.cpp implementing deterministic multi-frame input generation, BFFT and FFTW double/float paths, polar conversion using atan2/sin/cos, and separate timing for forward/inverse/combined loops.
  • Dynamic FFTW/FFTWf loading via dlopen/dlsym, resolving fftw_plan_dft_r2c_1d, fftw_plan_dft_c2r_1d, fftw_execute, fftw_destroy_plan, fftw_malloc, fftw_free and their float (fftwf_) variants, plus optional metadata fftw_version, fftw_cc, fftw_codelet_optim (prints n/a when missing and reports NEON presence via string search).
  • Local FFTW flag constants defined (FFTW_MEASURE_FLAG, FFTW_ESTIMATE_FLAG, FFTW_PATIENT_FLAG, etc.) with CLI options --fftw-measure (default), --fftw-estimate, and --fftw-patient, and CLI flags --sfdr/--no-sfdr and --help.
  • Polar quality and SFDR: compute magnitude-dB and wrapped phase error with bin masking, implement O(M^2) DFT-based spur search (skips heavy work for very large M), and report complex rebuild max/RMS dBc along with mag/phase spur metrics.
  • CMake: added example target fftw_polar_roundtrip_benchmark and configured it to output into build/examples and link dl when available so the project builds without FFTW present.

Testing

  • Built the project: cmake -S . -B build and cmake --build build -j completed successfully.
  • Ran the test suite: ctest --test-dir build --output-on-failure and all tests passed.
  • Executed the example binary with representative arguments and flags: ./build/examples/fftw_polar_roundtrip_benchmark 64 4 --no-sfdr and ./build/examples/fftw_polar_roundtrip_benchmark 64 4 --sfdr, both ran and produced the expected benchmark and SFDR output (FFTW rows are gracefully skipped when libraries are not found).

Codex Task

@falseywinchnet falseywinchnet merged commit 2dac20f into main Jun 27, 2026
4 checks passed
@falseywinchnet falseywinchnet deleted the t5cqr7-main/add-fftw-round-trip-benchmark-with-sfdr-metrics branch June 27, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant