A Tcl extension providing a high-performance interface to the FFTW3 library for Fast Fourier Transform operations.
- FFT Operations: Forward and inverse FFT transformations
- Flexible Data Access: Multiple data formats (nested lists, flat lists, integers)
- In-Place/Out-of-Place: Support for both transformation modes
- Multi-Carrier Waveform Generation: Advanced signal generation with:
- Newman phase sequences for low PAPR
- Frequency flatness correction
- Sideband suppression calibration
- Pseudorandom amplitude generation
- Binary file output for AWG/DAC hardware
cd rcompile/tclfftw
autoconf
./configure
make
make installpackage require fftw
# Create FFT plan
set plan [fftw::plan 1024 1]
# Set input data
fftw::clear $plan
fftw::setAt $plan 0 0 {1.0 0.0}
# Execute FFT
fftw::execute $plan 0
# Get results
set output [fftw::get $plan 0]
# Cleanup
fftw::destroy $plan# Generate 5-tone signal with Newman phases
array set result [fftw::calcMcWaveform \
-center 14250 \
-startFreqList {14248 14249 14250 14251 14252} \
-spacing 1.0 \
-phaseSeed 2]
puts "RMS Power: $result(-rms) dBm"
puts "Samples: [llength $result(-pattern)]"Complete API documentation is available in doc/fftw.md
fftw::plan- Create FFT planfftw::destroy- Destroy planfftw::cleanup- Free FFTW resources
fftw::set- Set multiple valuesfftw::setAt- Set single valuefftw::get- Get values as nested listsfftw::getFlat- Get values as flat listfftw::getFlatInt- Get integer valuesfftw::getAt- Get single valuefftw::clear- Zero all arrays
fftw::execute- Run FFT/IFFTfftw::scale- Scale output values
fftw::calcMcWaveform- Generate multi-carrier waveforms
make testAll 21 tests should pass:
Tests running in interp: D:/CM.work/tcltk86/release/bin/tclsh86.exe
all.tcl: Total 21 Passed 21 Skipped 0 Failed 0
- Tcl 8.6 or higher
- FFTW3 library (libfftw3-3)
- C++ compiler with C++11 support
Ensure libfftw3-3.dll is in your PATH or in the same directory as the extension.
Install FFTW3 development package:
# Debian/Ubuntu
sudo apt-get install libfftw3-dev
# RedHat/CentOS
sudo yum install fftw-develCurrent Version: 3.3.4
- 3.3.4 (2023, H. Danzer): Added
-sigmaparameter for pseudorandom amplitudes - 3.3.3 (2022, H. Danzer): Minimum spacing changed to 1 Hz
- 1.0 (2010, Peter Schurek): Initial release
- Peter Schurek (Original implementation, 2010)
- H. Danzer (Enhancements, 2022-2023)
See LICENSE file for details.
- Spectral analysis
- Filter design and implementation
- Convolution and correlation
- Multi-carrier signal generation
- PAPR optimization
- AWG pattern creation
- Channel simulation
- Frequency domain analysis
- Signal characterization
- Calibration data application
For bugs and feature requests, please contact the maintainers or file an issue in the project repository.
- FFTW3: http://www.fftw.org/
- Tcl/Tk: https://www.tcl.tk/