You are on page 1of 128

Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Window Filter Design

DSP and Digital Filters (2013-2694)

Windows: 6 1 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n]

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n] Example: Ideal Lowpass lter

H (ej ) =

1 | | 0 0 | | > 0
1

0.5

20

-2

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n] Example: Ideal Lowpass lter

H (ej ) =

1 | | 0 0 | | > 0
1

h [n ] =

sin 0 n n
2/0

0.5

20

-2

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n] Example: Ideal Lowpass lter

H (ej ) =

1 | | 0 0 | | > 0
1

h [n ] =

sin 0 n n
2/0

0.5

20

-2

Note: Width in is 20 , width in n is 2


0

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n] Example: Ideal Lowpass lter

H (ej ) =

1 | | 0 0 | | > 0
1

h [n ] =

sin 0 n n
2/0

0.5

20

-2

Note: Width in is 20 , width in n is 2 : product is 4 always


0

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n] Example: Ideal Lowpass lter

H (ej ) =

1 | | 0 0 | | > 0
1

h [n ] =

sin 0 n n
2/0

0.5

20

-2

Note: Width in is 20 , width in n is 2 0 : product is 4 always Sadly h[n] is innite and non-causal.

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Inverse DTFT
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

For any BIBO stable lter, H (ej ) is the DTFT of h[n]

H (ej ) =

h[n]ejn

h [n ] =

1 2

H (ej )ejn d

If we know H (ej ) exactly, the IDTFT gives the ideal h[n] Example: Ideal Lowpass lter

H (ej ) =

1 | | 0 0 | | > 0
1

h [n ] =

sin 0 n n
2/0

0.5

20

-2

Note: Width in is 20 , width in n is 2 0 : product is 4 always Sadly h[n] is innite and non-causal. Solution: multiply h[n] by a window

DSP and Digital Filters (2013-2694)

Windows: 6 2 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite

2/0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1

h1[n] M=14

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E=

1 2

H (ej ) H1 (ej ) d

h1[n] M=14

1 M=14 0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E= =

1 2 1 2

H (ej ) H1 (ej ) d H (e )
j
M 2 M 2

h 1 [n ]e

jn

h1[n] M=14

1 M=14 0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E= =

1 2 1 2

H (ej ) H1 (ej ) d H (e )
j
M 2 M 2

h 1 [n ]e

jn

Minimum E is when h1 [n] =

(h[n])

h1[n] M=14

1 M=14 0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E= =

1 2 1 2

H (ej ) H1 (ej ) d H (e )
j
M 2 M 2

h 1 [n ]e

jn

Minimum E is when h1 [n] = (h[n]) Proof: Differentiate w.r.t. h[r ] and set to zero
h1[n] M=14 0.5

1 M=14

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E= =

1 2 1 2

H (ej ) H1 (ej ) d H (e )
j
M 2 M 2

h 1 [n ]e

jn

Minimum E is when h1 [n] = (h[n]) Proof: Differentiate w.r.t. h[r ] and set to zero However: 9% overshoot at a discontinuity even for large n.
h1[n] M=14 0.5 1 M=14

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E= =

1 2 1 2

H (ej ) H1 (ej ) d H (e )
j
M 2 M 2

h 1 [n ]e

jn

Minimum E is when h1 [n] = (h[n]) Proof: Differentiate w.r.t. h[r ] and set to zero However: 9% overshoot at a discontinuity even for large n.
h2[n] M=14 0.5 1 M=14 M=28

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 3 / 14

Rectangular window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncate to M 2 to make nite; h1 [n] is now of length M + 1 MSE Optimality: Dene mean square error (MSE) in frequency domain

E= =

1 2 1 2

H (ej ) H1 (ej ) d H (e )
j
M 2 M 2

h 1 [n ]e

jn

Minimum E is when h1 [n] = (h[n]) Proof: Differentiate w.r.t. h[r ] and set to zero However: 9% overshoot at a discontinuity even for large n.
h2[n] M=14 0.5 1 M=14 M=28

0 0

j j M 2 . to make causal. Multiplies H ( e ) by e Normal to delay by M 2


DSP and Digital Filters (2013-2694) Windows: 6 3 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )

Proof: (i) ej (n) + ej (+n) = 2 cos (n )

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n )

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1

