A Comparison of DFT and DWT Based Similarity Search

download A Comparison of DFT and DWT Based Similarity Search

of 8

Transcript of A Comparison of DFT and DWT Based Similarity Search

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    1/8

    Yi-Leh Wu Divyakant Agrawal Amr El Abbadi

    Department of Computer ScienceUniversity of California, Santa Barbara

    ABSTRACT

    1. INTRODUCTION

    Permission to make digital or hard copies of part or all of this work orpersonal or classroom use is granted without fee provided that copies arenot made or distributed for profit or commercial advantage and that copiesbear this notice and the full citation on the first page. To copy otherwise, torepublish, to post on servers, or to redistribute to lists, requires priorspecific permission and/or a fee.

    CIKM 2000, McLean, VA USA ACM 2000 1-58113-320-0/00/11 . . .$5.00

    488

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    2/8

    2. BACKGROUND

    2.1 Query Processing in Time-series Databases

    80

    100

    120

    140

    160

    180

    0 50 100 150 200 250 300 350

    stockclosingpriceinUD$

    time in days

    real stock data

    489

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    3/8

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#5

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#1

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#2

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#3

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#4

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#6

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#7

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    reconstructfromcoef.#8

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    originaldata

    + + ++

    +++++ + ....

    =

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    normalizedstockdata

    time in days

    original datareconstruct from 8 coef.

    reconstruct from 64 coef.

    -150

    -100

    -50

    0

    50

    100

    150

    20 40 60 80 100 120

    normalizedstockdata

    time in days

    original datareconstruct from first 8 DFT coef.

    reconstruct from first 8 DFT coef. with conjugate property

    2.2 Discrete Wavelet Transform

    490

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    4/8

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#5

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#1

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#2

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#3

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#4

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#6

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#7

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    reconstructfromcoef.#8

    + + ++

    +++++ + ....

    =

    -100

    -80

    -60

    -40

    -20

    0

    20

    40

    60

    80

    100

    20 40 60 80 100 120

    originaldata

    -100

    -50

    0

    50

    100

    20 40 60 80 100 120

    normalizedstockdata

    time in days

    original datareconstruct from 8 coef.

    reconstruct from 64 coef.

    3. WHY WAVELETS?

    1000

    10000

    100000

    0 20 40 60 80 100 120

    standarddeviation

    coefficient 0 to 127

    DFT coefficient (real part)DFT coefficient (imaginary part)

    DWT coefficient

    491

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    5/8

    0.01

    0.1

    1

    10

    100

    0 20 40 60 80 100 120

    energypercentage(%)

    coefficient 0 to 127

    average energy of indivisual DFT coefficientaverage energy of indivisual DWT coefficient

    10

    100

    20 40 60 80 100 120

    energypercentage(%)

    # of coefficients

    accumulate energy of DFT coefficientsaccumulate energy of DWT coefficients

    accumulate energy of DFT coefficients with mirror effect

    10

    100

    1 2 3 4 5 6 7 8 9 1 0

    energypercentage(%)

    # of coefficients

    accumulate energy of DFT coefficientsaccumulate energy of DWT coefficients

    accumulate energy of DFT coefficients with mirror effect

    492

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    6/8

    4. EXPERIMENTS

    4.1 Approximation Errors after Transforms

    0

    20

    40

    60

    80

    100

    0 20 40 60 80 100 120 140

    approximationerror(%)

    storage space (# of floting point numbers)

    DFTDFT (with mirror effect)

    DWT

    4.2 Matching Errors after Transforms

    -100

    -50

    0

    50

    100

    0 20 40 60 80 100 120 140

    nor

    malizedstockdata

    time in days

    stock ABRX from day 20

    0

    5

    10

    15

    20

    25

    30

    35

    40

    0 5 10 15 20 25 30 35

    re

    lativeerror(%)

    storage space (# of floting point numbers)

    Query with ABRX (set #45) data starting date 20

    DFTDFT (with mirror effect)

    DWT (first)

    0

    5

    10

    15

    20

    25

    30

    35

    40

    45

    0 5 10 15 20 25 30 35

    relativeerror(%)

    storage space (# of floting point numbers)

    DFTDFT (with mirror effect)

    DWT

    493

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    7/8

    4.3 Precision of Epsilon Query with Trans-forms

    0

    0.05

    0.1

    0.15

    0.2

    0.25

    0.3

    0.35

    0.4

    100 150 200 250 300 350 400 450 500

    precision

    epsilon distance

    DFT (first 4 coef.)DFT (first 4 coef. with mirror effect)

    DWT (first 8 coef.)

    5. CONCLUSION

    6. REFERENCES

    494

  • 7/29/2019 A Comparison of DFT and DWT Based Similarity Search

    8/8

    Appendix A: Mathematics for Discrete FourierTransform (DFT)

    Appendix B: Minimizing Thresholding Error

    495