Digital Signal Processing Reference
In-Depth Information
A MATLAB program which implements the
Remez Exchange
Algorithm
is
given below,
% MATLAB Program to Implement Remez Algorithm
N of order 20;
f = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
w = f*pi
Hd = [0 0 1 1 0 0 1 1 0 0 0]
b = remez(N,f,Hd); yields the filter coefficients
b
(
n
),
n
= 0,1,2 …
M
[H w1] = freqz(b,1,128); gives the actual filter
response
H
(
w
)
plot(w,Hd,w1,abs(H));
plots the desired and actual
filter response
5.3.3
CAD of IIR Filters
The difference equation of an
Nth order IIR
filter can be written as:
ayn
()
+
ayn
(
−
1
)
+ … −
a yn N
(
)
=
bxn
()
+
bxn
(
−
1
)
+ …
bbxn M
M
(
−
)
0
1
N
0
1
) be the desired real-valued response of the IIR filter of order
m
.
The error term
E
(
Let
H
d
(
ω
ω
) is defined as:
E
(
ω
)
= H
d
(
ω
)
- H
(
ω
)
, -
π
≤
ω ≤
π
where
H
(
) is the actual filter response.
The
optimization problem
is then stated as:
ω
π
∫
2
Minimize
an bn
Ed
()
ωω
( ,()
−
π
1
---
which means that the values of the filter coefficients
a
(
n
),
n
= 0, 1 -
N
and
b
(
n
)
, n
= 0, 1, …
N
are to be chosen to minimize the mean squared error.
This
optimization is done by the
Yule-Walker Method.
In MATLAB, the command
>> [b,a] = yulewalk(N,f,H)
returns an
N
th order IIR filter design with the (
N
+ 1) coefficients
a
(
n
) and
b
(
n
), n = 0, 1, …
N
.