You are here : matlabImage Processingfwind2

fwind2() - Image Processing

```Use fwind2 to design two-dimensional FIR
filters using the window method. fwind2 uses a
two-dimensional window specification to design a two-dimensional FIR
filter based on the desired frequency response Hd. fwind2 works
with two-dimensional windows; use fwind1 to work
with one-dimensional windows.h = fwind2(Hd, win) produces
the two-dimensional FIR filter h using an inverse
Fourier transform of the desired frequency response Hd and
multiplication by the window win. Hd is
a matrix containing the desired frequency response at equally spaced
points in the Cartesian plane. fwind2 returns h as
a computational molecule, which is the appropriate form to use with filter2. h is
the same size as win.For accurate results, use frequency points returned by freqspace to
create Hd. (See the entry for freqspace for
you specify the desired frequency response Hd at
arbitrary frequencies (f1 and f2)
along the x- and y-axes.
The frequency vectors f1 and f2 should
be in the range -1.0 to 1.0, where 1.0 corresponds to half the sampling
frequency, or π radians. h is the same size
as win.```

Syntax

`h = fwind2(Hd, win)h = fwind2(f1, f2, Hd, win)`

Example

```[f1,f2] = freqspace(21,'meshgrid');
Hd = ones(21);
r = sqrt(f1.^2 + f2.^2);
Hd((r<0.1)|(r>0.5)) = 0;
colormap(jet(64))
mesh(f1,f2,Hd)```