0.5

0 -2 0 2

M=14

0.5

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1

0.5

0.5

0 -2 0 2

0 -2 0 2

M=14

0.5

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1 1

0.5

0.5

0.5

0 -2 0 2

0 -2 0 2

0 -2 0 2

M=14

0.5

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1 1

0.5

0.5

0.5

0 -2 0 2

0 -2 0 2

0 -2 0 2

M=14

4 2 Provided that M < 2 M + 1 > 0 +1 0 :

0.5

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1 1

0.5

0.5

0.5

0 -2 0 2

0 -2 0 2

0 -2 0 2

M=14

0.5

4 2 Provided that M < 2 M + 1 > 0 +1 0 : 4 Passband ripple: M +1

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1 1

0.5

0.5

0.5

0 -2 0 2

0 -2 0 2

0 -2 0 2

M=14

0.5

4 2 Provided that M < 2 M + 1 > 0 +1 0 : 2 4 Passband ripple: M +1 , stopband M +1

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1 1

0.5

0.5

0.5

0 -2 0 2

0 -2 0 2

0 -2 0 2

M=14

0.5

4 2 Provided that M < 2 M + 1 > 0 +1 0 : 2 4 Passband ripple: M +1 , stopband M +1 4 Transition pk-to-pk: M +1

0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Dirichlet Kernel
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Truncation Multiply h[n] by a rectangular window, w[n] = M n M 2 2 1 j j j Circular Convolution H1 (e ) = 2 H (e ) W (e )

W (e ) =

M 2 M 2

ejn = 1 + 2

(i)

0.5M 1

cos (n )=

(ii) sin 0.5(M +1)

sin 0.5

Proof: (i) ej (n) + ej (+n) = 2 cos (n ) (ii) Sum geom. progression Effect: convolve ideal freq response with Dirichlet kernel (aliassed sinc)
1 1 1

0.5

0.5

0.5

0 -2 0 2

0 -2 0 2

0 -2 0 2

M=14

0.5

4 2 Provided that M < 2 M + 1 > 0 +1 0 : 2 4 Passband ripple: M +1 , stopband M +1 4 Transition pk-to-pk: M +1 d|H | d M +1 2

0 -2 0 2

Transition Gradient:

= 0

DSP and Digital Filters (2013-2694)

Windows: 6 4 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =

1 j 2 H (e )

W (ej )

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )

W (ej )

0.5

-2

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )

0.5

10

0 0 -2 0 2 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

(a) passband gain w[0]; peak

w[0] 2

1 4

j W ( e )d mainlobe

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

j W ( e )d (a) passband gain w[0]; peak 2 + 41 mainlobe rectangular window: passband gain = 1; peak gain = 1.09

w[0]

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

j W ( e )d (a) passband gain w[0]; peak 2 + 41 mainlobe rectangular window: passband gain = 1; peak gain = 1.09

w[0]

(b) stopband gain is an integral over oscillating sidelobes

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

j W ( e )d (a) passband gain w[0]; peak 2 + 41 mainlobe rectangular window: passband gain = 1; peak gain = 1.09

w[0]

(b) stopband gain is an integral over oscillating sidelobes hence lower ripple than the sidelobes due to cancellation

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

j W ( e )d (a) passband gain w[0]; peak 2 + 41 mainlobe rectangular window: passband gain = 1; peak gain = 1.09

w[0]

(b) stopband gain is an integral over oscillating sidelobes hence lower ripple than the sidelobes due to cancellation (c) transition bandwidth, = width of the main lobe transition amplitude, H = integral of main lobe2

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

j W ( e )d (a) passband gain w[0]; peak 2 + 41 mainlobe rectangular window: passband gain = 1; peak gain = 1.09

w[0]

(b) stopband gain is an integral over oscillating sidelobes hence lower ripple than the sidelobes due to cancellation (c) transition bandwidth, = width of the main lobe transition amplitude, H = integral of main lobe2 4 rectangular window: = M +1 , H 1.18

DSP and Digital Filters (2013-2694)

Windows: 6 5 / 14

Window relationships
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

When you multiply an impulse response by a window M + 1 long

H1 (ej ) =
1

1 j 2 H (e )
20 M=20

W (ej )
1

0.5

10

0.5

