A direct way of designing FIR filters from samples of a desired amplitude
simply takes the sampled definition of the frequency response
Equation 29 from FIR Digital Filters as
A
(
ω
k
)
=
∑
n
=
0
M

1
2
h
(
n
)
cos
ω
k
(
M

n
)
+
h
(
M
)
A
(
ω
k
)
=
∑
n
=
0
M

1
2
h
(
n
)
cos
ω
k
(
M

n
)
+
h
(
M
)
(22)or the reduced form from Equation 37 from FIR Digital Filters as
A
(
ω
k
)
=
∑
n
=
0
M
a
(
n
)
cos
(
ω
k
(
M

n
)
)
A
(
ω
k
)
=
∑
n
=
0
M
a
(
n
)
cos
(
ω
k
(
M

n
)
)
(23)where
a
(
n
)
=
{
2
h
(
n
)
for
0
≤
n
≤
M

1
h
(
M
)
for
n
=
M
0
otherwise
a
(
n
)
={
2
h
(
n
)
for
0
≤
n
≤
M

1
h
(
M
)
for
n
=
M
0
otherwise
(24)for k=0,1,2,...,Mk=0,1,2,...,M and solves the M+1M+1 simultaneous equations for a(n)a(n) or equivalently, h(n)h(n). Indeed, this approach can be taken with general nonlinear phase design from
Indeed, this approach can be taken with general nonlinear phase design from
H
(
ω
k
)
=
∑
n
=
0
N

1
h
(
n
)
e
j
ω
k
n
H
(
ω
k
)
=
∑
n
=
0
N

1
h
(
n
)
e
j
ω
k
n
(25)for k=0,1,2,⋯,N1k=0,1,2,⋯,N1 which gives NN equations with NN unknowns.
This design by solving simultaneous equations allows nonequally spaced
samples of the desired response. The disadvantage comes from the numerical
calculations taking considerable time and being subject to inaccuracies if
the equations are illconditioned.
The frequency sampling design method is interesting but is seldom used
for direct design of filters. It is sometimes used as an interpolating
method in other design procedures to find h(n)h(n) from calculated A(ωk)A(ωk).
It is also used as a basis for a least squares design method discussed in
the next section.