How to Do a 2-D Fourier Transform in Matlab

In today’s post, I will show you how to perform a two-dimensional Fast Fourier Transform in Matlab.  The 2D Fourier Transform is an indispensable tool in many fields, including image processing, radar, optics and machine vision.  In image processing, the 2D Fourier Transform allows one to see the frequency spectrum of the data in both dimensions and lets one visualize filtering operations more easily.  In radar, the 2D Fourier Transform is used as a fast way to create a map from a series of coherent radar pulses.  Additionally, the far-field pattern of a 2D antenna can be calculated using a 2D Fourier Transform.  In Fourier Optics, the 2D Fourier Transform is used to calculate the propagation of electromagnetic waves and through space and optical elements. Continue reading

How to Use Imagesc in Matlab

On Matlab Geeks, we have already covered basic two-dimensional plotting techniques.  We would now like to start covering techniques for plotting three-dimensional data.  One of the easiest and most visually pleasing ways of plotting three-dimensional data onto a 2-D surface is imagesc.  Originally meant to be used with image data, this function is a great tool for plotting 2-D matrices.  Imagesc is different from the image function in that the data is automatically scaled to fit the range of the colormap.  This feature makes representing a matrix with imagesc is far easier than with image.  We recommend using imagesc to plot data from a 2-D matrix. Continue reading