0 0 0 -2 0 2 -2 0 2 -2 0 2

j W ( e )d (a) passband gain w[0]; peak 2 + 41 mainlobe rectangular window: passband gain = 1; peak gain = 1.09

w[0]

(b) stopband gain is an integral over oscillating sidelobes hence lower ripple than the sidelobes due to cancellation (c) transition bandwidth, = width of the main lobe transition amplitude, H = integral of main lobe2 4 rectangular window: = M +1 , H 1.18 (d) features narrower than the main lobe will be broadened and attenuated
DSP and Digital Filters (2013-2694) Windows: 6 5 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
0

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
0

Smoothly tapers to zero at ends

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples

2 0 -2 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1

-2

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2 8 M=16 6 4 2 0 -2 -2 0 2

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2 8 M=16 6 4 2 0 -2 -2 0 2

Add components to get W (ej )

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2 8 M=16 6 4 2 0 -2 -2 0 2

Add components to get W (ej )

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2 8 M=16 6 4 2 0 -2 -2 0 2

Add components to get W (ej ) Anti-phase sidelobes cancel

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
8 M=16 6 4
0

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2 8 M=16 6 4 2 0 -2 -2 0 2

Add components to get W (ej ) Anti-phase sidelobes cancel Central lobe width doubled

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Hanning Window
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Hanning (von Hann) window:


2n w[n] = 0.5 + 0.5 cos M +1
0

Some use M or M + 2 in denominator [bad]

8 M=16 6 4

Smoothly tapers to zero at ends DTFT has much reduced ripples Central lobe width doubled: =

2 0 -2

8 M +1
0.6 0.4 0.2

-2

2n Regard w[n] as innite signal, 0.5 + 0.5 cos M +1 , multiplied by a rectangular window

W (e ) is spectrum of signal

Dirichlet kernel
0 -2 0 2 8 M=16 6 4 2 0 -2 -2 0 2

Add components to get W (ej ) Anti-phase sidelobes cancel Central lobe width doubled

DSP and Digital Filters (2013-2694)

Windows: 6 6 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1

6.27/(M+1)

-13 dB

-50 0 1 2 3

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use

6.27/(M+1)

-13 dB

-50 0 1 2 3

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 1 2 3

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 1 2 3

rapid sidelobe decay

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 0 1 2 3

rapid sidelobe decay Hamming: 0.54 + 0.46c1

12.56/(M+1) -40 dB

-50 0 1 2 3

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 0 1 2 3

rapid sidelobe decay Hamming: 0.54 + 0.46c1 best peak sidelobe

12.56/(M+1) -40 dB

-50 0 1 2 3

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 0 1 2 3

rapid sidelobe decay Hamming: 0.54 + 0.46c1 best peak sidelobe Blackman-Harris 3-term:

12.56/(M+1) -40 dB

-50 0 0 1 2 3

18.87/(M+1)

0.42 + 0.5c1 + 0.08c2

-50 0 1 2

-70 dB

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 0 1 2 3

rapid sidelobe decay Hamming: 0.54 + 0.46c1 best peak sidelobe Blackman-Harris 3-term:

12.56/(M+1) -40 dB

-50 0 0 1 2 3

18.87/(M+1)

0.42 + 0.5c1 + 0.08c2


best peak sidelobe

-50 0 1 2

-70 dB

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 0 1 2 3

rapid sidelobe decay Hamming: 0.54 + 0.46c1 best peak sidelobe Blackman-Harris 3-term:

12.56/(M+1) -40 dB

-50 0 0 1 2 3

18.87/(M+1)

0.42 + 0.5c1 + 0.08c2


