WOLFRAM
Products
Wolfram|One
Mathematica
Wolfram Notebook Assistant + LLM Kit
Wolfram|Alpha Notebook Edition
System Modeler
All Products
Consulting & Solutions
Wolfram Consulting
Industry Solutions
Solutions for Education
Learning & Support
Wolfram U Courses
Wolfram Language Resources
Wolfram Community
Support FAQs
Contact Support
Company
About Wolfram
Careers
Events
Educational Programs
All Sites and Resources
Wolfram|Alpha
Wolfram Cloud
Your Account
Your Account
User Portal
Search
Close
Enable JavaScript to interact with content and submit forms on Wolfram websites.
Learn how
Legacy Documentation
Digital Image Processing
(2000)
This is documentation for an obsolete product.
Current products and services
User's Guide
Filter Design
9.4 2D FIR Filter Design Methods
A common method of obtaining 2D filters is to obtain them indirectly by transforming 1D prototypes. The simplest method imposes rectangular symmetry on the resulting 2D filter by taking the outer product of two 1D filters. Its impulse response is separable and may be written as a product of two 1D impulse responses.
for 0≤n
1
≤N
1
-1 and 0≤n
2
≤N
2
-1. Typically, f = g.
In order to obtain a circularly symmetric 2D filter from a 1D prototype, the common approach is to use the McClellan transformation or simply the frequency transformation [
McC73a
]. The resulting filters have good performance, circular symmetry, and under a restricted set of conditions, have been shown to be optimal.
FrequencyTransformation
[
h
]
returns a circularly symmetric
2
D FIR filter from 1D prototype
h
using the McClellan frequency transformation
Filter2D
[
h
,
g
]
returns
1D to 2D conversion functions.
This loads the package.
In[1]:=
Here we use the McClellan transformation to transform a 1D equiripple filter to a circularly symmetric 2D filter. The prototype filter is lowpass.
In[2]:=
This calculates the magnitude spectrum of the 2D lowpass filter using a 64-point DFT.
In[3]:=
This plots the magnitude spectrum.
In[4]:=
Out[4]=
A rectangularly supported 2D FIR filter based on the same 1D prototype has the following magnitude response.
In[5]:=
We can now view the magnitude spectrum of this filter by computing a 64-point DFT of the 2D sequence.
In[6]:=
Out[6]=
A direct method of designing 2D FIR filters is available by using windows. Design of 2D FIR filters using the window method is similar to its 1D counterpart. The infinite impulse response sequence is obtained from the ideal, desired frequency response by means of the inverse DTFT. Closed-form solutions exist for the 2D impulse response sequences of circularly symmetric filters [
Dud84
]. For example, the infinite impulse response sequence of the ideal, circularly symmetric lowpass filter is given by
WindowFilter2D
[
N
,
{
f
1
,
f
2
,
...
}
,
{
v
1
,
v
2
,
...
}
]
returns an
N
×
N
linear-phase FIR filter given a specification that consists of filter length
N
, cutoff frequencies
f
over the symmetric, normalized
0
and values of the frequency response
v
i
; the
2D filter design function.
For example, the infinite impulse response sequence of the ideal, circularly symmetric lowpass filter is given by
where J
1
(.) is the Bessel function of the first kind of order 1,
C
is the cutoff frequency, and
. A circularly symmetric highpass filter has an impulse response given by
where J
1
(.) is the Bessel function of the first kind of order 1,
C
is the cutoff frequency, and
. Other types of piecewise constant bandpass filters may be constructed from combinations of lowpass and highpass impulse responses. The impulse response is next truncated and smoothed with an appropriate window sequence.
DiscreteWindow2D
[
N
,
type
]
returns an
N
×
N
circularly symmetric window sequence with shape given by
type
DiscreteWindow2D
[
{
N
1
,
N
2
}
,
type
]
returns an
N
1
×
N
2
rectangularly symmetric window sequence with shape given by
type
2D window sequences.
Here we illustrate the design of a circularly symmetric lowpass filter using the window method. We use the same cutoff frequency as in the 1D design example, namely f
c
=0.225 Hz.
In[7]:=
Here we plot the filter's magnitude spectrum.
In[8]:=
Out[8]=