
The Fourier Transform 169
MATLAB/Octave
>> af3 = fftshift(fft2(a3));
>> round(abs(af3))
ans =
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 9 0 21 32 21 0 9
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
The DC coefficient is of course the sum of all values of
a
; the other values may be considered
to be the coefficients of the necessary sine functions required to from an edge, as given in
Equation 7.1. The mirroring of values about the DC coefficient is a consequence of the
symmetry of the DFT.
All these can also be easily performed in Python, with the three images constructed as
Python
In: a1 = ones((8,8))
In: a2 = np.array([[100, 200],[100,200]]) ...