Diagramas de bloco e grafos de fluxo de sinal Estruturas de filtros IIR Projeto de filtro FIR
-
Upload
brandon-grant -
Category
Documents
-
view
39 -
download
0
description
Transcript of Diagramas de bloco e grafos de fluxo de sinal Estruturas de filtros IIR Projeto de filtro FIR
1
• Diagramas de bloco e grafos de fluxo de sinal
• Estruturas de filtros IIR
• Projeto de filtro FIR
Filtros Digitais
2
• Linear constant-coefficient difference equations (LCCDEs).
• Taking the two sided Z-transform we have
• H(z) is a filter transfer function, and can be used to describe
any digital filter.
– Expressed as a diagram or signal flow graph
– Implemented as a digital circuit
6.1.1 Filter Transfer Function
M
kk
N
kkk n x b k n y a n y
0 1
] [ ] [ ] [
M
kk
K
kkk n x b k n y a n y
0 1
] [ ] [ ] [
M
k
kk N
k
kk
z bz a
z Hz H z H0
1
1 2
1
1) ( ) ( ) (
3
• A signal flow graph representation of LCCDE is same as a block
diagram, and it is a network of directed branches that connect at
nodes which are variables.
6.1.2 Block Diagram and Signal Flow Graph
Block diagram representation of a first-order digital filter.
Structure of the signal flow graph.
Structure of the signal flow graph with the delay branch indicated by z-1.
4
6.1.3 Block Diagram: Direct Form I Realization
M
kkk n x b n v
0
] [ ] [
N
kk nvknyany
1
][][][
) ( ) ( ) ( ) (0
1z X z b z X z H z VM
k
kk
) (1
1) ( ) ( ) (
1
2z Vz a
z Vz H z YN
k
kk
This structure (non-canonic, direct form I) can be too sensitive to
finite word-length errors (quantization errors) – errors are summed,
fed back and re-amplified over and over.
5
6.1.4 Block Diagram: Direct Form II Realization
N
kkn x k n w a n w
1
] [ ] [ ] [
N
kk knwbny
0
][][
) (1
1) ( ) ( ) (
1
2z Xz a
z X z H z WN
k
kk
) ( ) ( ) ( ) (0
1z W z b z Wz H z YM
k
kk
This structure (canonic direct from, direct form II) requires less
delay elements. The minimum number of delays is max(N, M).
6
6.1.5 Example of LTI Implementation
Consider the LTI system with system (transfer) function
we have two implementation as follows
2 1
1
9. 0 5. 1 1
2 1) (
z z
zz H . 9. 0 , 5. 1 , 2 , 12 1 1 0 a a b b
7
• Given the LCCDE
6.1.6 Signal Flow Graph: Direct Forms
M
kk
N
kkk n x b k n y a n y
0 1
] [ ] [ ] [Signal Flow Chart of Direct From I Signal Flow Chart of Direct From II
8
• By factoring the numerator and denominator we can write
which can be drawn as a cascade of smaller sections:
• Advantages: Smaller sections – less feedback error.
• Disadvantages: Errors fed from section-to-section.
6.2.1 Structure of IIR: Cascade Form
I
ii zHzH
1
)()(
)(1 zH )(2 zH )(zH I
)(zH
9
6.2.2 Parallel Realization
• By performing a partial fraction expansion we can write
which can be drawn as a parallel sum of smaller sections
• Advantages: smaller sections- less feedback error, and error
confined to each section.
I
ii zHzH
0
)()(
)(1 zH
)(1 zH
)(1 zH
:
)(zH
10
6.2.3 Structure of IIR: Example (Cascade)
Given a two-order system
• Cascade Structure (Not unique)21
21
125.075.01
21)(
zz
zzzH
1
1
1
1
25.01
1
5.01
1)(
z
z
z
zzH
11
6.2.4 Structure of IIR: Example (Parallel)
Given a two-order system
• Parallel Structure (Not unique)21
21
125.075.01
21)(
zz
zzzH
1121
1
25.01
25
5.01
188
125.075.01
878)(
zzzz
zzH
Parallel-form structure using second-order system (form I)
Parallel-form structure using first-order system
12
• Given a set specifications or stated constraints on– magnitude spectrum– phase spectrum
• Find where,
• The constraints may include– zero, small, or linear phase– specific bandlimit within a passband– amount of ripple within a passband– amount of ripple within a stopband– sharpness of transitions between passband/stopband– filter order K, M.
6.3.1 Digital Filter Design
)( jeH}{ and }{ km ba
K
k
kk
M
m
mm
zb
zazH
1
0
1)(
)( jeH
13
• Here it is assumed that• Hence
And so the unit pulse response of the filter is clearly:
• Problem: Given specifications on and ,
find• FIR filters are often called non-recursive for obvious reasons.
0321 Kbbbb
6.3.2 Finite Impulse Response (FIR) Filter Design
M
m
mmzazH
0
)(
else;0
0;)(
Mnanh n
)( jeH )( jeH},...,1;{ Mnan
14
6.3.3 FIR Filter: Advantages and Disadvantages
• Advantages:– Always stable (assume non-recursive implementation).
– Quantization noise is not much of a problem.
– Can be designed to have exact linear phase even when causal,
while meeting a prescribed phase to arbitrary accuracy.
– Design complexity generally linear.
– Transients have a finite duration.
• Disadvantages:– A high-order filter is generally needed to satisfy the stated
specification – so more coefficients are needed with more
storage and computation.
15
• Definition: The digital filter
is linear phase if
for some real number C. If C=0, then the filter has zero- phase, which is only possible when the filter is non-causal.
• Achieving linear phase is quite important in applications where is desirable not to distort the signal phase much –i.e., where the frequency locations are critical, such as speech signals.
• Many applications benefit be the linear phase thought as– shaping frequencies according to the magnitude spectrum.
– Time-shifting the response by an amount -C
6.3.4 FIR Filter Design: Linear Phase Condition
)()( jCj eXeCnx
)()()( jeHjjj eeHeH
],[for )( CeH j
16
• Theorem: a causal FIR filter with unit pulse response
is linear phase if h(n) is even symmetric:
Proof: Suppose M is odd. Then
which finishes the proof, why?
• Consider case of M even to be an exercise.
6.3.5 Linear Phase Condition
2/)1(
0
)( ])[(M
n
nNn zznh
Mnnh ,...,0;0)(
2/)1(
0
)(2/)1(
02/)1(
2/)1(
0
)()()()()(M
n
nMM
n
nM
Mn
nM
n
n znMhznhznhznhzH
2/)1(
0
2/ )]2/(cos[)(2)(M
n
Mjjez MnnheeHj
17
6.4.1 FIR Filter Design: Windowing• Goal: Design an FIR digital filter with M+1
coefficients that approximates a desired frequency response
with
• Usually d(n) cannot be realized for some reasons.– d(n) has infinite duration if contains discontinuities;
– If d(n) is non-causal and we want it causal;
– If d(n) is longer than can be computed efficiently;
– It’s generally desirable to have few coefficients;
• Windowing is the simplest approach to FIR filter design. One can proceed naively, and thus obtain poor results. But with little care (basic windowing strategies), windowing can be very effective.
)()()( jeDjjj eeDeD
deeDnd njj )(
2
1)(
)()( jeHnh
)( jeD
18
6.4.2 General Windowing Approach
• Define
where
• Then designed filter then has frequency response
• Observations: We desire conflicting goals
– be time-limited to
– be spectrally localized – impulse-like, if
)()( then)2(2)( jj
n
j eDeHneW
)()()( ndnwnh
},...,1,0{for 0)( Mnnw
njM
n
j endnweH
0
)()()(
).()( where][)(2
1 )(
jvjjv eWnwdveWeD
)( jeW
)(nw },...,1,0{ Mn
19
6.4.3 Truncation Windowing
• Rectangular window:
• The designed filter has frequency response
where
– Is the frequency response a good approximation to the desired frequency response ?
– Actually, for M give is optimal in the mean square sense (MSE).
– However, while rectangular windowing does the best global MSE job, it suffers dramatically at frequencies.
)(*)()()()(0
jjM
n
jjrec eWeDenwndeH
else
Mnnw
;0
0;1)(
2/
2/
]2/)1(sin[)( Mjj e
MeW
)( jrec eH
)( jeD
)( jrec eH
20
21
6.4.4 Triangle (Bartlett) Windowing
• Suppose that
which
• Note that (ignoring the shift) is a positive function, hence
must rise monotonically at a jump discontinuity (why?).
• In the prior example, using the triangular window gives an approximation with smooth, but wider transition.
2/
2
2 )4/(sin
4/)1(sin[)( Mjj e
Mew
else
MnM
Mn
Mn
Mn
nw 2/
2/0
;0
;/22
;/2
)(
)( jeW
)(*)()( jjjtri eWeDeH
22
6.4.5 Windowing: Trade-off
Ripples vs. Transition Width
• Rectangular window has a sharp transition but severe ripple.
• Triangular window has no ripple but a very wide transition.
23
6.4.6 Other Windows
• Other windows attempt to optimize this trade-off. Widely used windows that give intermediate results are:
– Hamming Window:
– Hanning Window:
– Blackman Window:
else
MnMnnw
;0
0);/2cos(46.054.0)(
else
MnMnnw
;0
0);/2cos(5.05.0)(
else
MnMnMnnw
;0
0);/4cos(08.0)/2cos(5.042.0)(
24
6.4.7 Windowing Comparisons
Rectangular: transition width is optimized.Blackman: Ripple is minimized.
25
6.4.8 Kaiser Window Design
• Here
Where and represents the zeroth-order modified Bessel function of the first kind, and there are two important parameters: M, .
– For M held constant, increasing reduces sidelobe but increase mainlobe width.
– For held constant, increasing M reduces mainlobe width but does not affect sidelobes much.
• Kaiser developed an empirical but careful design procedure for windowing a filter having sharp discontinuity (e.g. an ideal LPF).
otherwise
MnI
nInw
0
0,)(
}]/)[(1{)(
0
20
,2/M )(0 I
26