best peak sidelobe
I0 1( I0 ( )
2n M

-50 0 0
= 5.3

-70 dB 1

13.25/(M+1) -40 dB

Kaiser:

-50

0 0
= 9.5

controls width v sidelobes

21.27/(M+1)

-50

-70 dB 1

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Common Windows
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Rectangular: w[n] 1 dont use Hanning: 0.5 + 0.5c1

6.27/(M+1)

-13 dB

-50 0 0 1 2 3

ck = cos

2kn M +1

12.56/(M+1) -31 dB

-50 0 0 1 2 3

rapid sidelobe decay Hamming: 0.54 + 0.46c1 best peak sidelobe Blackman-Harris 3-term:

12.56/(M+1) -40 dB

-50 0 0 1 2 3

18.87/(M+1)

0.42 + 0.5c1 + 0.08c2


best peak sidelobe
I0 1( I0 ( )
2n M

-50 0 0
= 5.3

-70 dB 1

13.25/(M+1) -40 dB

Kaiser:

-50

0 0
= 9.5

controls width v sidelobes


Good compromise: Width v sidelobe v decay

21.27/(M+1)

-50

-70 dB 1

DSP and Digital Filters (2013-2694)

Windows: 6 7 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0.

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution
2

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ).
2

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency.
2

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe.
2

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: Assume
2

|x(t)|2 dt = 1

|X ( )|2 d = 2 [Parseval]

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 Set y (t) = dx dt Y ( ) = jX ( ) [by parts]
2

[Parseval]

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 [Parseval] Set y (t) = dx dt Y ( ) = jX ( ) [by parts] 1 2 1 1 2 Now tx dx dt = tx x dt = dt 2 2 2 [by parts] t=
2

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 [Parseval] Set y (t) = dx dt Y ( ) = jX ( ) [by parts] 1 2 1 1 2 Now tx dx dt = tx x dt = dt 2 2 2 [by parts] t=
1 = So 4 2

tx dx dt dt

t2 x2 dt

dx 2 dt

dt

[Schwartz]

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 [Parseval] Set y (t) = dx dt Y ( ) = jX ( ) [by parts] 1 2 1 1 2 Now tx dx dt = tx x dt = dt 2 2 2 [by parts] t=
1 = So 4 2

tx dx dt dt t2 x2 dt

t2 x2 dt

dx 2 dt

dt

[Schwartz]

|y | dt

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 [Parseval] Set y (t) = dx dt Y ( ) = jX ( ) [by parts] 1 2 1 1 2 Now tx dx dt = tx x dt = dt 2 2 2 [by parts] t=
1 = So 4 2

tx dx dt dt t2 x2 dt

t2 x2 dt

dx 2 dt

dt
1 2

[Schwartz]

|y | dt =

t2 x2 dt

|Y | d

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 [Parseval] Set y (t) = dx dt Y ( ) = jX ( ) [by parts] 1 2 1 1 2 Now tx dx dt = tx x dt = dt 2 2 2 [by parts] t=
1 = So 4 2

tx dx dt dt t2 x2 dt t2 x2 dt

t2 x2 dt

dx 2 dt

dt
1 2

[Schwartz]

= =

|y | dt =
1 2

t2 x2 dt

|Y | d

2 |X |2 d

DSP and Digital Filters (2013-2694)

Windows: 6 8 / 14

Uncertainty principle
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

CTFT:

t2 |x(t)|2 dt |x(t)|2 dt

1 2

2 |X ( )|2 d |X ( )|2 d

1 2

1 2

First term measures the width of x(t) around t = 0. like if |x(t)| was a zero-mean probability distribution Second term is similarly the width of X ( ). A signal cannot be concentrated in both time and frequency. So a short window cannot have a narrow main lobe. Proof: 2 2 Assume |x(t)| dt = 1 |X ( )| d = 2 [Parseval] Set y (t) = dx dt Y ( ) = jX ( ) [by parts] 1 2 1 1 2 Now tx dx dt = tx x dt = dt 2 2 2 [by parts] t=
1 = So 4 2

tx dx dt dt t2 x2 dt t2 x2 dt

t2 x2 dt

dx 2 dt

dt
1 2

[Schwartz]

= =

|y | dt =
1 2

t2 x2 dt

|Y | d

2 |X |2 d

No exact equivalent for DTFT/DFT but a similar effect is true


DSP and Digital Filters (2013-2694) Windows: 6 8 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M .

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,.

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,. 2f2 1 1 = 2f = 0 . 943 , = = 1.047 2 f f
s s

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,. 2f2 1 1 = 2f = 0 . 943 , = = 1.047 2 f f
s s

Ripple: = 0.1 dB,

= 35 dB

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,. 2f2 1 1 = 2f = 0 . 943 , = = 1.047 2 f f
s s

Ripple: = 0.1 dB,

= 10

0.1 20

= 35 dB 35 1 = 0.0116, = 10 20 = 0.0178

DSP and Digital Filters (2013-2694)

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,. 2f2 1 1 = 2f = 0 . 943 , = = 1.047 2 f f
s s

Ripple: = 0.1 dB,

= 10 M
DSP and Digital Filters (2013-2694)

0.1 20

= 35 dB 35 1 = 0.0116, = 10 20 = 0.0178 =
10.25 0.105

5.64.3 log10 (2104 ) 1.0470.943

= 98
Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller.

Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,. 2f2 1 1 = 2f = 0 . 943 , = = 1.047 2 f f
s s

Ripple: = 0.1 dB,

= 10 M
DSP and Digital Filters (2013-2694)

0.1 20

= 35 dB 35 1 = 0.0116, = 10 20 = 0.0178 =
10.25 0.105

5.64.3 log10 (2104 ) 1.0470.943

= 98

358 or 2 .2 = 117

Windows: 6 9 / 14

Order Estimation
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Several formulae estimate the required order of a lter, M . E.g. for lowpass lter Estimated order is

5.64.3 log10 ( ) 2 1

1/ (in dB)-8 2.2

Required M increases as either the transition width, 2 1 , or the gain tolerances and get smaller. Only approximate. Example: Transition band: f1 = 1.8 kHz, f2 = 2.0 kHz, fs = 12 kHz,. 2f2 1 1 = 2f = 0 . 943 , = = 1.047 2 f f
s s

Ripple: = 0.1 dB,

= 10 M
DSP and Digital Filters (2013-2694)

0.1 20

= 35 dB 35 1 = 0.0116, = 10 20 = 0.0178 =
10.25 0.105

5.64.3 log10 (2104 ) 1.0470.943

= 98

358 or 2 .2 = 117

Windows: 6 9 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1

0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1

0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02

0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB

0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB

0.5

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0

5.64.3 log10 ( ) 2 1

= 92

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0

5.64.3 log10 ( ) 2 1

= 92

Ideal Impulse Response: Difference of two lowpass lters

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0

5.64.3 log10 ( ) 2 1

= 92

Ideal Impulse Response: Difference of two lowpass lters

h [n ] =

sin 2 n n

sin 1 n n

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0

5.64.3 log10 ( ) 2 1

= 92

Ideal Impulse Response: Difference of two lowpass lters

h [n ] =

sin 2 n n

sin 1 n n

Kaiser Window: = 2.5

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0

5.64.3 log10 ( ) 2 1

= 92

Ideal Impulse Response: Difference of two lowpass lters

h [n ] =

sin 2 n n

sin 1 n n

Kaiser Window: = 2.5


M=92 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0 1

5.64.3 log10 ( ) 2 1

M=92 = 2.5

= 92

0.5

Ideal Impulse Response: Difference of two lowpass lters

h [n ] =

sin 2 n n

sin 1 n n

0 0

Kaiser Window: = 2.5


M=92 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Example Design
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Specications: Bandpass: 1 = 0.5, 2 = 1 Transition bandwidth: = 0.1 Ripple: = = 0.02 20 log10 = 34 dB 20 log10 (1 + ) = 0.17 dB Order:

0.5

0 0 1

5.64.3 log10 ( ) 2 1

M=92 = 2.5

= 92

0.5

Ideal Impulse Response: Difference of two lowpass lters

h [n ] =

sin 2 n n

sin 1 n n

0 0 0 -20

Kaiser Window: = 2.5


M=92

M=92 = 2.5

-40
0

-60 0

DSP and Digital Filters (2013-2694)

Windows: 6 10 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej )

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej )

