Digital Image Processing allows you to design both one- and two-dimensional custom FIR filters and to solve even the hardest image filtering problems.

<< ImageProcessing`

Filter design

A common method of obtaining 2-D filters is to obtain them indirectly by transforming 1-D prototypes. The simplest method imposes rectangular symmetry on the resulting 2-D filter by taking the outer product of two 1-D filters. In order to obtain a circularly symmetric 2-D filter from a 1-D prototype, the common approach is to use the McClellan transformation also known as the frequency transformation [1]. The resulting filters have good performance as well as circular symmetry. They have also been shown to be optimal under a restricted set of conditions. Here we use the McClellan transformation to transform a 1-D equiripple filter to a circularly symmetric 2-D filter. The prototype filter is lowpass.

FrequencyTransformation[
        EquirippleFilter[
          21, {0.0, 0.2, 0.25, 0.5}, {1. , 0. }]];

This calculates the magnitude spectrum of the 2-D lowpass filter using a 128-point DFT.

128 Abs[DFT[%,  {128, 128}]];

This plots one quadrant of the magnitude spectrum.

ListPlot3D[Take[%, 64, 64], Mesh -> False, 
        Ticks -> {{{1, 0}, {32, 0.25}, {64, 0.5}}, {{1, 0}, {32, 
                0.25}, {64, 0.5}}, Automatic}, 
        PlotRange -> All];

[1] McClellan, J., "The design of two-dimensional digital filters by transformations," Proceedings of the annual Princeton Conference on Information Sciences and Systems, Vol. 7, 1973, 247-251.