A particular property of FIR filters that has proven to be very powerful
is that a linear phase shift for the frequency response is possible. This
is especially important to time domain details of a signal. The spectrum
of a signal contains the individual frequency domain components separated
in frequency. The process of filtering usually involves passing some of
these components and rejecting others. This is done by multiplying the
desired ones by one and the undesired ones by zero. When they are
recombined, it is important that the components have the same time domain
alignment as they originally did. That is exactly what linear phase
insures. A phase response that is linear with frequency keeps all of the
frequency components properly registered with each other. That is
especially important in seismic, radar, and sonar signal analysis as well
as for many medical signals where the relative time locations of events
contains the information of interest.
To develop the theory for linear phase FIR filters, a careful definition
of phase shift is necessary. If the real and imaginary parts of
H(ω)H(ω) are given by
H
(
ω
)
=
R
(
ω
)
+
j
I
(
ω
)
H
(
ω
)
=
R
(
ω
)
+
j
I
(
ω
)
(13)where j=-1j=-1 and the magnitude is defined
by
|
H
(
ω
)
|
=
R
2
+
I
2
|
H
(
ω
)
|
=
R
2
+
I
2
(14)and the phase by
Φ
(
ω
)
=
arctan
(
I
/
R
)
Φ
(
ω
)
=
arctan
(
I
/
R
)
(15)which gives
H
(
ω
)
=
|
H
(
ω
)
|
e
j
Φ
(
ω
)
H
(
ω
)
=
|
H
(
ω
)
|
e
j
Φ
(
ω
)
(16)in terms of the magnitude and phase. Using the real and imaginary parts is
using a rectangular coordinate system and using the magnitude and phase is
using a polar coordinate system. Often, the polar system is easier to
interpret.
Mathematical problems arise from using |H(ω)||H(ω)| and Φ(ω)Φ(ω),
because |H(ω)||H(ω)| is not analytic and Φ(ω)Φ(ω) not continuous.
This problem is solved by introducing an amplitude function A(ω)A(ω)
that is real valued and may be positive or negative. The frequency
response is written as
H
(
ω
)
=
A
(
ω
)
e
j
Θ
(
ω
)
H
(
ω
)
=
A
(
ω
)
e
j
Θ
(
ω
)
(17)where A(ω)A(ω) is called the amplitude in order to
distinguish it from the magnitude |H(ω)||H(ω)|, and Θ(ω)Θ(ω) is
the continuous version of Φ(ω)Φ(ω). A(ω)A(ω) is a real, analytic
function that is related to the magnitude by
A
(
ω
)
=
±
|
H
(
ω
)
|
A
(
ω
)
=
±
|
H
(
ω
)
|
(18)or
|
A
(
ω
)
|
=
|
H
(
ω
)
|
|
A
(
ω
)
|
=
|
H
(
ω
)
|
(19)With this definition, A(ω)A(ω) can be made analytic and
Θ(ω)Θ(ω) continuous. These are much easier to work with than
|H(ω)||H(ω)| and Φ(ω)Φ(ω). The relationship of A(ω)A(ω) and
|H(ω)||H(ω)|, and of Θ(ω)Θ(ω) and Φ(ω)Φ(ω) are shown in
Figure 3.
To develop the characteristics and properties of linear-phase
filters, assume a general linear plus constant form for the phase
function as
Θ
(
ω
)
=
K
1
+
K
2
ω
Θ
(
ω
)
=
K
1
+
K
2
ω
(20)This gives the frequency response function of a length-N FIR
filter as
H
(
ω
)
=
∑
n
=
0
N
-
1
h
(
n
)
e
-
j
ω
n
=
e
-
j
ω
M
∑
n
=
0
N
-
1
h
(
n
)
e
j
ω
(
M
-
n
)
H
(
ω
)
=
∑
n
=
0
N
-
1
h
(
n
)
e
-
j
ω
n
=
e
-
j
ω
M
∑
n
=
0
N
-
1
h
(
n
)
e
j
ω
(
M
-
n
)
(21)and
H
(
ω
)
=
e
-
j
ω
M
[
h
0
e
j
ω
M
+
h
1
e
j
ω
(
M
-
1
)
+
⋯
+
h
N
-
1
e
j
ω
(
M
-
N
+
1
)
]
H
(
ω
)
=
e
-
j
ω
M
[
h
0
e
j
ω
M
+
h
1
e
j
ω
(
M
-
1
)
+
⋯
+
h
N
-
1
e
j
ω
(
M
-
N
+
1
)
]
(22)Equation 22 can be put in the form of
H
(
ω
)
=
A
(
ω
)
e
j
(
K
1
+
K
2
ω
)
H
(
ω
)
=
A
(
ω
)
e
j
(
K
1
+
K
2
ω
)
(23)if MM (not necessarily an integer) is defined by
M
=
N
-
1
2
M
=
N
-
1
2
(24)or equivalently,
M
=
N
-
M
-
1
M
=
N
-
M
-
1
(25)Equation 22 then becomes
H
(
ω
)
=
e
-
j
ω
M
[
(
h
0
+
h
N
-
1
)
cos
(
ω
M
)
+
j
(
h
0
-
h
N
-
1
)
sin
(
ω
M
)
+
(
h
1
+
h
N
-
2
)
cos
(
ω
(
M
-
1
)
)
+
j
(
h
1
-
h
N
-
2
)
sin
(
w
(
M
-
1
)
)
+
⋯
]
H
(
ω
)
=
e
-
j
ω
M
[
(
h
0
+
h
N
-
1
)
cos
(
ω
M
)
+
j
(
h
0
-
h
N
-
1
)
sin
(
ω
M
)
+
(
h
1
+
h
N
-
2
)
cos
(
ω
(
M
-
1
)
)
+
j
(
h
1
-
h
N
-
2
)
sin
(
w
(
M
-
1
)
)
+
⋯
]
(26)There are two possibilities for putting this in the form of
Equation 23 where A(ω)A(ω) is real: K1=0K1=0 or K1=π/2K1=π/2. The first case
requires a special even symmetry in h(n)h(n) of the form
h
(
n
)
=
h
(
N
-
n
-
1
)
h
(
n
)
=
h
(
N
-
n
-
1
)
(27)which gives
H
(
ω
)
=
A
(
ω
)
e
-
j
M
ω
H
(
ω
)
=
A
(
ω
)
e
-
j
M
ω
(28)where A(ω)A(ω) is the amplitude, a real-valued function of ωω and
e-jMωe-jMω gives the linear phase with MM being the group delay.
For the case where NN is odd, using
Equation 26, Equation 27, and Equation 28, we have
A
(
ω
)
=
∑
n
=
0
M
-
1
2
h
(
n
)
cos
ω
(
M
-
n
)
+
h
(
M
)
A
(
ω
)
=
∑
n
=
0
M
-
1
2
h
(
n
)
cos
ω
(
M
-
n
)
+
h
(
M
)
(29)or with a change of variables,
A
(
ω
)
=
∑
n
=
1
M
2
h
(
M
-
n
)
cos
(
ω
n
)
+
h
(
M
)
A
(
ω
)
=
∑
n
=
1
M
2
h
(
M
-
n
)
cos
(
ω
n
)
+
h
(
M
)
(30)which becomes
A
(
ω
)
=
∑
n
=
1
M
2
h
^
(
n
)
cos
(
ω
n
)
+
h
(
M
)
A
(
ω
)
=
∑
n
=
1
M
2
h
^
(
n
)
cos
(
ω
n
)
+
h
(
M
)
(31)where h^(n)=h(M-n)h^(n)=h(M-n) is a shifted h(n)h(n).
These formulas can be made simpler by defining new coefficients so that
Equation 29 becomes
A
(
ω
)
=
∑
n
=
0
M
a
(
n
)
cos
(
ω
(
M
-
n
)
)
A
(
ω
)
=
∑
n
=
0
M
a
(
n
)
cos
(
ω
(
M
-
n
)
)
(32)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
(33)and Equation 31 becomes
A
(
ω
)
=
∑
n
=
0
M
a
(
n
)
cos
(
ω
n
)
A
(
ω
)
=
∑
n
=
0
M
a
(
n
)
cos
(
ω
n
)
(34)with
a
(
n
)
=
{
h
(
M
)
for
n
=
0
2
h
(
M
+
n
)
for
1
≤
n
≤
M
0
otherwise
.
a
(
n
)
={
h
(
M
)
for
n
=
0
2
h
(
M
+
n
)
for
1
≤
n
≤
M
0
otherwise
.
(35)Notice from Equation 34 for NN odd, A(ω)A(ω) is an even function around
ω=0ω=0 and ω=πω=π, and is periodic with period 2π2π.
For the case where NN is even,
A
(
ω
)
=
∑
n
=
0
N
/
2
-
1
2
h
(
n
)
cos
ω
(
M
-
n
)
A
(
ω
)
=
∑
n
=
0
N
/
2
-
1
2
h
(
n
)
cos
ω
(
M
-
n
)
(36)or with a change of variables,
A
(
ω
)
=
∑
n
=
1
N
/
2
2
h
(
N
/
2
-
n
)
cos
ω
(
n
-
1
/
2
)
A
(
ω
)
=
∑
n
=
1
N
/
2
2
h
(
N
/
2
-
n
)
cos
ω
(
n
-
1
/
2
)
(37)These formulas can also be made simpler by defining new coefficients so that
Equation 36 becomes
A
(
ω
)
=
∑
n
=
0
N
/
2
-
1
a
(
n
)
cos
(
ω
(
M
-
n
)
)
A
(
ω
)
=
∑
n
=
0
N
/
2
-
1
a
(
n
)
cos
(
ω
(
M
-
n
)
)
(38)where
a
(
n
)
=
{
2
h
(
n
)
for
0
≤
n
≤
N
/
2
-
1
0
otherwise
a
(
n
)
={
2
h
(
n
)
for
0
≤
n
≤
N
/
2
-
1
0
otherwise
(39)and Equation 37 becomes
A
(
ω
)
=
∑
n
=
1
N
/
2
a
(
n
)
cos
(
ω
(
n
-
1
/
2
)
)
A
(
ω
)
=
∑
n
=
1
N
/
2
a
(
n
)
cos
(
ω
(
n
-
1
/
2
)
)
(40)with
a
(
n
)
=
{
2
h
(
N
/
2
-
n
)
for
1
≤
n
≤
N
/
2
0
otherwise
a
(
n
)
={
2
h
(
N
/
2
-
n
)
for
1
≤
n
≤
N
/
2
0
otherwise
(41)Notice from Equation 40 for NN even, A(ω)A(ω) is an even function around ω=0ω=0, an odd function around ω=πω=π, and is periodic with period 4π4π. This requires A(π)=0A(π)=0.
For the case in Equation 23 where K1=π/2K1=π/2, an odd symmetry is
required of the form
h
(
n
)
=
-
h
(
N
-
n
-
1
)
h
(
n
)
=
-
h
(
N
-
n
-
1
)
(42)which, for NN odd, gives
H
(
ω
)
=
j
A
(
ω
)
e
j
M
ω
H
(
ω
)
=
j
A
(
ω
)
e
j
M
ω
(43)with
A
(
ω
)
=
∑
n
=
0
M
-
1
2
h
(
n
)
sin
ω
(
M
-
n
)
A
(
ω
)
=
∑
n
=
0
M
-
1
2
h
(
n
)
sin
ω
(
M
-
n
)
(44)and for NN even
A
(
ω
)
=
∑
n
=
0
N
/
2
-
1
2
h
(
n
)
sin
ω
(
M
-
n
)
A
(
ω
)
=
∑
n
=
0
N
/
2
-
1
2
h
(
n
)
sin
ω
(
M
-
n
)
(45)To calculate the frequency or amplitude response numerically, one must
consider samples of the continuous frequency response function above.
LL samples of the general complex frequency response H(ω)H(ω) in
Equation 21 are calculated 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
.
(46)for k=0,1,2,⋯,L-1k=0,1,2,⋯,L-1.
This can be written with matrix notation as
where HH is an LL by 1 vector of the samples of the complex
frequency response, FF is the LL by NN matrix of complex exponentials
from Equation 46, and hh is the NN by 1 vector of real filter
coefficients.
These equations are possibly redundant for equally spaced samples since
A(ω)A(ω)
is an even function and, if the phase response is linear, h(n)h(n) is
symmetric. These redundancies are removed by sampling Equation 32 over 0≤ωk≤π0≤ωk≤π and by using aa defined in Equation 33 rather than
hh. This can be written
where AA is an LL by 1 vector of the samples of the real valued
amplitude frequency response, CC is the LL by MM real matrix of
cosines from Equation 32, and aa is the MM by 1 vector of filter
coefficients related to the impulse response by Equation 33. A similar set
of equations can be written from Equation 44 for NN odd or from
Equation 45 for NN even.
This formulation becomes a filter design method by giving the samples of a
desired amplitude response as Ad(k)Ad(k) and solving Equation 48 for the
filter coefficients a(n)a(n). If the number of independent frequency
samples is equal to the number of independent filter coefficients and if
CC is not singular, this is the frequency sampling filter design method
and the frequency response of the designed filter will interpolate the
specified samples. If the number of frequency samples LL is larger than
the number of filter coefficients NN, Equation 48 may be solved
approximately by minimizing the norm ∥A(ω)-Ad(ω)∥∥A(ω)-Ad(ω)∥.
The discrete time Fourier transform of the impulse response of a digital
filter is its frequency response, therefore, it is an important tool.
When the symmetry conditions of linear phase are incorporated into the
DTFT, it becomes similar to the discrete cosine or sine transform
(DCT or DST). It also has an arbitrary normalization possible for
the odd length that needs to be understood.
The discrete time Fourier transform (DTFT) is defined in Equation 7
which, with the conditions of an odd length-N symmetrical signal,
becomes
A
(
ω
)
=
∑
n
=
1
M
a
(
n
)
cos
(
ω
n
)
+
K
a
(
0
)
A
(
ω
)
=
∑
n
=
1
M
a
(
n
)
cos
(
ω
n
)
+
K
a
(
0
)
(49)where M=(N-1)/2M=(N-1)/2. Its inverse as
a
(
n
)
=
2
π
∫
0
π
A
(
ω
)
cos
(
ω
n
)
d
ω
a
(
n
)
=
2
π
∫
0
π
A
(
ω
)
cos
(
ω
n
)
d
ω
(50)for n=1,2,⋯,Mn=1,2,⋯,M and
a
(
0
)
=
1
K
π
∫
0
π
A
(
ω
)
d
ω
a
(
0
)
=
1
K
π
∫
0
π
A
(
ω
)
d
ω
(51)where KK is a parameter of normalization for the
a(0)a(0) term with 0<K<∞0<K<∞. If K=1K=1, the expansion equation
Equation 49 is one summation and doesn't have to have the separate
term for a(0)a(0). If K=1/2K=1/2, the equation for the coefficients
Equation 50 will also calculate the a(0)a(0) term and the separate
equation Equation 51 is not needed. If K=1/2K=1/2, a symmetry
results which simplifies equations later in the notes.