Giter Site home page Giter Site logo

zywina / cfftpack Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 139 KB

C translation & wrapper of Fortran FFTPACK library with a few extras.

License: MIT License

CMake 0.29% C 68.95% C++ 5.89% HTML 24.87%
fftpack fft discrete-cosine-transform discrete-sine-transform dct dst dft

cfftpack's Introduction

cfftpack

C translation & wrapper of Fortran FFTPACK library with a few extras.

Having wrapped components of FFTPACK several times, both personally and professionally I finally decided to do a proper wrapper for the full thing, and open source it with a permissive license, so I could use it for both personal and commercial projects. If other people find it useful that is cool too.

Current status is BETA. Most things work except for stride modifications on some calcs.

Those with a quantitative finance background might find the test directory interesting. It contains some work from as yet unpublished papers of mine.

cfftpack's People

Contributors

zywina avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mfkiwl

cfftpack's Issues

TODO: add support for 2D convolution?

First, the library looks great as is. Nevertheless, adding a multiplication function that performs element-wise multiplication between two 2D arrays transformed with fft2() will extend the usability of the library to a greater audience, specially for those working on Image Processing applications on C/C++.

Are you still working on this?

Single-precision literals and using float and double together

All real literals in fftpack.c are double precision such as 2.0 or 1.0, except in 4 different instances we have .5f instead which is a bit odd.

Also in case anyone is interested, since I needed to be able to do both float and double FFTs in the same program I took fftpack.c, branched it into fftpack_float.c and fftpack_double.c, removed fft_real_t, removed the c__1 and c__2 globals (I put them inside the functions that need them instead to avoid having the same globals declared twice), removed everything related to the complex keyword and the other pointless macros, replaced fft_complex_t with fft_complexf_t / fft_complexd_t, then for the single precision version I converted the trigonometry function calls and the literals to single precision, and minor things like using the value of pi instead of calculating it from atan, made separate header guards, gave function names suffixes, all so that you can include both fftpack_float.c and fftpack_double.c in the same C file as I did here without conflict.

cfft2b_() described as "2D FFT"

In fftpack.h the comments describe cfft2b_() as "2D FFT" and cfft2f_() as "2D IFFT". Isn't it the opposite, since b stands for backward and f for forward? The FORTRAN documentation states that CFFT2B "is known as the backward transform or Fourier synthesis, transforming from spectral to physical space", making it the IFFT.

Either way, bang up job, I'll soon be using cfftpack in one of my programs to speed up convolution between image layers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.