You are a guest. Restricted access. Read more.
SCaVis manual

Fast Fourier transforms

Snippet from Wikipedia: Fast Fourier transform

A fast Fourier transform (FFT) is an algorithm to compute the discrete Fourier transform (DFT) and its inverse. Fourier analysis converts time (or space) to frequency (or wavenumber) and vice versa; an FFT rapidly computes such transformations by factorizing the DFT matrix into a product of sparse (mostly zero) factors. As a result, fast Fourier transforms are widely used for many applications in engineering, science, and mathematics.

FFT implementations

There are several packages dealing with the fast fourier transform (FFT) problem. We will discuss the fastest one, which uses many threads and the multicore computer architecture. It is based on the PrallelColt as implemented by Piotr Wendykier.

In this example we will use DComplexFactory2D factory to create a random dense matrix (DenseDComplexMatrix2D) and perform FCC.

Code example

  Download for this example is disabled for non-members
 1: #compute 2D Discrete Fourier Transform (DFT) of a random complex matrix:
 3: from cern.colt.matrix.tdcomplex import DComplexFactory2D
 4: from edu.emory.mathcs.utils  import ConcurrencyUtils
 5: from edu.emory.mathcs.jtransforms.fft import *
 7: ConcurrencyUtils.setNumberOfThreads(2)      # use 2 cores
 8: M = DComplexFactory2D.dense.random(100,100) # random matrix
 9: print type(M)
10: M.fft2() #  compute 2D DFT in-place
11: # print M.toString()

Discrete Cosine Transform (DCT)

This example is based on the real DenseDoubleMatrix2D matrix.

You have a limited access to this part. Unlock this text after becoming a full member.

You can also use 3D matrix methods, see DenseDoubleMatrix3D

Discrete Fourier transform (DFT) Transform

This is 1D DFT transform of a complex matrix 1000×1000 using several processing cores:

You have a limited access to this part. Unlock this text after becoming a full member.

Information for advanced users

Read the book "Scientific data analysis using Jython scripting and Java for more details. — Sergei Chekanov 2011/03/31 10:47

man/dsignal/fft.txt · Last modified: 2014/12/12 15:40 by admin
CC Attribution-Share Alike 3.0 Unported
Powered by PHP Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 Valid HTML5