DMelt:DSP/2 Discrete Fourier Transform

From jWork.ORG
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents

Discrete Fourier Transform (DFT)

A discrete fourier transform (DFT) algorithm is based on the jWave package. This is a simple example of transformation of 1D array:

from math.jwave import Transform
from math.jwave.transforms import *
t=Transform( DiscreteFourierTransform( ) )
arrTime = [1., 10., 12., 8., 1., 1., 1., 1. ]
arrFreq = t.forward( arrTime ) # 1-D DFT forward
print arrFreq.tolist()
arrReco = t.reverse( arrFreq ) # 1-D DFT reverse
print arrReco.tolist()

The output of this script is:

[3.75, 5.0, 1.75, -0.5, -2.7499, 0.4999, -1.750, 5.0]
[1.0, 10.0, 12.0, 8.0, 1.0, 1.0, 1.0, 1.0]
More information on this topic is in DMelt books