M+1=93

0.5

-2

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n]

M+1=93

0.5

-2

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n]

M+1=93

M+1=93

0.5

0.5

-2

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n] Advantage: exact match at sample points

M+1=93

M+1=93

0.5

0.5

-2

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n] Advantage: exact match at sample points Disadvantage: poor intermediate approximation if spectrum is varying rapidly

M+1=93

M+1=93

0.5

0.5

-2

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n] Advantage: exact match at sample points Disadvantage: poor intermediate approximation if spectrum is varying rapidly Solutions: (1) make the lter transitions smooth over width

M+1=93

M+1=93

0.5

0.5

-2

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n] Advantage: exact match at sample points Disadvantage: poor intermediate approximation if spectrum is varying rapidly Solutions: (1) make the lter transitions smooth over width (2) oversample and do least squares t (cant use IDFT)

M+1=93

M+1=93

0.5

0.5

-2

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Frequency sampling
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Take M + 1 uniform samples of H (ej ); take IDFT to obtain h[n] Advantage: exact match at sample points Disadvantage: poor intermediate approximation if spectrum is varying rapidly Solutions: (1) make the lter transitions smooth over width (2) oversample and do least squares t (cant use IDFT) (3) use non-uniform points with more near transition (cant use IDFT)
1 M+1=93 1

