Using specific transform from fftw library

2 views (last 30 days)
jassem44
jassem44 on 14 Jan 2020
Commented: jassem44 on 17 Apr 2020
Hi! So I'm trying to use a specific transform in the FFTW library (the REDFT01 (DCT-III) transform) but I'm not sure how I can access this through Matlab. My understanding is that the fftw command in Matlab only computes the standard fft using the most efficient algorithm based on the data to be analyzed, not a staggered grid cosine transform like the one I need.
I was wondering if I could use this transform directly in Matlab or if I have to use mex files to run the C code from the fftw package in Matlab?
Any other suggestions for trying to compute this transform efficiently would be very helpful. Thanks a lot!
  2 Comments
B Treeby
B Treeby on 17 Apr 2020
My understanding is that MATLAB only links to the complex-to-complex transforms in FFTW. Some time ago I wrote a MEX interface to FFTW to use the DCT and DST transforms within MATLAB. I've just made it available via GitHub and the file exchange in case it's helpful: https://www.mathworks.com/matlabcentral/fileexchange/75071-matlab-discrete-trigonometric-transform-library
jassem44
jassem44 on 17 Apr 2020
I ended up doing almost exactly what you suggested. I found a writeup of the function in C++ (from the book Numerical Recipes) and wrote a MEX interface. In any case, thank you very much for the response.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!