Shared Library: FFTW Wrapper

Post Reply
User avatar
Cedron
Posts: 87
Joined: Thursday 21st February 2019 5:02pm
Location: The Mitten State
Contact:

Shared Library: FFTW Wrapper

Post by Cedron » Sunday 31st March 2019 6:08pm

FFTW.zip
(15.68 KiB) Downloaded 28 times
This is a shared library test project which will compile and run the included shared library libGambas_FFTW.so.

If you have the directory setup as describe in my "Auto-Compiling Shared Libraries" post, simply download the the zip file into the libGambas directory and unzip it there. This is not a full project in the traditional sense, but rather more like a large code snippet, which is why I am not posting it to the farm or distributing it as a Source/Install archive.

Once it is unzipped, open the test project in the Gambas IDE and run it. This will compile the library (gcc required on your system). The library file (.so) can be referenced where it is at, copied to /usr/lib (as administrator), or a link can be made in /usr/lib referencing the file.

The library has routines for Forward and Backward (aka Inverse) DFTs (Discrete Fourier Transforms) for real and complex signals. For real signals, only half the DFT is calculated and stored. Thus, when taking the inverse, the size of the DFT cannot be used to determine the size of the signal. The only piece of information missing is whether the sample count should be odd or even. This specification is necessary for the call into the Gambas module provided. Of course, you can also use the provided Gambas module as a model for how to call the shared library directly.

The source code uses the Complex, Vector, and Matrix classes from the gb.gsl component, so it must be included in your project though its methods are never called.

I'm fairly heavily involved in Digital Signal Processing, so this is a big piece that has been missing in Gambas for me.

https://www.dsprelated.com/blogs-1/nf/Cedron_Dawg.php

https://dsp.stackexchange.com/users/33154/cedron-dawg
.... and carry a big stick!

Post Reply