December 2017
Intermediate to advanced
386 pages
10h 42m
English
The following code shows some of these routines in action when applied to a checkerboard:
import numpyfrom scipy.fftpack import fft,fft2, fftshiftimport matplotlib.pyplot as pltB=numpy.ones((4,4)); W=numpy.zeros((4,4))signal = numpy.bmat("B,W;W,B")onedimfft = fft(signal,n=16)twodimfft = fft2(signal,shape=(16,16))plt.figure()plt.gray()plt.subplot(121,aspect='equal')plt.pcolormesh(onedimfft.real)plt.colorbar(orientation='horizontal')plt.subplot(122,aspect='equal')plt.pcolormesh(fftshift(twodimfft.real))plt.colorbar(orientation='horizontal')plt.show()
Read now
Unlock full access