[iadft] [Up] [iafftshift] Image Transformation

iadftmatrix
Kernel matrix for the DFT Transform.

Synopsis

A = iadftmatrix( N )

Implemented in Python.

Input

N Double. Non-negative integer.

Output

A Image. Gray-scale (uint8 or uint16) or binary image (logical).

Examples

Visualization of the Dft matrix
>>> import Numeric

              
>>> A = iadftmatrix(128)

              
>>> iashow(A.imag)
(128, 128) Min= -0.0883883476483 Max= 0.0883883476483 Mean=-0.000 Std=0.06
>>> iashow(A.real)
(128, 128) Min= -0.0883883476483 Max= 0.0883883476483 Mean=0.001 Std=0.06
A.imag A.real
Dft matrix is a unitary matrix
>>> import Numeric

              
>>> import LinearAlgebra

              
>>> A = iadftmatrix(4)

              
>>> print Numeric.array2string(A, precision=4, suppress_small=1)
[[ 0.5+0.j   0.5+0.j   0.5+0.j   0.5+0.j ]
 [ 0.5+0.j   0. -0.5j -0.5-0.j  -0. +0.5j]
 [ 0.5+0.j  -0.5-0.j   0.5+0.j  -0.5-0.j ]
 [ 0.5+0.j  -0. +0.5j -0.5-0.j   0. -0.5j]]
>>> print Numeric.array2string(A-Numeric.transpose(A), precision=4, suppress_small=1)
[[ 0.+0.j  0.+0.j  0.+0.j  0.+0.j]
 [ 0.+0.j  0.+0.j  0.+0.j  0.+0.j]
 [ 0.+0.j  0.+0.j  0.+0.j  0.+0.j]
 [ 0.+0.j  0.+0.j  0.+0.j  0.+0.j]]
>>> print abs(LinearAlgebra.inverse(A)-Numeric.conjugate(A)) < 10E-15
[[1 1 1 1]
 [1 1 1 1]
 [1 1 1 1]
 [1 1 1 1]]

Equation


Properties

Source Code

def iadftmatrix(N):
    from Numeric import reshape, Float64, exp, pi, sqrt, matrixmultiply, transpose
    x = reshape(range(N),(N,1)).astype(Float64)
    u = x
    Wn = exp(-1j*2*pi/N)
    A = (1./sqrt(N)) * (Wn ** matrixmultiply(u, transpose(x)))
    return A
    

See also

iadft Discrete Fourier Transform.
iaidft Inverse Discrete Fourier Transform.

See also

[iadft] [Up] [iafftshift] http://www.python.org