Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

2-D FIR filter using frequency transformation

`h = ftrans2(b, t)`

h = ftrans2(b)

`h = ftrans2(b, t)`

produces
the two-dimensional FIR filter `h`

that corresponds
to the one-dimensional FIR filter `b`

using the transform `t`

.
(`ftrans2`

returns `h`

as a computational
molecule, which is the appropriate form to use with `filter2`

.) `b`

must
be a one-dimensional, Type I (even symmetric, odd-length) filter such
as can be returned by `fir1`

, `fir2`

,
or `firpm `

in the Signal Processing Toolbox software.
The transform matrix `t`

contains coefficients that
define the frequency transformation to use. If `t`

is `m`

-by-`n`

and `b`

has
length `Q`

, then `h`

is size `((m-1)*(Q-1)/2+1)`

-by-`((n-1)*(Q-1)/2+1)`

.

`h = ftrans2(b)`

uses the McClellan
transform matrix `t`

.

t = [1 2 1; 2 -4 2; 1 2 1]/8;

All inputs and outputs should be of class `double`

.

Use `ftrans2`

to design an approximately circularly
symmetric two-dimensional bandpass filter with passband between 0.1
and 0.6 (normalized frequency, where 1.0 corresponds to half the sampling
frequency, or π radians):

Since

`ftrans2`

transforms a one-dimensional FIR filter to create a two-dimensional filter, first design a one-dimensional FIR bandpass filter using the Signal Processing Toolbox function`firpm`

.colormap(jet(64)) b = firpm(10,[0 0.05 0.15 0.55 0.65 1],[0 0 1 1 0 0]); [H,w] = freqz(b,1,128,'whole'); plot(w/pi-1,fftshift(abs(H)))

Use

`ftrans2`

with the default McClellan transformation to create the desired approximately circularly symmetric filter.h = ftrans2(b); freqz2(h)

The transformation below defines the frequency response of the
two-dimensional filter returned by `ftrans2`

.

$${{H}_{({\omega}_{1},{\omega}_{2})}=B(\omega )|}_{\mathrm{cos}\omega =T({\omega}_{1},{\omega}_{2})},$$

where *B(*ω*)* is
the Fourier transform of the one-dimensional filter `b`

:

$$B(\omega )={\displaystyle \sum _{n=-N}^{N}b(n){e}^{-j\omega n}}$$

and *T(*ω_{1}*,*ω_{2}*) * is
the Fourier transform of the transformation matrix `t`

:

$$T({\omega}_{1},{\omega}_{2})={\displaystyle \sum _{{n}_{2}}{\displaystyle \sum _{{n}_{1}}t({n}_{1},{n}_{2}){e}^{-j{\omega}_{1}{n}_{1}}{e}^{-j{\omega}_{2}{n}_{2}}}}.$$

The returned filter `h`

is the inverse Fourier
transform of *H(*ω_{1}*,*ω_{2}*)*:

$$h({n}_{1},{n}_{2})=\frac{1}{{\left(2\pi \right)}^{2}}{\displaystyle {\int}_{-\pi}^{\pi}{\displaystyle {\int}_{-\pi}^{\pi}H({\omega}_{1},{\omega}_{2}){e}^{j{\omega}_{1}{n}_{1}}{e}^{j{\omega}_{2}{n}_{2}}d{\omega}_{1}d{\omega}_{2}}}.$$

[1] Lim, Jae S., *Two-Dimensional
Signal and Image Processing*, Englewood Cliffs, NJ, Prentice
Hall, 1990, pp. 218-237.

Was this topic helpful?