pds_modulo5

Download PDS_Modulo5

If you can't read please download the document

Upload: ariel-mendoza

Post on 09-Dec-2015

215 views

Category:

Documents


0 download

DESCRIPTION

PDS_Modulo5

TRANSCRIPT

  • Digital Signal Processing

    Module 5: Linear FiltersDigital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Module Overview:

    Module 5.15.3: LTI systems and convolution; examples; stability

    Module 5.4: Convolution theorem

    Module 5.55.6: Ideal filters and their approximation

    Module 5.75.8: Realizable filters; implementation

    Module 5.95.10: Filter design

    5 1

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Digital Signal Processing

    Module 5.1: Linear FiltersDigital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Linearity and time invariance

    Convolution

    5.1 2

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Linearity and time invariance

    Convolution

    5.1 2

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A generic signal processing device

    x [n] H y [n]

    y [n] = H{x [n]}

    5.1 3

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linearity

    H{ x1[n] + x2[n]} = H{x1[n]}+ H{x2[n]}

    5.1 4

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linearity

    5.1 5

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • (Non) Linearity

    5.1 6

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Time invariance

    y [n] = H{x [n]} H{x [n n0]} = y [n n0]

    5.1 7

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Time invariance

    5.1 8

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Time (in)variance

    5.1 9

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear, time-invariant systems

    x [n] H y [n]

    additionscalarmultiplication

    delays

    5.1 10

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear, time-invariant systems

    y [n] = H(x [n], x [n 1], x [n 2], . . . , y [n 1], y [n 2], . . .)

    with H() a linear function of its arguments

    5.1 11

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Impulse response

    h[n] = H{[n]}

    Fundamental result: impulse response fully characterizes the LTI system!

    5.1 12

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    h[n]

    b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    3 0 3 6 9 12 150

    1

    h[n] = n u[n]

    x [n]

    b b

    b

    b

    b

    b b b

    2 1 0 1 2 3 4 50

    1

    2

    3

    4

    x [n] =

    2 n = 0

    3 n = 1

    1 n = 2

    0 otherwise

    5.1 13

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    x [n] = 2[n] + 3[n 1] + [n 2]

    we know the impulse response h[n] = H{[n]};

    compute y [n] = H{x [n]} exploiting linearity and time-invariance

    5.1 14

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    x [n] = 2[n] + 3[n 1] + [n 2]

    we know the impulse response h[n] = H{[n]};

    compute y [n] = H{x [n]} exploiting linearity and time-invariance

    5.1 14

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    x [n] = 2[n] + 3[n 1] + [n 2]

    we know the impulse response h[n] = H{[n]};

    compute y [n] = H{x [n]} exploiting linearity and time-invariance

    5.1 14

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    y [n] = H{2[n] + 3[n 1] + [n 2]}

    = 2H{[n]} + 3H{[n 1]}+H{[n 2]}

    = 2h[n] + 3h[n 1] + h[n 2]

    5.1 15

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    y [n] = H{2[n] + 3[n 1] + [n 2]}

    = 2H{[n]} + 3H{[n 1]}+H{[n 2]}

    = 2h[n] + 3h[n 1] + h[n 2]

    5.1 15

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    y [n] = H{2[n] + 3[n 1] + [n 2]}

    = 2H{[n]} + 3H{[n 1]}+H{[n 2]}

    = 2h[n] + 3h[n 1] + h[n 2]

    5.1 15

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b

    2h[n]

    5 0 5 10 15 20 250

    1

    2

    3

    4

    5

    5.1 16

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b

    b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b

    3h[n 1]

    5 0 5 10 15 20 250

    1

    2

    3

    4

    5

    5.1 16

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b

    b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b

    b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b

    h[n 2]

    5 0 5 10 15 20 250

    1

    2

    3

    4

    5

    5.1 16

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    y [n]

    5 0 5 10 15 20 250

    1

    2

    3

    4

    5

    5.1 16

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution

    We can always write (remember Module 3.2):

    x [n] =

    k=

    x [k][n k]

    by linearity and time invariance:

    y [n] =

    k=

    x [k]h[n k]

    = x [n] h[n]

    5.1 17

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution

    We can always write (remember Module 3.2):

    x [n] =

    k=

    x [k][n k]

    by linearity and time invariance:

    y [n] =

    k=

    x [k]h[n k]

    = x [n] h[n]

    5.1 17

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Performing the convolution algorithmically

    x [n] h[n] =

    k=

    x [k]h[n k]

    Ingredients:

    a sequence x [m]

    a second sequence h[m]

    The recipe:

    time-reverse h[m]

    at each step n (from to ):

    center the time-reversed h[m] in n(i.e. shift by n)

    compute the inner product

    5.1 18

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Performing the convolution algorithmically

    x [n] h[n] =

    k=

    x [k]h[n k]

    Ingredients:

    a sequence x [m]

    a second sequence h[m]

    The recipe:

    time-reverse h[m]

    at each step n (from to ):

    center the time-reversed h[m] in n(i.e. shift by n)

    compute the inner product

    5.1 18

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Performing the convolution algorithmically

    x [n] h[n] =

    k=

    x [k]h[n k]

    Ingredients:

    a sequence x [m]

    a second sequence h[m]

    The recipe:

    time-reverse h[m]

    at each step n (from to ):

    center the time-reversed h[m] in n(i.e. shift by n)

    compute the inner product

    5.1 18

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Same example, different perspective

    h[n]

    b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    3 0 3 6 9 12 150

    1

    h[n] = n u[n]

    x [n]

    b b

    b

    b

    b

    b b b

    2 1 0 1 2 3 4 50

    1

    2

    3

    4

    x [n] =

    2 n = 0

    3 n = 1

    1 n = 2

    0 otherwise

    5.1 19

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b

    b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b b

    b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b b

    b b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b b b

    b b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b b b b

    b b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution example

    b b b b b b b b b

    b

    b

    b

    b b b b b b b b b b b b b b b b b b

    8 4 0 4 8 12 16 200

    2

    4x[k]

    b b b b b b

    b b b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    8 4 0 4 8 12 16 200

    1

    h[n

    k]

    b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b

    8 4 0 4 8 12 16 200246

    y[n]

    5.1 20

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution properties

    linearity and time invariance (by definition)

    commutativity: (x h)[n] = (h x)[n]

    associativity for absolutely- and square-summable sequences:((x h) w)[n] = (x (h w))[n]

    5.1 21

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution properties

    linearity and time invariance (by definition)

    commutativity: (x h)[n] = (h x)[n]

    associativity for absolutely- and square-summable sequences:((x h) w)[n] = (x (h w))[n]

    5.1 21

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Convolution properties

    linearity and time invariance (by definition)

    commutativity: (x h)[n] = (h x)[n]

    associativity for absolutely- and square-summable sequences:((x h) w)[n] = (x (h w))[n]

    x [n] h[n] w [n] y [n]

    x [n] (h w)[n] y [n]

    5.1 21

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • END OF MODULE 5.1

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Digital Signal Processing

    Module 5.2: Filtering by exampleDigital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Moving average filter

    Leaky integrator

    5.2 22

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Moving average filter

    Leaky integrator

    5.2 22

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Typical filtering scenario: denoising

    0 100 200 300 400 500

    6420246

    5.2 23

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Typical filtering scenario: denoising

    0 100 200 300 400 500

    6420246

    0 100 200 300 400 500

    6

    0

    6

    5.2 23

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Typical filtering scenario: denoising

    0 100 200 300 400 500

    6420246

    0 100 200 300 400 500

    6

    0

    6

    0 100 200 300 400 500

    6420246

    5.2 23

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    idea: replace each sample by the local average

    for instance: y [n] = (x [n] + x [n 1])/2)

    more generally:

    y [n] =1

    M

    M1k=0

    x [n k]

    5.2 24

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    idea: replace each sample by the local average

    for instance: y [n] = (x [n] + x [n 1])/2)

    more generally:

    y [n] =1

    M

    M1k=0

    x [n k]

    5.2 24

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    idea: replace each sample by the local average

    for instance: y [n] = (x [n] + x [n 1])/2)

    more generally:

    y [n] =1

    M

    M1k=0

    x [n k]

    5.2 24

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    M = 2

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 25

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    M = 4

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 25

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    M = 12

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 25

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising by Moving Average

    M = 100

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 25

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • MA: impulse response

    h[n] =1

    M

    M1k=0

    [n k]

    =

    {1/M for 0 n < M

    0 otherwise

    5.2 26

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • MA: impulse response

    h[n] =1

    M

    M1k=0

    [n k]

    =

    {1/M for 0 n < M

    0 otherwise

    5.2 26

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • MA: impulse response

    b b b b b b b b b b b b b b b b b b b b

    b b b b b b b b b

    b b b b b b b b b b b b

    0 M 10

    1/M

    5.2 27

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • MA: analysis

    smoothing effect proportional to M

    number of operations and storage also proportional to M

    5.2 28

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    M(x [n] + x [n 1] + x [n 2] + . . .+ x [n M + 1])

    moving average over M points

    5.2 29

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    Mx [n] +

    1

    M(x [n 1] + x [n 2] + . . .+ x [n M + 1])

    5.2 30

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    Mx [n] +

    1

    M(x [n 1] + x [n 2] + . . .+ x [n M + 1])

    almostyM1[n 1]

    i.e., moving average over M 1 points, delayed by one

    5.2 30

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    M1k=0

    x [(n 1) k]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    M1k=0

    x [(n 1) k]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    M1k=0

    x [n (k + 1)]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    M1+1k=0+1

    x [n k]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    Mk=1

    x [n k]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    Mk=1

    x [n k]

    yM1[n] =1

    M 1

    M2k=0

    x [n k]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    Formally:

    yM [n] =1

    M

    M1k=0

    x [n k]

    yM [n 1] =1

    M

    Mk=1

    x [n k]

    yM1[n 1] =1

    M 1

    M1k=1

    x [n k]

    5.2 31

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    M

    M1k=0

    x [n k] yM1[n 1] =1

    M 1

    M1k=1

    x [n k]

    M1k=0

    x [n k] = x [n] +

    M1k=1

    x [n k]

    MyM [n] = x [n] + (M 1)yM1[n 1]

    5.2 32

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    M

    M1k=0

    x [n k] yM1[n 1] =1

    M 1

    M1k=1

    x [n k]

    M1k=0

    x [n k] = x [n] +

    M1k=1

    x [n k]

    MyM [n] = x [n] + (M 1)yM1[n 1]

    5.2 32

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    M

    M1k=0

    x [n k] yM1[n 1] =1

    M 1

    M1k=1

    x [n k]

    M1k=0

    x [n k] = x [n] +

    M1k=1

    x [n k]

    MyM [n] = x [n] + (M 1)yM1[n 1]

    5.2 32

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =1

    M

    M1k=0

    x [n k] yM1[n 1] =1

    M 1

    M1k=1

    x [n k]

    M1k=0

    x [n k] = x [n] +

    M1k=1

    x [n k]

    MyM [n] = x [n] + (M 1)yM1[n 1]

    5.2 32

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =M 1

    MyM1[n 1] +

    1

    Mx [n]

    yM [n] = yM1[n 1] + (1 )x [n], =M 1

    M

    5.2 33

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • From the MA to a first-order recursion

    yM [n] =M 1

    MyM1[n 1] +

    1

    Mx [n]

    yM [n] = yM1[n 1] + (1 )x [n], =M 1

    M

    5.2 33

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The Leaky Integrator

    when M is large, yM1[n] yM [n] (and 1)

    try the filtery [n] = y [n 1] + (1 )x [n]

    filter is now recursive, since it uses its previous output value

    5.2 34

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The Leaky Integrator

    when M is large, yM1[n] yM [n] (and 1)

    try the filtery [n] = y [n 1] + (1 )x [n]

    filter is now recursive, since it uses its previous output value

    5.2 34

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The Leaky Integrator

    when M is large, yM1[n] yM [n] (and 1)

    try the filtery [n] = y [n 1] + (1 )x [n]

    filter is now recursive, since it uses its previous output value

    5.2 34

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising recursively with the Leaky Integrator

    = 0.2

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 35

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising recursively with the Leaky Integrator

    = 0.5

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 35

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising recursively with the Leaky Integrator

    = 0.8

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 35

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising recursively with the Leaky Integrator

    = 0.98

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.2 35

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the impulse response?

    y [n] = y [n 1] + (1 )[n]

    y [n] = 0 for all n < 0

    y [0] = y [1] + (1 )[0] = (1 )

    y [1] = y [0] + (1 )[1] = (1 )

    y [2] = y [1] + (1 )[2] = 2(1 )

    y [3] = y [2] + (1 )[3] = 3(1 )

    . . .

    5.2 36

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the impulse response?

    y [n] = y [n 1] + (1 )[n]

    y [n] = 0 for all n < 0

    y [0] = y [1] + (1 )[0] = (1 )

    y [1] = y [0] + (1 )[1] = (1 )

    y [2] = y [1] + (1 )[2] = 2(1 )

    y [3] = y [2] + (1 )[3] = 3(1 )

    . . .

    5.2 36

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the impulse response?

    y [n] = y [n 1] + (1 )[n]

    y [n] = 0 for all n < 0

    y [0] = y [1] + (1 )[0] = (1 )

    y [1] = y [0] + (1 )[1] = (1 )

    y [2] = y [1] + (1 )[2] = 2(1 )

    y [3] = y [2] + (1 )[3] = 3(1 )

    . . .

    5.2 36

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the impulse response?

    y [n] = y [n 1] + (1 )[n]

    y [n] = 0 for all n < 0

    y [0] = y [1] + (1 )[0] = (1 )

    y [1] = y [0] + (1 )[1] = (1 )

    y [2] = y [1] + (1 )[2] = 2(1 )

    y [3] = y [2] + (1 )[3] = 3(1 )

    . . .

    5.2 36

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the impulse response?

    y [n] = y [n 1] + (1 )[n]

    y [n] = 0 for all n < 0

    y [0] = y [1] + (1 )[0] = (1 )

    y [1] = y [0] + (1 )[1] = (1 )

    y [2] = y [1] + (1 )[2] = 2(1 )

    y [3] = y [2] + (1 )[3] = 3(1 )

    . . .

    5.2 36

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the impulse response?

    y [n] = y [n 1] + (1 )[n]

    y [n] = 0 for all n < 0

    y [0] = y [1] + (1 )[0] = (1 )

    y [1] = y [0] + (1 )[1] = (1 )

    y [2] = y [1] + (1 )[2] = 2(1 )

    y [3] = y [2] + (1 )[3] = 3(1 )

    . . .

    5.2 36

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Impulse response

    h[n] = (1 )n u[n]

    b b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    1

    0 15 300

    5.2 37

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky Integrator: why the name

    Discrete-time integrator is a boundless accumulator:

    y [n] =

    nk=

    x [k]

    We can rewrite the integrator as

    y [n] = y [n 1] + x [n]

    5.2 38

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky Integrator: why the name

    To prevent explosion pick < 1

    y [n] = y [n 1] + (1 )x [n]

    keep only a fraction ofthe accumulated valueso far and forget(leak) a fraction 1

    add only a fraction 1 of the current value tothe accumulator

    5.2 39

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • END OF MODULE 5.2

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Digital Signal Processing

    Module 5.3: Filter StabilityDigital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Filter classification in the time domain

    Filter stability

    5.3 40

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Filter classification in the time domain

    Filter stability

    5.3 40

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to impulse response

    Finite Impulse Response (FIR)

    Infinite Impulse Response (IIR)

    causal

    noncausal

    5.3 41

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to impulse response

    Finite Impulse Response (FIR)

    Infinite Impulse Response (IIR)

    causal

    noncausal

    5.3 41

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to impulse response

    Finite Impulse Response (FIR)

    Infinite Impulse Response (IIR)

    causal

    noncausal

    5.3 41

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to impulse response

    Finite Impulse Response (FIR)

    Infinite Impulse Response (IIR)

    causal

    noncausal

    5.3 41

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • FIR

    impulse response has finite support

    only a finite number of samples are involved in the computation of each output sample

    5.3 42

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • FIR (example)

    Moving Average filter

    b b b b b b b b b b b b b b b b b b b b

    b b b b b b b b b

    b b b b b b b b b b b b

    M 1

    1/M

    15 0 150

    5.3 43

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • IIR

    impulse response has infinite support

    a potentially infinite number of samples are involved in the computation of each outputsample

    surprisingly, in many cases the computation can still be performed in a finite amount ofsteps

    5.3 44

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • IIR (example)

    Leaky Integrator

    b b b b b b b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b b

    15 0 150

    5.3 45

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Causal vs Noncausal

    causal:

    impulse response is zero for n < 0

    only past samples (with respect to the present) are involved in the computation of eachoutput sample

    causal filters can work on line since they only need the past

    noncausal:

    impulse response is nonzero for some (or all) n < 0

    can still be implemented in a oine fashion (when all input data is available on storage, e.g.in Image Processing)

    5.3 46

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Causal example

    Moving Average filter

    b b b b b b b b b b b b b b b b b b b b

    b b b b b b

    b b b b b b b b b b b b b b b

    18 12 6 0 6 12 180

    5.3 47

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Noncausal example

    Zero-centered Moving Average filter

    b b b b b b b b b b b b b b b b b b

    b b b b b

    b b b b b b b b b b b b b b b b b b

    18 12 6 0 6 12 180

    5.3 48

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Stability

    key concept: avoid explosions if the input is nice

    a nice signal is a bounded signal: |x [n]| < M for all n

    Bounded-Input Bounded-Output (BIBO) stability: if the input is nice the output shouldbe nice

    5.3 49

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Stability

    key concept: avoid explosions if the input is nice

    a nice signal is a bounded signal: |x [n]| < M for all n

    Bounded-Input Bounded-Output (BIBO) stability: if the input is nice the output shouldbe nice

    5.3 49

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Stability

    key concept: avoid explosions if the input is nice

    a nice signal is a bounded signal: |x [n]| < M for all n

    Bounded-Input Bounded-Output (BIBO) stability: if the input is nice the output shouldbe nice

    5.3 49

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Fundamental Stability Theorem

    A filter is BIBO stable if and only if its impulse response is absolutely summable

    5.3 50

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Proof ()

    Hypotheses:

    |x [n]| < M

    n |h[n]| = L

  • Proof ()

    Hypotheses:

    |x [n]| < M

    n |h[n]| = L

  • Proof ()

    Hypotheses:

    |x [n]| < M

    n |h[n]| = L

  • Proof ()

    Hypotheses:

    |x [n]| < M

    n |h[n]| = L

  • Proof ()

    Hypotheses:

    |x [n]| < M

    n |h[n]| = L

  • Proof ()

    Hypotheses:

    |x [n]| < M

    |y [n]| < P

    Thesis:

    h[n] absolutelysummable

    Proof (by contradiction):

    assume

    n |h[n]| =

    build x [n] =

    {+1 if h[n] 0

    1 if h[n] < 0

    clearly, x [n] is bounded

    however

    y [0] = (xh)[0] =

    k=

    h[k]x [k] =

    k=

    |h[k]| =

    5.3 52

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Proof ()

    Hypotheses:

    |x [n]| < M

    |y [n]| < P

    Thesis:

    h[n] absolutelysummable

    Proof (by contradiction):

    assume

    n |h[n]| =

    build x [n] =

    {+1 if h[n] 0

    1 if h[n] < 0

    clearly, x [n] is bounded

    however

    y [0] = (xh)[0] =

    k=

    h[k]x [k] =

    k=

    |h[k]| =

    5.3 52

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Proof ()

    Hypotheses:

    |x [n]| < M

    |y [n]| < P

    Thesis:

    h[n] absolutelysummable

    Proof (by contradiction):

    assume

    n |h[n]| =

    build x [n] =

    {+1 if h[n] 0

    1 if h[n] < 0

    clearly, x [n] is bounded

    however

    y [0] = (xh)[0] =

    k=

    h[k]x [k] =

    k=

    |h[k]| =

    5.3 52

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Proof ()

    Hypotheses:

    |x [n]| < M

    |y [n]| < P

    Thesis:

    h[n] absolutelysummable

    Proof (by contradiction):

    assume

    n |h[n]| =

    build x [n] =

    {+1 if h[n] 0

    1 if h[n] < 0

    clearly, x [n] is bounded

    however

    y [0] = (xh)[0] =

    k=

    h[k]x [k] =

    k=

    |h[k]| =

    5.3 52

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Proof ()

    Hypotheses:

    |x [n]| < M

    |y [n]| < P

    Thesis:

    h[n] absolutelysummable

    Proof (by contradiction):

    assume

    n |h[n]| =

    build x [n] =

    {+1 if h[n] 0

    1 if h[n] < 0

    clearly, x [n] is bounded

    however

    y [0] = (xh)[0] =

    k=

    h[k]x [k] =

    k=

    |h[k]| =

    5.3 52

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The good news

    FIR filters are always stable

    5.3 53

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Checking the stability of IIRs

    Lets check the Leaky Integrator:

    n=

    |h[n]| = |1 |

    n=0

    ||n

    = limn

    |1 |1 ||n+1

    1 ||

  • Checking the stability of IIRs

    Lets check the Leaky Integrator:

    n=

    |h[n]| = |1 |

    n=0

    ||n

    = limn

    |1 |1 ||n+1

    1 ||

  • Checking the stability of IIRs

    Lets check the Leaky Integrator:

    n=

    |h[n]| = |1 |

    n=0

    ||n

    = limn

    |1 |1 ||n+1

    1 ||

  • Checking the stability of IIRs

    Lets check the Leaky Integrator:

    n=

    |h[n]| = |1 |

    n=0

    ||n

    = limn

    |1 |1 ||n+1

    1 ||

  • Checking the stability of IIRs

    We will study indirect methods for filter stability later in this Module.

    5.3 55

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • END OF MODULE 5.3

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Digital Signal Processing

    Module 5.4: Frequency ResponseDigital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Eigensequences

    Convolution theorem

    Frequency and phase response

    5.4 56

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Eigensequences

    Convolution theorem

    Frequency and phase response

    5.4 56

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Eigensequences

    Convolution theorem

    Frequency and phase response

    5.4 56

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    e j0n H ?

    5.4 57

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    y [n] = e j0n h[n]

    = h[n] e j0n

    =

    k=

    h[k]e j0(nk)

    = e j0n

    k=

    h[k]ej0k

    = H(e j0) e j0n

    5.4 58

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    y [n] = e j0n h[n]

    = h[n] e j0n

    =

    k=

    h[k]e j0(nk)

    = e j0n

    k=

    h[k]ej0k

    = H(e j0) e j0n

    5.4 58

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    y [n] = e j0n h[n]

    = h[n] e j0n

    =

    k=

    h[k]e j0(nk)

    = e j0n

    k=

    h[k]ej0k

    = H(e j0) e j0n

    5.4 58

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    y [n] = e j0n h[n]

    = h[n] e j0n

    =

    k=

    h[k]e j0(nk)

    = e j0n

    k=

    h[k]ej0k

    = H(e j0) e j0n

    5.4 58

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    y [n] = e j0n h[n]

    = h[n] e j0n

    =

    k=

    h[k]e j0(nk)

    = e j0n

    k=

    h[k]ej0k

    = H(e j0) e j0n

    5.4 58

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    e j0n H H(e j0) e j0n

    complex exponentials are eigensequences of LTI systems, i.e., linear filters cannot changethe frequency of sinusoids

    DTFT of impulse response determines the frequency characteristic of a filter

    5.4 59

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • A remarkable result

    e j0n H H(e j0) e j0n

    complex exponentials are eigensequences of LTI systems, i.e., linear filters cannot changethe frequency of sinusoids

    DTFT of impulse response determines the frequency characteristic of a filter

    5.4 59

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Magnitude and phase

    If H(e j0) = Ae j, then

    H{e j0n} = Ae j(0n+)

    amplitude:amplification (A > 1)or attenuation (0 A < 1)

    phase shift:delay ( < 0)or advancement ( > 0)

    5.4 60

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    In general:

    DTFT {x [n] h[n]} =?

    Intuition: the DTFT reconstruction formula tells us how to build x [n]from a set of complex exponential basis functions. By linearity...

    5.4 61

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    In general:

    DTFT {x [n] h[n]} =?

    Intuition: the DTFT reconstruction formula tells us how to build x [n]from a set of complex exponential basis functions. By linearity...

    5.4 61

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    DTFT {x [n] h[n]} =

    n=

    (x h)[n]ejn

    =

    n=

    k=

    x [k]h[n k]ejn

    =

    n=

    k=

    x [k]h[n k]ej(nk)ejk

    =

    k=

    x [k]ejk

    n=

    h[n k]ej(nk)

    = H(e j)X (e j)

    5.4 62

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    DTFT {x [n] h[n]} =

    n=

    (x h)[n]ejn

    =

    n=

    k=

    x [k]h[n k]ejn

    =

    n=

    k=

    x [k]h[n k]ej(nk)ejk

    =

    k=

    x [k]ejk

    n=

    h[n k]ej(nk)

    = H(e j)X (e j)

    5.4 62

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    DTFT {x [n] h[n]} =

    n=

    (x h)[n]ejn

    =

    n=

    k=

    x [k]h[n k]ejn

    =

    n=

    k=

    x [k]h[n k]ej(nk)ejk

    =

    k=

    x [k]ejk

    n=

    h[n k]ej(nk)

    = H(e j)X (e j)

    5.4 62

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    DTFT {x [n] h[n]} =

    n=

    (x h)[n]ejn

    =

    n=

    k=

    x [k]h[n k]ejn

    =

    n=

    k=

    x [k]h[n k]ej(nk)ejk

    =

    k=

    x [k]ejk

    n=

    h[n k]ej(nk)

    = H(e j)X (e j)

    5.4 62

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The convolution theorem

    DTFT {x [n] h[n]} =

    n=

    (x h)[n]ejn

    =

    n=

    k=

    x [k]h[n k]ejn

    =

    n=

    k=

    x [k]h[n k]ej(nk)ejk

    =

    k=

    x [k]ejk

    n=

    h[n k]ej(nk)

    = H(e j)X (e j)

    5.4 62

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Frequency response

    H(e j) = DTFT {h[n]}

    Two effects:

    magnitude: amplification (|H(e j)| > 1) or attenuation (|H(e j)| < 1) of inputfrequencies

    phase: overall delay and shape changes

    5.4 63

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Frequency response

    H(e j) = DTFT {h[n]}

    Two effects:

    magnitude: amplification (|H(e j)| > 1) or attenuation (|H(e j)| < 1) of inputfrequencies

    phase: overall delay and shape changes

    5.4 63

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Moving Average revisited

    h[n] = (u[n] u[nM])/M

    b b b b b b b b b b b b b b b b b b b b

    b b b b b b b b b b

    b b b b b b b b b b b

    0 M 10

    1/M

    5.4 64

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Moving Average, magnitude response

    |H(e j)| = 1M

    sin(2 M)sin(2 ) (see Module 4.7)

    M = 9

    pi pi/2 0 pi/2 pi0

    1

    |H(e

    j)|

    5.4 65

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Moving Average, magnitude response

    |H(e j)| = 1M

    sin(2 M)sin(2 ) (see Module 4.7)

    M = 20

    pi pi/2 0 pi/2 pi0

    1

    |H(e

    j)|

    5.4 65

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Moving Average, magnitude response

    |H(e j)| = 1M

    sin(2 M)sin(2 ) (see Module 4.7)

    M = 100

    pi pi/2 0 pi/2 pi0

    1

    |H(e

    j)|

    5.4 65

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    0 100 200 300 400 500

    6420246

    0 100 200 300 400 500

    6

    0

    6

    5.4 66

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    0 100 200 300 400 500

    6420246

    0 100 200 300 400 500

    6

    0

    6

    pi pi/2 0 pi/2 pi0

    1

    pi pi/2 0 pi/2 pi0

    1

    5.4 66

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    pi pi/2 0 pi/2 pi0

    1

    5.4 67

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    pi pi/2 0 pi/2 pi0

    1

    5.4 67

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    pi pi/2 0 pi/2 pi0

    1

    5.4 67

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    pi pi/2 0 pi/2 pi0

    1

    5.4 67

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    pi pi/2 0 pi/2 pi0

    1

    5.4 67

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Denoising revisited

    pi pi/2 0 pi/2 pi0

    1

    5.4 67

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • By the way, remember the time-domain analysis...

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.4 68

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • By the way, remember the time-domain analysis...

    M = 12

    0 100 200 300 400 500

    6

    4

    2

    0

    2

    4

    6

    5.4 68

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the phase?

    Assume |H(e j)| = 1

    zero phase: H(e j) = 0

    linear phase: H(e j) = d

    nonlinear phase

    5.4 69

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the phase?

    Assume |H(e j)| = 1

    zero phase: H(e j) = 0

    linear phase: H(e j) = d

    nonlinear phase

    5.4 69

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What about the phase?

    Assume |H(e j)| = 1

    zero phase: H(e j) = 0

    linear phase: H(e j) = d

    nonlinear phase

    5.4 69

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Phase and signal shape

    x [n] =1

    2sin(0n) + cos(20n) 0 =

    2

    40

    0 28 56 84 112 140 168

    1

    0

    1

    5.4 70

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Phase and signal shape: linear phase

    x [n] =1

    2sin(0n + 0) + cos(20n+ 20) 0 =

    8

    5

    0 28 56 84 112 140 168

    1

    0

    1

    5.4 71

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Phase and signal shape: nonlinear phase

    x [n] =1

    2sin(0n) + cos(20n + 20)

    0 28 56 84 112 140 168

    1

    0

    1

    5.4 72

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear phase

    x [n] D x [n d ]

    y [n] = x [n d ]

    Y (e j) = ejd X (e j)

    H(e j) = ejd

    linear phase term

    5.4 73

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear phase

    x [n] D x [n d ]

    y [n] = x [n d ]

    Y (e j) = ejd X (e j)

    H(e j) = ejd

    linear phase term

    5.4 73

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear phase

    x [n] D x [n d ]

    y [n] = x [n d ]

    Y (e j) = ejd X (e j)

    H(e j) = ejd

    linear phase term

    5.4 73

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear phase

    x [n] D x [n d ]

    y [n] = x [n d ]

    Y (e j) = ejd X (e j)

    H(e j) = ejd

    linear phase term

    5.4 73

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Linear phase

    In general, if H(e j) = A(e j)ejd , with A(e j) R

    x [n] A(e j) delay by d y [n]

    5.4 74

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Moving Average is linear phase

    H(e j) =1

    M

    sin(2M

    )sin(2

    ) ej M12

    5.4 75

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator revisited

    h[n] = (1 )n u[n]

    b b b b b b b b b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    1

    0 15 300

    5.4 76

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator revisited

    H(e j) =1

    1 ej(Module 4.4)

    Finding magnitude and phase require a little algebra...

    5.4 77

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator revisited

    Recall from complex algebra:1

    a + jb=

    a jb

    a2 + b2

    so that if x = 1/(a + jb),

    |x |2 =1

    a2 + b2

    x = tan1[b

    a

    ]

    5.4 78

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator revisited

    H(e j) =1

    (1 cos) j sin

    so that:

    |H(e j)|2 =(1 )2

    1 2 cos + 2

    H(e j) = tan1[

    sin

    1 cos

    ]

    5.4 79

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator, magnitude response

    = 0.9

    pi pi/2 0 pi/2 pi0

    1

    |H(e

    j)|

    5.4 80

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator, magnitude response

    = 0.95

    pi pi/2 0 pi/2 pi0

    1

    |H(e

    j)|

    5.4 80

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator, magnitude response

    = 0.98

    pi pi/2 0 pi/2 pi0

    1

    |H(e

    j)|

    5.4 80

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator, phase response

    = 0.9

    pi/2

    pi/2

    pi pi/2 0 pi/2 pi

    H(e

    j)

    5.4 81

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator, phase response

    = 0.95

    pi/2

    pi/2

    pi pi/2 0 pi/2 pi

    H(e

    j)

    5.4 81

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Leaky integrator, phase response

    = 0.98

    pi/2

    pi/2

    pi pi/2 0 pi/2 pi

    H(e

    j)

    5.4 81

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Phase is sufficiently linear where it matters

    pi pi/2 0 pi/2 pi0

    1|H

    (ej)|

    pi/2

    pi/2

    pi pi/2 0 pi/2 pi

    H(e

    j)

    5.4 82

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Phase is sufficiently linear where it matters

    pi pi/2 0 pi/2 pi0

    1|H

    (ej)|

    pi/2

    pi/2

    pi pi/2 0 pi/2 pi

    H(e

    j)

    5.4 82

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Karplus-Strong revisited, again!

    x [n] + b y [n]

    zM

    y [n] = y [n M] + x [n]

    5.4 83

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • KS revisited

    y [n] = n/Mx [n mod M] u[n]

    0 166 332 498 664 830 996

    1

    0

    1

    5.4 84

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Karplus-Strong revisited

    y [n] = x [0], x [1], . . . , x [M 1], x [0], x [1], . . . , x [M 1], 2x [0], 2x [1], . . .

    5.4 85

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Karplus-Strong revisited

    y [n] = x [0], x [1], . . . , x [M 1], x [0], x [1], . . . , x [M 1], 2x [0], 2x [1], . . .

    1st period 2nd period . . .

    5.4 85

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • DTFT of KS signal, using the convolution theorem

    key observation:

    y [n] = x [n] w [n], w [n] =

    {k for n = kM

    0 otherwise

    Y (e j) = X (e j)W (e j)

    5.4 86

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • DTFT of KS signal, using the convolution theorem

    key observation:

    y [n] = x [n] w [n], w [n] =

    {k for n = kM

    0 otherwise

    Y (e j) = X (e j)W (e j)

    5.4 86

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • DTFT of KS signal, using the convolution theorem

    X (e j) = ej(M + 1

    M 1

    )1 ej(M1)

    (1 ej)2

    1 ej(M+1)

    (1 ej)2

    W (e j) =1

    1 ejM

    5.4 87

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • DTFT of KS

    |X (e j)|

    pi pi/2 0 pi/2 pi

    5.4 88

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • DTFT of KS

    |W (e j)|

    pi pi/2 0 pi/2 pi

    5.4 88

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • DTFT of KS

    |Y (e j)|

    pi pi/2 0 pi/2 pi

    5.4 88

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • END OF MODULE 5.4

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Digital Signal Processing

    Module 5.5: Ideal FiltersDigital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Filter classification in the frequency domain

    Ideal filters

    Demodulation revisited

    5.5 89

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Filter classification in the frequency domain

    Ideal filters

    Demodulation revisited

    5.5 89

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Overview:

    Filter classification in the frequency domain

    Ideal filters

    Demodulation revisited

    5.5 89

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to magnitude response

    Lowpass

    Highpass

    Bandpass

    Allpass

    Moving Average and Leaky Integrator are lowpass filters

    5.5 90

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to magnitude response

    Lowpass

    Highpass

    Bandpass

    Allpass

    Moving Average and Leaky Integrator are lowpass filters

    5.5 90

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to magnitude response

    Lowpass

    Highpass

    Bandpass

    Allpass

    Moving Average and Leaky Integrator are lowpass filters

    5.5 90

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to magnitude response

    Lowpass

    Highpass

    Bandpass

    Allpass

    Moving Average and Leaky Integrator are lowpass filters

    5.5 90

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to magnitude response

    Lowpass

    Highpass

    Bandpass

    Allpass

    Moving Average and Leaky Integrator are lowpass filters

    5.5 90

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to phase response

    Linear phase

    Nonlinear phase

    5.5 91

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Filter types according to phase response

    Linear phase

    Nonlinear phase

    5.5 91

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What is the best lowpass we can think of?

    ccpi 0 pi0

    1

    H(e

    j)

    5.5 92

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • What is the best lowpass we can think of?

    cc

    b = 2c

    pi 0 pi0

    1

    H(e

    j)

    5.5 92

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter

    H(e j) =

    {1 for || c

    0 otherwise(2-periodicity implicit)

    perfectly flat passband

    infinite attenuation in stopband

    zero-phase (no delay)

    5.5 93

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter

    H(e j) =

    {1 for || c

    0 otherwise(2-periodicity implicit)

    perfectly flat passband

    infinite attenuation in stopband

    zero-phase (no delay)

    5.5 93

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter

    H(e j) =

    {1 for || c

    0 otherwise(2-periodicity implicit)

    perfectly flat passband

    infinite attenuation in stopband

    zero-phase (no delay)

    5.5 93

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    h[n] = IDTFT{H(e j)

    }=

    1

    2

    pipi

    H(e j)e jnd

    =1

    2

    cc

    e jnd

    =1

    n

    e jcn ejcn

    2j

    =sincn

    n

    5.5 94

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    h[n] = IDTFT{H(e j)

    }=

    1

    2

    pipi

    H(e j)e jnd

    =1

    2

    cc

    e jnd

    =1

    n

    e jcn ejcn

    2j

    =sincn

    n

    5.5 94

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    h[n] = IDTFT{H(e j)

    }=

    1

    2

    pipi

    H(e j)e jnd

    =1

    2

    cc

    e jnd

    =1

    n

    e jcn ejcn

    2j

    =sincn

    n

    5.5 94

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    h[n] = IDTFT{H(e j)

    }=

    1

    2

    pipi

    H(e j)e jnd

    =1

    2

    cc

    e jnd

    =1

    n

    e jcn ejcn

    2j

    =sincn

    n

    5.5 94

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    h[n] = IDTFT{H(e j)

    }=

    1

    2

    pipi

    H(e j)e jnd

    =1

    2

    cc

    e jnd

    =1

    n

    e jcn ejcn

    2j

    =sincn

    n

    5.5 94

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    0

    c/pi

    20 10 0 10 20

    5.5 95

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal lowpass filter: impulse response

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    0

    c/pi

    20 10 0 10 20

    5.5 95

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The bad news

    impulse response is infinite support, two-sided= cannot compute the output in a finite amount of time= thats why its called ideal

    impulse response decays slowly in time= we need a lot of samples for a good approximation

    5.5 96

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The bad news

    impulse response is infinite support, two-sided= cannot compute the output in a finite amount of time= thats why its called ideal

    impulse response decays slowly in time= we need a lot of samples for a good approximation

    5.5 96

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Nevertheless...

    The sinc-rect pair:

    rect(x) =

    {1 |x | 1/20 |x | > 1/2

    sinc(x) =

    sin(x)

    xx 6= 0

    1 x = 0

    (note that sinc(x) = 0 when x is a nonzero integer)

    5.5 97

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • The ideal lowpass in canonical form

    rect

    (

    2c

    )DTFT

    cpi

    sinc(cpin

    )

    5.5 98

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Example

    c = /3: H(ej) = rect(3/2), h[n] = (1/3)sinc(n/3)

    pi 2pi/3 pi/3 0 pi/3 2pi/3 pi0

    1

    H(e

    j)

    b

    b b

    b

    b b

    b

    b b

    b

    b b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b

    b b

    b

    b b

    b

    b b

    b

    b b

    b

    1/3

    30 20 10 0 10 20 30

    0

    h[n]

    5.5 99

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Little-known fact

    the sinc is not absolutely summable

    the ideal lowpass is not BIBO stable!

    example for c = /3: h[n] = (1/3) sinc(n/3)

    take x [n] = sign{sinc(n/3)} and

    y [0] = (x h)[0] =1

    3

    k=

    | sinc(k/3)| =

    5.5 100

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Little-known fact

    the sinc is not absolutely summable

    the ideal lowpass is not BIBO stable!

    example for c = /3: h[n] = (1/3) sinc(n/3)

    take x [n] = sign{sinc(n/3)} and

    y [0] = (x h)[0] =1

    3

    k=

    | sinc(k/3)| =

    5.5 100

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Little-known fact

    the sinc is not absolutely summable

    the ideal lowpass is not BIBO stable!

    example for c = /3: h[n] = (1/3) sinc(n/3)

    take x [n] = sign{sinc(n/3)} and

    y [0] = (x h)[0] =1

    3

    k=

    | sinc(k/3)| =

    5.5 100

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Little-known fact

    the sinc is not absolutely summable

    the ideal lowpass is not BIBO stable!

    example for c = /3: h[n] = (1/3) sinc(n/3)

    take x [n] = sign{sinc(n/3)} and

    y [0] = (x h)[0] =1

    3

    k=

    | sinc(k/3)| =

    5.5 100

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Divergence is however very slow...

    s(n) = (1/3)n

    k=n

    | sinc(k/3)|

    1 5000 100000

    1

    2

    3

    4

    5.5 101

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal highpass filter

    ccpi 0 pi0

    1

    H(e

    j)

    5.5 102

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal highpass filter

    Hhp(ej) =

    {1 for || c

    0 otherwise(2-periodicity implicit)

    Hhp(ej) = 1 Hlp(e

    j)

    hhp[n] = [n]csinc(

    cn)

    5.5 103

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal highpass filter

    Hhp(ej) =

    {1 for || c

    0 otherwise(2-periodicity implicit)

    Hhp(ej) = 1 Hlp(e

    j)

    hhp[n] = [n]csinc(

    cn)

    5.5 103

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal highpass filter

    Hhp(ej) =

    {1 for || c

    0 otherwise(2-periodicity implicit)

    Hhp(ej) = 1 Hlp(e

    j)

    hhp[n] = [n]csinc(

    cn)

    5.5 103

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal bandpass filter

    0 c 0 0 + c0pi 0 pi0

    1

    H(e

    j)

    5.5 104

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal bandpass filter

    ccpi 0 pi0

    1

    5.5 105

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal bandpass filter

    0pi 0 pi0

    1

    5.5 105

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal bandpass filter

    00pi 0 pi0

    1

    5.5 105

    Digital Sig

    nal Proces

    sing

    Paolo Pran

    doni and M

    artin Vett

    erli

    2013

  • Ideal bandpass filter

    Hbp(ej) =

    {1 for | 0| c

    0 otherwise(2-periodicity implicit)

    hbp[n] = 2 cos(0n)csinc(

    cn)

    5.5 106

    Digital Sig

    nal Proces

    sing