You are on page 1of 48

DESIGN OF IIR VARIABLE COMB FILTER USING FIR

VARIABLE FRACTIONAL DELAY ELEMENT

Chandra Bhushan Kumar

2018BSZ8601

April 24, 2019

1 / 48
Overview

1 Introduction
2 Methodology
Transfer function for the comb filter
Fixed comb filter design
Design of Stable Fixed Comb Filter
Design of Variable comb filter
Design of stable Variable Comb Filter
Weighted Least Square (WLS) Method to Design FIR VFD Filter
3 Implementation and Result Analysis
Fixed Comb Filter
Variable Comb Filter
4 Conclusion
5 References

2 / 48
Introduction

It is a filter which reject a specific frequency and its all harmonics.

Types of comb filters

Adaptive comb filter: The fundamental frequency of harmonic


interference is unknown or time varying.

Fixed comb filter: The fundamental frequency is known in advance.

The realization of comb filter can be done using IIR and FIR.

3 / 48
Transfer function for the comb filter

The desired frequency response given as:


(
0; w = kw0 , k = 0, 1, .......K
Hd (w ) =
1; otherwise
The band pass filter can be designed using notch filter in the
feedback.

Figure: Narrow band pass filter using a notch filter in the feedback
4 / 48
Transfer function for the comb filter

The transfer function can be written as:


1
Hbp (w ) =
1 + HN (Z )

Similarly, the multi-band pass filter can be designed using comb filter
in feedback and the transfer function can be written as:
1
Hm (Z ) =
1 + αHcomb (Z )

For the simplicity, I have used

Hcomb (Z ) = 1 − Z −D

5 / 48
Transfer function for the comb filter

The transfer function of comb filter can be written as:


1 − Z −D
HcomNew (Z ) = 1 − Hm (Z ) =
(α + 1)/(α) − Z −D

The block diagram of comb filter will be as shown in figure

Figure: The block diagram of comb filter


6 / 48
Transfer function for the comb filter

The transfer function of comb filter according to compensation


method given as :
1 − Z −D
Hc (Z ) =
1 − ρD Z −D
The corresponding block diagram is shown here

Figure: The block diagram of the comb filter.

7 / 48
Fixed comb filter design

The fractional delay element can be approximated using FIR filter as


given here
XN
−D
Z ≈ h[n]Z −n
n=0

The transfer function of a causal N th order FIR filter can be


represented as:
N
X
H(Z ) = h[n]Z −n
n=0

The frequency response is given by


N
X
H(e jw ) = h[n]e jnw
n=0

8 / 48
Fixed comb filter design

It can be written in vector product as

H(e jw ) = hT e(w )
where
h(n) = [h(0) h(1) h(2) .... h(N)]T

e(w ) = [1 e −jw e −j2w ... e −jNw ]T


The desired frequency response is given by Fd (w ) = e −jDw and to
achieve this goal we need to minimize least-square error given as
Z
J(h) = |H(w ) − Fd (w )|2 dw
W (R + UR − )

where R + = [0, 0.9π] and R − = [−0.9π, 0]

9 / 48
Fixed comb filter design

The error function J(h) can be written in quadratic form as given here
J(h) = ht Qh − 2ht P + c
where
Z 0.9π
Q=2 Re[e(w )e H (w )]dw
0
Z o.9π
P=2 Re[Fd (w )e ∗ (w )]dw
0
Z 0.9π
c=2 |Fd (w )|2 dw = 2απ
0
To design the comb filter, we must have the constraint as

H(kw0 ) = e −jDkw0
for k=0, 1, 2,. . .,M-1 and M = π/w0 .
10 / 48
Fixed comb filter design

After some manipulations above constrained can be written as

Ch = f

where C and f are real real valued matrix given by

C = [1, Re[e(0)], Re[e(w0 )], Im[e(w0 )], . . . . . .

. . . . . . . . Re[e(Mw0 )], Im[e(Mw0 )]]T

f = [1, cos(Dw0 ), −sin(Dw0 ), . . . . . .

. . . . . . . . . . . cos(DMw0 ), −sin(DMw0 )]T

11 / 48
Fixed comb filter design

The final objective function to optimize is Minimize hT Qh − 2hT P + c


Subject to Ch = f .

This optimization problem has been solved using Lagrange multiplier


method and the optimum filter coefficient is given as:

h = Q −1 P − Q −1 C T (CQ −1 C T )−1 [CQ −1 P − f ].

The same objective function is solved in different manipulations in


different reference paper and optimum filter coefficient is found as

Q1−1 r1
h=−
2

12 / 48
Fixed comb filter design

where "Z #
wp
r1 = −2Re Re[e(w )e H (w )]dw
0
Z wp
Q1 = e(w )e H (w )dw
−wp
where wp = 0.9π, by observation we can write vector r1 and the
matrix Q1 can be written as:



4wp ; i =D


r (i) = sin((D−i)wp )


−4 D−i ; 0 ≤ i ≥ N,

i 6= D

2wp ;
 i =l
Q1 (i, l) =
 sin((i−l)wp )

2 i−l ; 0 ≤ i ≤ N, i 6= l 13 / 48
Fixed comb filter design

To support this, I have plotted characteristics of filter coefficient hi


w.r.t. delay D is shown here

14 / 48
Design of Stable Fixed Comb Filter

PN
1− n=0 h[n]Z −n
Hcomb (Z ) = 1+α N −n
P
α − n=0 h[n]Z
For the stable comb filter, the real part of denominator must grater
than zero as given in [].
N
X 1+α
h[n]cos(nw ) ≤ −δ
α
n=0

where δ is a small and positive number. The equation (15) can be


written in vector form as
1+α
crT1 h ≤ −δ
α
where cr 1 =[1 cos(w) cos(2w) ...... cos(Nw)].
15 / 48
Design of Stable Fixed Comb Filter

Now we have objective function to optimize.

min hT Q1 h + r1T h + s1
h
1+α
s.t. crT1 h ≤ −δ
α
This is a standard form of linear programming optimization objective
function. Given below
1 T
min x Hx + f T x + C
x 2
s.t. Ax ≤ b

16 / 48
Design of Variable Comb Filter

The desired frequency response of WR-VFD can be given as

Hi (w , d) = e −jwd , |w | ≤ wp , Dmin ≤ d ≤ Dmax

N
X
H(z, q) = hn (q)z −n , −0.5 ≤ q ≤ 0.5
n=0
Here q is variable and depend on delay d as given:
d − 0.5(Dmax + Dmin )
q=
Dmax − Dmin
as above we have obsrve that that the variation hn (q) with respect to
’d’ is similar to sinc function. So, we can write as
sin((d − n)π)
H(z, q) = ĥn (q) = sinc(d − n)ĥn (q)
(d − n)π
17 / 48
Design of Variable Comb Filter

Where ĥn (q) is written as


M
X
ĥn (q) = h(n, m)q m
m=0

Now, the least square error between the desired frequency response
and designed WR-VFD FIR filter can written as
J(h) = s2 + r2T h + hT Q2 h
where
Z 0.5 Z wp
s2 = dwdq
0.5 −wp
"Z #
0.5 Z wp
r2 = −2Re e jwd c(w , p)dwdq
0.5 −wp

18 / 48
Design of Variable Comb Filter

Z 0.5 Z wp
Q2 = c(w , p)c H (w , p)dwdq
0.5 −wp

and

c(w , q) = [sinc(d), ......, sinc(d − N)e −jNw .̇...., sinc(d)q M ,

.̇.......h(N, M)q M e jNw ]T

19 / 48
Design of Variable Comb Filter

Now, after minimizing least square error the optimum FIR filter
coefficient h(n, m) obtained as

1
h = − Q2−1 r2
2

h = [h(0, 0), · · · , h(N, 0)e jNw ...., · · · h(0, M)q M , · · ·

. ··· h(N, M)q M e jNw ]T

Unified structure of VC filter


Dmax + Dmin
d = L(q) = q(Dmax − Dmin ) +
2

20 / 48
Unified structure of Variable Comb Filter

(a)

(b)

Figure: Structure of a WR-VFD FIR filter: (a)The over all structure, (b)
Coefficient generator

21 / 48
Design of stable Variable Comb Filter

Similar to stability condition for the fixed comb filter, we can get the
following condition for stability VC filter:
1+α
crT2 h ≤ −δ
α
where cr 2 = Real[c(w , q)].
Finally, we have objective function to optimize.

min hT Q2 h + r2T h + s2
h
1+α
s.t. crT2 h ≤ −δ
α
This objective function can solved with standard quadratic linear
programming

22 / 48
Weighted Least Square (WLS) Method to Design FIR VFD
Filter
Similar to earlier methods the delay element Z −D is designed using
FIR filter
N
X
H(z, d) = hn (d)z −n , −0.5 ≤ d ≤ 0.5
n=−N

where
d = D − D̂ = 2π/w0 − Rou[2π/w0 ]

and
M
X
hn (d) = h(n, m)d m , −N ≤ n ≤ N
m=0
where w0 , ’N’ and M are harmonic frequency, half order of filter and
number notch frequency of VC filtr respectively.
23 / 48
Weighted Least Square (WLS) Method to Design FIR VFD
Filter

The weighted least square error is used as the objective function to


design FIR VFD filter which is given here
Ld
Lw X
X
e(H) = W (wi )|F (wi , dl ) − H(e jwi , dl )|2
i=0 l=0
2iwp l
where wi = −wp + Lw , and dl = −0.5 + Ld

For the minimum value of WLS error the coefficient matrix ’H’ is
obtained as

H = (C T C + S T S)−1 (C T RST I )D(D T D)−1

24 / 48
Weighted Least Square (WLS) Method to Design FIR VFD
Filter
where
H = [h(n, m), −N ≤ n ≤ N, 0 ≤ m ≤ M]

R = [W 1/2 (wi )cos(wi dl )], 0 ≤ i ≤ Lw , 0 ≤ l ≤ Ld

I = [W 1/2 (wi )sin(wi dl )], 0 ≤ i ≤ Lw , 0 ≤ l ≤ Ld

C = [W 1/2 (wi )cos(wi dl )], 0 ≤ i ≤ Lw , −N ≤ l ≤ N

S = [W 1/2 (wi )sin(wi dl )], 0 ≤ i ≤ Lw , −N ≤ l ≤ N


and
D = [djm ], 0 ≤ j ≤ Ld , 0 ≤ l ≤ M

25 / 48
Fixed Comb Filter

I have implemented fixed comb filter using both fixed multiplier


transfer function and dependent multiplier transfer function.

(a)
26 / 48
Fixed Comb Filter

(b)
Figure: Magnitude response of comb filter transfer function in equation (12)
with w0 = 0.17 ∗ π, D = 2 ∗ π/w0 and N=64 for: (a) with fixed multiplier
and (b) with dependent multiplier
27 / 48
Fixed Comb Filter

I have implemented fixed comb filter using both fixed multiplier


transfer function and dependent multiplier transfer function with
alternative equation.

(a)
28 / 48
Fixed Comb Filter

(b)
Figure: Magnitude response of comb filter transfer function in equation (12)
with w0 = 0.17 ∗ π, D = 2 ∗ π/w0 and N=64 for: (a) with fixed multiplier
and (b) with dependent multiplier
29 / 48
Fixed Comb Filter

The pole zero plot of designed fixed comb filter

Figure: Pole-Zero plot of Fixed comb filter


30 / 48
Implementation and Result of Stable Fixed Comb Filter

After comparing our optimization objective to quadratic linear


programming objective function, I have taken H = 2Q1 and f = cr

(a)
Figure: Magnitude response of stable comb filter with w0 = 0.17 ∗ π,
D = 2 ∗ π/w0 and N=64
31 / 48
Implementation and Result of Stable Fixed Comb Filter

Pole- zero plot of stable fixed Comb filter

Figure: Pole-Zero plot of stable Fixed comb filter with w0 = 0.17 ∗ π,


D = 2 ∗ π/w0 and N=64

32 / 48
Implementation and Result of Stable Fixed Comb Filter

Pole- zero plot of stable fixed Comb filter

Figure: Pole-Zero plot of stable Fixed comb filter with w0 = 0.17 ∗ π,


D = 2 ∗ π/w0 and N=64

33 / 48
Implementation and Result of variable Comb Filter

I have implemented variable comb filter with the filter of order N=64
using wp = 0.9π. Dmin = 2π/(0.33π) and Dmax = 2π/(0.0625π).

34 / 48
Implementation and Result of variable Comb Filter

Figure: Pole-zero plot of variable comb filter for order N=64

35 / 48
Implementation and Result of variable Comb Filter

Figure: Pole-zero plot of variable comb filter for order N=110

36 / 48
Implementation and Result of variable Comb Filter

I have implemented variable comb filter with the filter of order N=110
using wp = 0.9π. Dmin = 2π/(0.33π) and Dmax = 2π/(0.0625π).

37 / 48
Implementation and Result of Stable variable Comb Filter

After comparing our optimization objective to quadratic linear


programming objective function, I have taken H = 2Q2 and f = cr 2

Figure: Magnitude response of stable comb filter with using wp = 0.9π.


Dmin = 2π/(0.33π) and Dmax = 2π/(0.0625π) and N=64
38 / 48
Implementation and Result of Stable variable Comb Filter

Pole- zero plot of stable variable Comb filter

Figure: Pole-Zero plot of stable variable comb filter with w0 = 0.17 ∗ π,


D = 2 ∗ π/w0 and N=64

39 / 48
Implementation and Result of Stable variable Comb Filter

Pole- zero plot of stable fixed Comb filter for N=110

Figure: Pole-Zero plot of stable Fixed comb filter with w0 = 0.17 ∗ π,


D = 2 ∗ π/w0 and N=110

40 / 48
Implementation and Result of Stable variable Comb Filter

After comparing our optimization objective to quadratic linear


programming objective function, I have taken H = 2Q2 and f = cr 2

Figure: Magnitude response of stable comb filter with using wp = 0.9π.


Dmin = 2π/(0.33π) and Dmax = 2π/(0.0625π) and N=110 and α = 20
41 / 48
Implementation of Variable comb Filter When FIR VFD
filter is Designed by Weighted Least Square (WLS) Method

I have implemented filter of order N=64 using wp = 0.9π,


Lw = 400wp /π, Ld = 200 and W (wi ) = 1 for wp ≤ w ≤ wp .

Figure: Magnitude response of variable comb filter for order N=64

42 / 48
Implementation of Variable comb Filter When FIR VFD
filter is Designed by Weighted Least Square (WLS) Method

Figure: Pole-zero plot of variable comb filter for order N=64


43 / 48
Implementation of Variable comb Filter When FIR VFD
filter is Designed by Weighted Least Square (WLS) Method

Figure: Pole-zero plot of variable comb filter for order N=120


44 / 48
Implementation of Variable comb Filter When FIR VFD
filter is Designed by Weighted Least Square (WLS) Method

I have implemented variable comb filter with the filter of order N=120
using wp = 0.9π. Dmin = 2π/(0.33π) and Dmax = 2π/(0.0625π).

45 / 48
Conclusion

In this self study component of the course, I have studied and


implemented recent research work about IIR variable variable comb
filter using FIR variable fractional delay element.
In this work, I have implemented comb filter where fractional delay
element is approximated using FIR filter with least square method.
This results unstable comb filter.
So, I have applied quadratic linear programming to obtain stable
comb filter.
In future, I will check the stability of variable comb filter where VFD
filter is implemented using WLS method and also evaluate the
performance of designed filter in terms of normalized
root-mean-squared error of a frequency response and the maximum
absolute error of a frequency response.
Finally, I have learned so many new concepts during this course and
project work.
46 / 48
References

Pei, Soo-Chang and Huang, Yun-Da and Lin, Shih-Hsin and Shyu,
Jong-Jy,”Design of variable comb filter using FIR variable fractional
delay element”, Signal Processing, volume-92, number-10,
pages-2409–2421, year-2012, publisher-Elsevier.
Pei, Soo-Chang and Tseng, Chien-Cheng, ”A comb filter design using
fractional-sample delay”, IEEE Transactions on Circuits and Systems
II: Analog and Digital Signal Processing volume-45 number-5,
pages-649–653, year-1998, IEEE.
Engelberg, Shlomo, ”Precise variable-Q filter design [DSP Tips &
Tricks]”, IEEE Signal Processing Magazine 2008, volume-25,
number-5, pages-113–119.
Shyu, Jong-Jy and Pei, Soo-Chang and Huang, Yun-Da ”A new
method for the design of variable comb filters”, 2015 IEEE
International Conference on Consumer Electronics-Taiwan 2015,pages-
416-417,
47 / 48
References

J.J.Shyu, S.C.Pei, C.H.Chan, Y.D.Huang, ”Minimax designofvariable


fractional-delay FIR digital filters by iterative weighted least-squares
approach, IEEE Signal Processing Letters 15 (2008), 693696.
W.-S. Lu, S.-C. Pei and C.-C. Tseng, A weighted least-squares
method for the design of stable 1-D and 2-D IIR digital filters, IEEE
Trans.Signal Process., vol. 48, no. 1, pp.1-10, Jan. 1998.
J.-J. Shyu, S.-C. Pei, and Y.-D. Huang,”A new method for the design
of variable comb filters,” IEEE International Conference on Consumer
Electronics - Taiwan (ICCE-TW), Taipei, pp. 416-417, 2015.
J.J. Shyu, S.C. Pei, C.H. Chan, Y.D. Huang, Minimax design of
variable fractional-delay FIR digital filters by iterative weighted least
squares approach, IEEE Signal Processing Letters 15 (2008) 693696.
J.J. Shyu, S.C. Pei, C.H. Chan, Y.D. Huang, Minimax design of
Wide-Range variable fractional-delay FIR digital filters
48 / 48

You might also like