module NumRu::FFTW3

Fast Fourier Transforms by using FFTW Ver.3.

Takeshi Horinouchi

(C) Takeshi Horinouchi / GFD Dennou Club, 2003

NO WARRANTY

Features

Features yet to be introduced

Installation

How to use

See the following peice of code. (Install this library and copy and paste the following to the interactive shell irb).

require "numru/fftw3"
include NumRu

na = NArray.float(8,6)   # float -> will be corced to complex
na[1,1]=1

# <example 1>
fc = FFTW3.fft(na, -1)/na.length  # forward 2D FFT and normalization
nc = FFTW3.fft(fc, 1)       # backward 2D FFT (complex) --> 
nb = nc.real                # should be equal to na except round errors  

# <example 2>
fc = FFTW3.fft(na, -1, 0) / na.shape[0]  # forward FFT with the first dim

# <example 3>
fc = FFTW3.fft(na, -1, 1) / na.shape[1]  # forward FFT with the second dim

API Reference

Module methods

fft(narray, dir [,dim,dim,...])

Complex FFT.

The 3rd, 4th,... arguments are optional.

ARGUMENTS

RETURN VALUE

NOTE