##### Contents

Demonstrate the DFT spectrum of simple synthetic images.

# Script

## Constant image

The DFT of a constant image is a single point at F(0,0), which gives the sum of all pixels in the image.

```1. from ia636 import *
2.
3. f = ones((100, 200))
5. print F.round(4)```
```[[ 20000.+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     -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     -0.-0.j ...,      0.+0.j      0.+0.j
0.+0.j]]
```

## Square

The DFT of a square image is a digital sync.

```1. f = zeros((128, 128))
2. f[63:63+5,63:63+5] = 1

## Pyramid

The DFT of a pyramid is the square of the digital sync.

```1. f = zeros((128, 128))
2. k = array([[1,2,3,4,5,6,5,4,3,2,1]])
3. k2 = dot(k.T, k)
4. f[63:63+k2.shape[0], 63:63+k2.shape[1]] = k2

## Gaussian

The DFT of a Gaussian image is a Gaussian image.

```1. f = iagaussian((128,128),transpose([[65,65]]),[[3*3,0],[0,5*5]])
2. fn = ianormalize(f).astype(uint8)
```1. from ia636 import iacomb