M+1=93

0.5

0.5

-2

0 0

DSP and Digital Filters (2013-2694)

Windows: 6 11 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

M can be even ( mid point) or odd (

mid point)

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

M can be even ( mid point) or odd (


Proof :

mid point)

2H (ej ) =

M 0

h[n]ejn +

M 0

h[M n]ej(M n)

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

M can be even ( mid point) or odd (


Proof :

mid point)

2H (ej ) = =

M M jn h [ n ] e + 0 0 h [M M j (n M j M 2 ) 2 e 0 h [n ]e

n]ej(M n) + h [M n ]e
j (n M 2 )

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

M can be even ( mid point) or odd (


Proof :

mid point)

2H (ej ) = =

M M jn h [ n ] e + 0 0 h [M M j (n M j M 2 ) 2 e 0 h [n ]e M 0

n]ej(M n) + h [M n ]e
M 2 j (n M 2 )

h[n] symmetric: M 2H (ej ) = 2ej 2

h[n] cos n

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

M can be even ( mid point) or odd (


Proof :

mid point)

2H (ej ) = =

M M jn h [ n ] e + 0 0 h [M M j (n M j M 2 ) 2 e 0 h [n ]e M 0

n]ej(M n) + h [M n ]e
M 2 j (n M 2 )

h[n] symmetric: M 2H (ej ) = 2ej 2 h[n] anti-symmetric: M 2H (ej ) = 2jej 2

h[n] cos n
M 0

M 2

h[n] sin n

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Linear Phase Filters


6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

All FIR lters discussed have had linear phase: H (ej ) = 0 M 2 Equivalently constant group delay: H =
dH (ej ) d

M 2

A lter has linear phase iff h[n] is symmetric or antisymmetric: h[n] = h[M n]n or else h[n] = h[M n]n

M can be even ( mid point) or odd (


Proof :

mid point)

2H (ej ) = =

M M jn h [ n ] e + 0 0 h [M M j (n M j M 2 ) 2 e 0 h [n ]e M 0

n]ej(M n) + h [M n ]e
M 2 j (n M 2 )

h[n] symmetric: M 2H (ej ) = 2ej 2

h[n] cos n

h[n] anti-symmetric: M 2H (ej ) = 2jej 2 j ( + M 2 2 ) = 2e

M M 0 h[n] sin n 2 M M 0 h[n] sin n 2

DSP and Digital Filters (2013-2694)

Windows: 6 12 / 14

Summary
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

Make an FIR lter by windowing the IDTFT of ideal response 0 n Ideal lowpass has h[n] = sin n
Add/subtract lowpass lters to make any piecewise constant response

Ideal response is

with window DTFT Rectangular window (Dirichlet kernel) has 13 dB sidelobes and is always a bad idea Hamming, Blackman-Harris are good; Kaiser good with

Uncertainty principle: cannot be concentrated in both time and frequency Frequency sampling: IDFT of uniform frequency samples: not so great Linear phase = Constant group Delay = symmetric/antisymmetric h[n] For further details see Mitra: 7, 10.

DSP and Digital Filters (2013-2694)

Windows: 6 13 / 14

MATLAB routines
6: Window Filter Design

Inverse DTFT Rectangular window Dirichlet Kernel Window relationships Hanning Window Common Windows Uncertainty principle Order Estimation Example Design Frequency sampling Linear Phase Filters Summary MATLAB routines

diric(x,n) hanning hamming kaiser kaiserord

0.5nx Dirichlet kernel: sin sin 0.5x Window functions (Note periodic option)

Estimate required lter order and

DSP and Digital Filters (2013-2694)

Windows: 6 14 / 14

You might also like