Prof. Dr.-Ing. G. Schuller, [email protected] Page 1
Filter Banks II
Prof. Dr. Gerald Schuller
Fraunhofer IDMT & Ilmenau Technical UniversityIlmenau, Germany
Prof. Dr.-Ing. G. Schuller, [email protected] Page 2
Modulated Filter Banks – Extending the DCT
The DCT IV transform can be seen as modulated filter
bank with window h(n):
with a simple window function (independent of k!) defined as
1
0
1 1( ) ( ) cos2 2
1 1( ) ( ) ( ) cos2 2
N
kn
kn
y m x mN n k nN
y m x mN n h n k nN
π
π
−
=
∞
=−∞
= + ⋅ + + = + ⋅ ⋅ + +
∑
∑
−=
=else
Nnnh
01...01
)(
Prof. Dr.-Ing. G. Schuller, [email protected] Page 3
Modulated Filter Banks
In general:
window function (not nec. limited in length)modulation function, for instance the cosine function
( ) ( ) ( ) ( )k kn
y m x mN n h n n∞
=−∞
= + ⋅ ⋅Φ∑
)(nh)(nkΦ
frequency index
Prof. Dr.-Ing. G. Schuller, [email protected] Page 4
Modulated Filter Banks• The resulting filters of this cosine modulated
filter bank are:
• With the cosine modulation, the resulting frequency responses of the filters of the filter bankare:
++⋅= )5.0)(5.0(cos)()( nk
Nnhnhk
π
1 1 1( ) ( )2 2 2kH H k k
N Nπ πω ω δ ω δ ω
= ∗ − + + + +
Delta functions from cosine termMult in time becomesconvolution in frequency
Prof. Dr.-Ing. G. Schuller, [email protected] Page 5
Modulated Filter Banks
• Hence: Modulated filter banks obtain their filters by shifting a „baseband filter“ h(n) in frequency.
+++
+−=
21
21 k
NHk
NH πωπω
Shift in frequency
Prof. Dr.-Ing. G. Schuller, [email protected] Page 6
The subbands of the filter bank are frequency shifted versions
of window frequency response:
Modulated Filter Banks: Frequency Shifts
⇒
Place passband in frequency, depending on the modulation function
Prof. Dr.-Ing. G. Schuller, [email protected] Page 7
Frequency response of the rectangular windowfunction of the DCT:
Modulated Filter Banks: The Window Function
ideal
stopband
Prof. Dr.-Ing. G. Schuller, [email protected] Page 8
Modulated Filter Banks Improve filter banks:- make window longer- different window shape
Examples (all have the same principle):
- TDAC (time domain aliasing cancellation)(Princen and Bradley 1986&1987)
- LOT (lapped orthogonal transform)(Malvar 1989)
- MDCT (modified DCT)(Bernd Edler 1988)
Prof. Dr.-Ing. G. Schuller, [email protected] Page 9
Analysis Polyphase Matrix• Remember: the analysis polyphase matrix is:
with the analysis polyphase components
=
−− )(
)()()()(
)(
1,1
1,10,1
1,00,0
zH
zHzHzHzH
zH
NN
m
mknk zmNnhzH −
∞
=
+= ∑ )()(0
,
Prof. Dr.-Ing. G. Schuller, [email protected] Page 10
MDCT • The analysis polyphase matrix of the MDCT can be
written with
for n=0,…,2N-1; k=0,…,N-1 as
• observe: this has length 2N, and is more generalthan the rectangular window (not just 1 or 0)
• is composed of 1st order polynomials
−+
+⋅=
221
21cos)()( Nnk
Nnhnhk
π
)(nhk
−+−
++++++
=
−−
−
−−
−−
)12()1(
)1()1()1()1()()0()()0(
)(
11
1
11
101
0
11
101
0
NhzNh
NhzhNhzhNhzhNhzh
zH
NN
)(zH
Still square matrix,still invertible, NxN
Prof. Dr.-Ing. G. Schuller, [email protected] Page 11
MDCT• Fortunately the MDCT Polyphase matrix can be
decomposed into a product of matrices, hence easier to invert to obtain perfect reconstruction:
Tz
z
NhNh
NhNh
NhNh
Nhh
zH ⋅
⋅
−−−
−
−−=
−
−
1
1
0)12()1(0
)5.1(00)2
(
)15.1(00)12
(
0)()0(0
)(1
1
valuedreal ,aF Delay matrix D(z) DCT4-Matrix
matrix inverse
is inverse of each entry!0
0
1 02
0 3
1 02
0 3
1 04
0 9=
1 02
0 3
1 0½
0 1/3
1 01
0 1=
Prof. Dr.-Ing. G. Schuller, [email protected] Page 12
MDCT
• Observe the diamond shaped form of thematrix Fa(z), and the sparse structure
• Beneficial for an efficient implementation
Prof. Dr.-Ing. G. Schuller, [email protected] Page 13
MDCT synthesis• The MDCT synthesis Polyphase matrix can be
similarly decomposed into a product of matrices. Needs to be the inverse and a delay for Perfect Reconstruction (PR).
sF
NgNg
NgNg
Ngg
NgNg
−−
−−
−
−
⋅
0)5.1()15.1(0
)12(00)(
)1(00)0(
0)2
()12
(0
z-1: Delay by one time step (past)z: Looking into the future non-causal not practical
hence mult. with z-1 (delay!) cause of signal delay
11
1
1
1
)(0
1
01
)(
−−
−
−
−
⋅
⋅=
zzDz
zTzG
Prof. Dr.-Ing. G. Schuller, [email protected] Page 14
Graphical Interpretation of Analysis Matrix Fa
aF
time subbands
• „Folding“ the upper and lower quarter of the signal into a length N block (aliasing components)
• Invertible by matrix inversion containing overlap add
--
[ ] [ ] [ ]yDCTz
z
NhNh
NhNhNhh
Nhh
x =⋅
⋅
−−−
−−−
⋅−
−
41
1
10
1
0
0)12()1(0
)12(00)()1(00)0(
0)()0(0
Prof. Dr.-Ing. G. Schuller, [email protected] Page 15
MDCT• DCT matrix T and the delay matrix D(z) are easily
invertible for perfect reconstruction. • System Delay results from making inverse of D(z)
causal (one block), and the blocking delay of N-1.• Fa is also easily invertible, with some simple matrix
algebra:
)1()()12()()()(
nNhnNhnNhnhnhng
−−++−−=
)1()()12()()()(
nNhnNhnNhnhnNhnNg
−−++−−+
=+
with n=0,…,N-1
Prof. Dr.-Ing. G. Schuller, [email protected] Page 16
MDCT Filter Banks (1)• Modified Discrete Cosine Transform
(MDCT): g(n)=h(n) ⇒ Denominator=1• Example which fulfills this condition:
Sine window
))5.0(2
sin()( += nN
nh πfor n=0,…,2N-1
System delay=2N-1=1023 for N=512(from the delay matrices, 1 block of N, and the blocking delay of N-1)
Prof. Dr.-Ing. G. Schuller, [email protected] Page 17
Sine-Window Frequency Response• Modulation of a rectangular window of length 2N
• ∗ ⇒
↑Better attenuationoutside of passband than with simple sinc
↑length 2N
sinusodial funct.
sinewindow
Prof. Dr.-Ing. G. Schuller, [email protected] Page 18
MDCT, Advantages
• Improved frequency responses, higher stopband attenuation
• Easy to design filter banks with many subbands(for instance N=1024 for audio coding)
• Efficient implementation with the shown sparse matrices and a fast DCT. Important for large number of subbands, as in audio coding.
Prof. Dr.-Ing. G. Schuller, [email protected] Page 19
MDCT Filter Banks (2)Examples: filter impulse responses h7(n), h15(n), N=1024 bands, sine window.
Prof. Dr.-Ing. G. Schuller, [email protected] Page 20
MDCT Filter Banks (3)
Magnitude response 7th band Magnitude response 15th band
indeed better filters!
Prof. Dr.-Ing. G. Schuller, [email protected] Page 21
Extending the Length of the MDCT• Longer filters are obtained with higher
order polynomials in the polyphase matrix
• Approach to obtain easily invertible polyphasematrices
• multiply MDCT polyphase matrix with more easily invertible matrices with polynomialsof 1st order
• To control the resulting system delay:design different matrices with differentneeds for delay to make them causal
Prof. Dr.-Ing. G. Schuller, [email protected] Page 22
Extending the Length
• Take the MDCT Polyphase matrix with a general window function h(n) (not nec. Sine window):
• This matrix contains polynomials of first order. Multiply it with another matrix with polynomials of first order (Schuller, 1996, 2000):
)(zHMDCT
)()( zHzLMDCT
⋅
Prof. Dr.-Ing. G. Schuller, [email protected] Page 23
Extending the Length
• This matrix needs to have a form such that again a modulated filter bank results.
• Diamond shaped form needs to be maintained
Prof. Dr.-Ing. G. Schuller, [email protected] Page 24
Extending the Length, Zero-Delay Matrix
• This matrix fulfills the conditions • Zero-Delay Matrix:
= −−
−
01
011
1
)( 12/1
01
Nlz
lz
zL
Prof. Dr.-Ing. G. Schuller, [email protected] Page 25
Extending the Length, Zero-Delay Matrix• Its inverse is causal, hence does not need a
delay to make it causal:
−
−=
−
−−
−
01
12/1
1
1
110
10
)(
lz
lzzL
N
still increases filter length!
Prof. Dr.-Ing. G. Schuller, [email protected] Page 26
Extending the Length, Zero-Delay Matrix• Observe: Since the matrix has a causal inverse,
it can increase the filter length of the resulting filter bank without increasing the system delay!
• Hence adds zeros inside unit circle
• The coefficients and don‘t affect the delay or the PR property, but the frequency response of the resulting filter bank
• Coefficients need to be found by numerical optimization.
)(nh nl
Prof. Dr.-Ing. G. Schuller, [email protected] Page 27
Extending the Length, Maximum-Delay Matrix
• Consider the following matrix• Maximum-Delay Matrix:
• Its inverse and delay for causality is
• Observe: This matrix and its inverse need a delay of 2 blocks to make it causal.
• Hence adds zeros outside the unit circle
)()( 11 −−= zLzzH
)()( 11121 −−−−− =⋅ zLzzzH
Prof. Dr.-Ing. G. Schuller, [email protected] Page 28
Extending the Length, Design Method
• Determine the total number of Zero-Delay Matrices and Maximum-Delay Matrices according to the desired filter length
• Determine the number of Maximum-Delay Matrices according to the desired system Delay
• Determine the coefficients of the matrices with numerical optimization to optimize the frequency response
Prof. Dr.-Ing. G. Schuller, [email protected] Page 29
Example• Comparison for 128 subbands. • Dashed line: Orthogonal filter bank, filter length 256,
system delay 255 samples.• Solid line: Low delay filter bank, length 512, delay 255
Prof. Dr.-Ing. G. Schuller, [email protected] Page 30
Block Switching • Problem: In audio coding, Pre-echoes appear
before transients- reason: blocks too long (too many bands)
Prof. Dr.-Ing. G. Schuller, [email protected] Page 31
Block Switching
• Approach: for fast changing signals use blockswitching to lower number of subbands
less noise spread in time!
Prof. Dr.-Ing. G. Schuller, [email protected] Page 32
Accommodate Overlap-Add for Block Switching
perfect reconstruction
aliasingcancellation
1
badfrequencyresolution
1024 128
Analysis switching
window
Prof. Dr.-Ing. G. Schuller, [email protected] Page 33
Block Switching
• Sequence of windows for switching the number of sub-bands
windowvalueh(n)
both, analysisand synthesis
Prof. Dr.-Ing. G. Schuller, [email protected] Page 34
Wavelets, QMF Filter Banks • Iterate 2-band system• See also: Wavelet Packets (more general)• Problem: Aliasing propagation reduces frequency
selectivity!• Important in image coding, but no big role in Audio-
Coding
),0( nc
… iterate ∞
Low-Pass
High-Pass
Low-Pass
High-Pass
(2, )d n
(2, )c n
(1, )c n
(1, )d n
)(0 nh
)(1 nh
)(0 nh
)(1 nh
Prof. Dr.-Ing. G. Schuller, [email protected] Page 35
How to Obtain a Two Band Filter Bank • Application: QMF filter banks, Wavelets,…• Analysis polyphase for a 2-band filter bank:
• Observe: contains the even coefficients of the low pass filter, and
its odd coefficients.• Accordingly for the high pass filter
=
)()()()(
)(1,10,1
1,00,0
zHzHzHzH
zH
)(0,0 zH
)(0,1 zH
Prof. Dr.-Ing. G. Schuller, [email protected] Page 36
How to Obtain a Two Band Filter Bank• Given the analysis filters, the synthesis filters can be
obtained by inverting the analysis polyphase matrix,
• Observe: If the analysis filters have a finite impulse response (FIR), and the synthesis is desired to also be FIR, the determinant of the polyphase matrix needs to be a constant or a delay!
( )
−
−=−
)()()()(
)(1)(
0,00,1
1,01,11
zHzHzHzH
zHDetzH
Prof. Dr.-Ing. G. Schuller, [email protected] Page 37
How to Obtain a Two Band Filter Bank
= const or a delay
• Observe: This is the output of the lower band of thefilter bank if the input signal is
• Hence the determinant can be formulated as aconvolution
• This input is the high band filter coefficients, withthe sign of the even coefficients flipped and switched places with the odd coefficients.
( ) )()()()()(det 0,11,00,01,1 zHzHzHzHzH −=
[ ])(),()( 1,01,1 zHzHzx −=
Prof. Dr.-Ing. G. Schuller, [email protected] Page 38
How to Obtain a Two Band Filter Bank• Since this represents a critically sampled filter bank,
the result represents every second sample of the convolution of the low band filter with the correspondingly modified high band filter.
• This modified high band filter is a low band filter (every second sample sign flipped).
• The desired output of this downsampled convolution is a single pulse (corresponding to a constant or a delay), hence flat in frequency
• Another interpretation: correlation of the 2 signals, where the even lags that appear after downsamplingare zero, except for the one pulse
Prof. Dr.-Ing. G. Schuller, [email protected] Page 39
QMF (Quadrature Mirror Filter)• This suggests a simple design strategy:
– Design a low pass filter for analysis and synthesis– Obtain the high pass filters by flipping the low
pass filters every second coefficient
– This is an early two band filter bank: QMF, Quadrature Mirror Filter (Croisier, Esteban, Galand, 1976)
– For more than 2 bands: GQMF (Cox, 1986), PQMF
1,...,1,0 )()1()( 01 −=−= Nnnhnh n
)()()()(
11
00
nhngnhng
−==
analysis FBhigh pass:
synth. FB low pass:
Prof. Dr.-Ing. G. Schuller, [email protected] Page 40
QMF (2)• Sign flipping to obtain the high band filter
leads to the polyphase components:
• The resulting determinant is:
• Observe: This cannot be made a constant or delay for finite polynomials of order 1 or greater, hence no PR for finite length filters!
)()()()(
0,11,1
0,01,0
zHzHzHzH
−=
=
( ))()(2
)()()()()(det
0,01,0
0,11,00,01,1
zHzHzHzHzHzHzH
−=
−=
Prof. Dr.-Ing. G. Schuller, [email protected] Page 41
QMF (3)• The QMF accounts for the sign flipping in the
determinant equation.• But not for the trading places of even and odd
coefficients• Hence: No Perfect Reconstruction
(only for simple Haar and IIR filters)• High stopband attenuation needed to keep
reconstruction error small• Numerical optimization, to obtain
( ) ( ) 12
1
2
0 ≈+ ωω jj eHeH
Prof. Dr.-Ing. G. Schuller, [email protected] Page 43
QMF: Example with Impulse Response of Length 96
Low-Pass High-Pass
Prof. Dr.-Ing. G. Schuller, [email protected] Page 44
CQMF (1): Conjugate QMF• To also accommodate for the trading places of odd
and even coefficients, a natural choice is to also reverse the temporal order of the synthesis filter.
• With L: filter length, and
• Introduced e.g. by Smith, Barnwell, 1984
nnLhnh )1)(()( 01 −−−=
)()()()(
11
00
nhngnhng
−==
Prof. Dr.-Ing. G. Schuller, [email protected] Page 45
CQMF (2)
[ ])(),()( 10,0
10,1
2/ −−−= zHzHzzx L
• For the polyphase components this means
• And the input for our determinant calculation is
• This corresponds exactly to the time reversed low band filter!
)()(
)()(1
0,12/
1,1
10,0
2/1,0
−−
−−
=
−=
zHzzH
zHzzHL
L
Prof. Dr.-Ing. G. Schuller, [email protected] Page 46
CQMF• Lets define
• The determinant is now
• Observe: This can be a constant if all even coefficients of A(z) are zero, except for the center coefficient!
( )))()((
)()()()()(det12/
0,11,00,01,1
−− +=
−=
zAzAz
zHzHzHzHzHL
)()()( 0,01
0,1 zHzHzA −=
Prof. Dr.-Ing. G. Schuller, [email protected] Page 47
CQMF (3)• Remember: the determinant was the output of the
low band with this input
• Hence: Every second sample of the convolution ofthe low band filter with its time reversed version.
• This is equal to every second value of theautocorrelation function of the low band filter!
• Determinant a constant or a delay: only one sample of this downsampled autocorrelation function (all even coefficients) can be unequal zero(most even coefficients are zero)
Prof. Dr.-Ing. G. Schuller, [email protected] Page 48
CQMF (4)
• The Determinant is a constant means:
• The zeroth autocorrelation coefficient is a constant(unequal 0), and all other even coefficient must be zero.
• Called Nyquist filter property
• -> Design method
Prof. Dr.-Ing. G. Schuller, [email protected] Page 49
CQMF (5)• In other terms: Define P(z) as the z-transform of this
autocorrelation function, the Power Spectrum:
• Then all nonzero coefficients of P(z) are the zerothcoefficient and the odd coefficients.
• As a result:
This is also called the halfband filter property.Design approach: Design P(z) accordingly, then H(z)
)()(:)( 100
−⋅= zHzHzP
constzPzP =−+ )()(Frequency reversal
The odd coefficients cancel
z-transform ofACF of low passfilter-> power spectrum
Prof. Dr.-Ing. G. Schuller, [email protected] Page 50
Pseudo-QMF (PQMF)• So far we only had 2 subband QMF filter
banks• Only for the 2-band case we get perfect
reconstruction (in the CQMF case)• The PQMF extents the QMF approach to N>2
subbands• But it has only „Near Perfect Reconstruction“,
meaning a reconstruction error by the filter bank
• It is modulated filter band (like the MDCT), using a baseband prototype filter h(n) (a lowpass)
Prof. Dr.-Ing. G. Schuller, [email protected] Page 51
PQMF• Its analysis filters are given by the impulse
responses
• It is an orthogonal filter bank, which meansthat the synthesis filter impulse responses aresimply the time inverses of the analysisimpulse responses,
−+−++⋅=
4)1(
25.0)5.0(cos)( ππ k
kLnk
Nnh
)1()( nLhnf kk −−=
Prof. Dr.-Ing. G. Schuller, [email protected] Page 52
PQMF• Its baseband prototype filters h(n) are now
designed such that aliasing cancels betweenadjacent neighbouring bands,
• beyond the adjacent bands, the attenuationshould go towards infinity,
NeHeH Njj
20for ,1)()(
2)/(2 ππ <Ω<=+ Ω−Ω
NeH j π
>Ω=Ω for,0)(2
Prof. Dr.-Ing. G. Schuller, [email protected] Page 53
PQMF• The PQMF filter bank is used in MPEG1/2
Layer I and II. There it has N=32 subbandsand filter length L=512
• Also used in MPEG 4 for so-called SBR (Spectral Band Replication) and forparametric sourround coding. There it hasN=32 or N=64 subbands, and filter lengthL=320 or L=640
Prof. Dr.-Ing. G. Schuller, [email protected] Page 54
PQMF used in MPEG4• Impulse response of the baseband prototype
(the window), with N=64 and L=640
Prof. Dr.-Ing. G. Schuller, [email protected] Page 55
PQMF used in MPEG4• Frequency response of the baseband
prototype (the window),