70
Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects Teaching a Discrete Wavelets Transform Course Helmut Knaust Department of Mathematical Sciences The University of Texas at El Paso El Paso TX 79968-0514 [email protected] Scottsdale AZ April 9, 2010

Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Teaching aDiscrete Wavelets Transform Course

Helmut KnaustDepartment of Mathematical Sciences

The University of Texas at El PasoEl Paso TX 79968-0514

[email protected]

Scottsdale AZ April 9, 2010

Page 2: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

1 Course Setup

2 The Problem

3 Basics of Digital Signal Processing

4 Approximating Data

5 JPEG 2000 Algorithm

6 Learning Mathematica - Scaffolding during the Semester

7 Final Projects - Spring 2009

Page 3: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Objectives:

Students will make considerable progress in the followingareas:

1 Develop an understanding of the theoretical underpinningsof wavelet transforms and their applications.

2 Learn how to use a computer algebra system formathematical investigations, as a computational andvisualization aid, and for the implementation ofmathematical algorithms.

3 Get a flavor of the ideas and issues involved in applyingmathematics to a relevant engineering problem.

4 Be able to give and defend a mathematical presentation toa group of your peers.

Page 4: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Objectives:

Students will make considerable progress in the followingareas:

1 Develop an understanding of the theoretical underpinningsof wavelet transforms and their applications.

2 Learn how to use a computer algebra system formathematical investigations, as a computational andvisualization aid, and for the implementation ofmathematical algorithms.

3 Get a flavor of the ideas and issues involved in applyingmathematics to a relevant engineering problem.

4 Be able to give and defend a mathematical presentation toa group of your peers.

Page 5: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Objectives:

Students will make considerable progress in the followingareas:

1 Develop an understanding of the theoretical underpinningsof wavelet transforms and their applications.

2 Learn how to use a computer algebra system formathematical investigations, as a computational andvisualization aid, and for the implementation ofmathematical algorithms.

3 Get a flavor of the ideas and issues involved in applyingmathematics to a relevant engineering problem.

4 Be able to give and defend a mathematical presentation toa group of your peers.

Page 6: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Objectives:

Students will make considerable progress in the followingareas:

1 Develop an understanding of the theoretical underpinningsof wavelet transforms and their applications.

2 Learn how to use a computer algebra system formathematical investigations, as a computational andvisualization aid, and for the implementation ofmathematical algorithms.

3 Get a flavor of the ideas and issues involved in applyingmathematics to a relevant engineering problem.

4 Be able to give and defend a mathematical presentation toa group of your peers.

Page 7: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Objectives:

Students will make considerable progress in the followingareas:

1 Develop an understanding of the theoretical underpinningsof wavelet transforms and their applications.

2 Learn how to use a computer algebra system formathematical investigations, as a computational andvisualization aid, and for the implementation ofmathematical algorithms.

3 Get a flavor of the ideas and issues involved in applyingmathematics to a relevant engineering problem.

4 Be able to give and defend a mathematical presentation toa group of your peers.

Page 8: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Prerequisites:A thorough understanding of CalculusSome familiarity with matricesMathematical maturityWillingness to learn Mathematica

Page 9: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)Four individual student projects and a final group projectTwo midterm exams, no final examHomework assigned regularly; students present solutionsin class.Classroom with LCD projector; computer laboratory is nextdoor.Night class at 6:30 p.m.

Page 10: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)

Four individual student projects and a final group projectTwo midterm exams, no final examHomework assigned regularly; students present solutionsin class.Classroom with LCD projector; computer laboratory is nextdoor.Night class at 6:30 p.m.

Page 11: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)Four individual student projects and a final group project

Two midterm exams, no final examHomework assigned regularly; students present solutionsin class.Classroom with LCD projector; computer laboratory is nextdoor.Night class at 6:30 p.m.

Page 12: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)Four individual student projects and a final group projectTwo midterm exams, no final exam

Homework assigned regularly; students present solutionsin class.Classroom with LCD projector; computer laboratory is nextdoor.Night class at 6:30 p.m.

Page 13: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)Four individual student projects and a final group projectTwo midterm exams, no final examHomework assigned regularly; students present solutionsin class.

Classroom with LCD projector; computer laboratory is nextdoor.Night class at 6:30 p.m.

Page 14: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)Four individual student projects and a final group projectTwo midterm exams, no final examHomework assigned regularly; students present solutionsin class.Classroom with LCD projector; computer laboratory is nextdoor.

Night class at 6:30 p.m.

Page 15: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Course Structure:

Three semester credit hours (2 × 80 minutes per week)Four individual student projects and a final group projectTwo midterm exams, no final examHomework assigned regularly; students present solutionsin class.Classroom with LCD projector; computer laboratory is nextdoor.Night class at 6:30 p.m.

Page 16: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Time Spent:

40% Lecturing at the whiteboard40% Lecturing using Mathematica notebooks20% Students working on projects

Page 17: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Patrick van FleetDiscrete WaveletTransformations: AnElementary Approach withApplicationsWiley

Page 18: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

An Alternative:

Arne Jensen and Anders LaCour-Harbo:Ripples in Mathematics: TheDiscrete Wavelet TransformSpringer

Page 19: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

The Engineering Problem:Transmit digital information through a “narrow channel”.“Lossy compression”: The information received need notbe identical to the one sent, but the quality must be“acceptable”.

Sender

Channel

Receiver

Page 20: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Applications:PhotosMP3 playersReal-time two-way audio (cellular telephones)

Streaming video (Netflix, Hulu)Real-time two-way audio and video (Skype)

Page 21: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Applications:PhotosMP3 playersReal-time two-way audio (cellular telephones)Streaming video (Netflix, Hulu)

Real-time two-way audio and video (Skype)

Page 22: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Applications:PhotosMP3 playersReal-time two-way audio (cellular telephones)Streaming video (Netflix, Hulu)Real-time two-way audio and video (Skype)

Page 23: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

A color image consists of three color channels: Red, Green andBlue

Page 24: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Each pixel in a gray-scale image is represented by an integerbetween 0 and 255 = 28 − 1 (8 bit = 1 byte)

0=black, 255=white

Page 25: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

“Raw” storage requirement:(512 × 768) bytes = 393.2 KB

Page 26: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

“Naive compression” — Average of four neighboring pixels:Compression factor: 4

Page 27: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Mathematical Question: What ways are there to approximate afunction (“data”) other than just averaging?

Differentiation Techniques

Taylor series

Integration Techniques

Fourier seriesWavelets

Page 28: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Mathematical Question: What ways are there to approximate afunction (“data”) other than just averaging?

Differentiation Techniques

Taylor seriesIntegration Techniques

Fourier seriesWavelets

Page 29: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Mathematical Question: What ways are there to approximate afunction (“data”) other than just averaging?

Differentiation TechniquesTaylor series

Integration Techniques

Fourier seriesWavelets

Page 30: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Mathematical Question: What ways are there to approximate afunction (“data”) other than just averaging?

Differentiation TechniquesTaylor series

Integration Techniques

Fourier seriesWavelets

Page 31: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Mathematical Question: What ways are there to approximate afunction (“data”) other than just averaging?

Differentiation TechniquesTaylor series

Integration TechniquesFourier seriesWavelets

Page 32: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Fourier approximation

-Π -3 Π

4-

Π

2-

Π

4

Π

4

Π

2

3 Π

-2.0

-1.5

-1.0

-0.5

6

0.827958 sin(t)− 0.310564 sin(2t) + 0.191515 sin(3t)−0.139372 sin(4t) + 0.109891 sin(5t)− 0.0908419 sin(6t) +0.586021 cos(t)− 0.172359 cos(2t) + 0.079192 cos(3t)−0.0450785 cos(4t) + 0.0290109 cos(5t)− 0.0202076 cos(6t)−0.465052

Page 33: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

The first Fourier functions:

-3 -2 -1 1 2 3

0.5

1.0

1.5

2.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

Page 34: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

The JPEG algorithm uses Fourier techniques - it employs the“Discrete Cosine Fourier Transform (DCT)”.

Here is a JPEG example with compression factor 6:

Page 35: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Wavelet pioneers: AlfredHaar (t-r, on the left),

Stephane Mallat (b-r), IngridDaubechies (t)

Page 36: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

The first Haar functions:

1

-1

1

1

-1

1

1

-1

1

1

-1

1

1

-1

1

1

-1

1

1

-1

1

1

-1

1

Page 37: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Original image

Page 38: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

1st color channel: Y

Page 39: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

2nd color channel: Cr

Page 40: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

3rd color channel: Cb

Page 41: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Applying the CDF97-wavelet transform to Y once

Page 42: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

. . . and again. . .

Page 43: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

. . . and one more time:

Page 44: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Quantizing the Y channel

Page 45: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

The sender then encodes this “quantized image” andsends it through the narrow channel to the receiver.

The compression factor in this example is 10.2.

The receiver then decompresses the image to be able toview the approximation of the original image.

Page 46: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

“Undoing” the transform (by receiver)

Page 47: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Original image, again. . .

Page 48: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Zooming in on the original image:

Page 49: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Zooming in on the received image:

Page 50: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project 01

Due Tuesday, February 3, 2009

� Problem 1

Let B =

1 2 34 5 67 8 10

. Find matrices A and C such that

A.B.C =

7 8 104 5 61 2 3

. Can you choose A or C to be the identity matrix?

Page 51: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Due February 17, 2009

� Problem 2

Pick a small grayscale image (your choice) and use matrix transposition and multiplication with suitable matrices to

produce the following six images :

Page 52: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project 04

Due April 9, 2009

� Problem 1 (15 points)

Write a module ' InverseHaarWLTransform[pic_, n_]' to apply the inverse Haar Transform 'n' times to the matrix ' pic'.

Check (using PSNR) that if you apply the Haar transform three times and then your module (with n=3), you obtain the

original image back (modulo loss due to round-off error).

� Problem 2 (15 points)

Write a procedure (preferably a module) to graph a function and its approximation in the vector spaceV4 defined in the handout "Multi-resolution Analysis".

Here is the definition of the father wavelet and the plot of one of the basis elements in V4 :

phiAx_E = Piecewise@881, 0 < x < 1<<, 0D

Page 53: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

0.2 0.4 0.6 0.8 1.0

0.8

1.0

1.2

Page 54: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Final Projects - Setup:

Three student groups with three studentsEach group prepares a 20-minute oral presentation using aMathematica notebook.Project topics:

1 Matrix Completion

2 Huffman Tree and Coding3 Zooming in on an Image

Page 55: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Final Projects - Setup:

Three student groups with three students

Each group prepares a 20-minute oral presentation using aMathematica notebook.Project topics:

1 Matrix Completion

2 Huffman Tree and Coding3 Zooming in on an Image

Page 56: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Final Projects - Setup:

Three student groups with three studentsEach group prepares a 20-minute oral presentation using aMathematica notebook.

Project topics:1 Matrix Completion

2 Huffman Tree and Coding3 Zooming in on an Image

Page 57: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Final Projects - Setup:

Three student groups with three studentsEach group prepares a 20-minute oral presentation using aMathematica notebook.Project topics:

1 Matrix Completion

2 Huffman Tree and Coding3 Zooming in on an Image

Page 58: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Final Projects - Setup:

Three student groups with three studentsEach group prepares a 20-minute oral presentation using aMathematica notebook.Project topics:

1 Matrix Completion2 Huffman Tree and Coding

3 Zooming in on an Image

Page 59: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Final Projects - Setup:

Three student groups with three studentsEach group prepares a 20-minute oral presentation using aMathematica notebook.Project topics:

1 Matrix Completion2 Huffman Tree and Coding3 Zooming in on an Image

Page 60: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project A: Matrix Completion∗

Objective: Replace the standard D4-filter by a modified filterthat avoids coefficient wrapping of the last row/column.

Here is the shape of the modified D4-filter:

W8 =

a2 a1 a0 0 0 0 0 00 h3 h2 h1 h0 0 0 00 0 0 h3 h2 h1 h0 00 0 0 0 0 b2 b1 b0

c2 c1 c0 0 0 0 0 00 −h0 h1 −h2 h3 0 0 00 0 0 −h0 h1 −h2 h3 00 0 0 0 0 d2 d1 d0

∗Based on Problem 7.19 of the textbook

Page 61: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project A: Matrix Completion∗

Objective: Replace the standard D4-filter by a modified filterthat avoids coefficient wrapping of the last row/column.Here is the shape of the modified D4-filter:

W8 =

a2 a1 a0 0 0 0 0 00 h3 h2 h1 h0 0 0 00 0 0 h3 h2 h1 h0 00 0 0 0 0 b2 b1 b0

c2 c1 c0 0 0 0 0 00 −h0 h1 −h2 h3 0 0 00 0 0 −h0 h1 −h2 h3 00 0 0 0 0 d2 d1 d0

∗Based on Problem 7.19 of the textbook

Page 62: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Matrix Completion

Original D4

Page 63: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Matrix Completion

Modified D4

Page 64: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project B: Huffman Tree and Coding

Objective: Write Mathematica commandsto Huffman encode,to Huffman decode, andto produce a Huffman tree.

In[6]:= CodeWord@"Mississippi", 88i, "0"<, 8M, "100"<, 8p, "101"<, 8s, "11"<<DThe coded bit stream for Mississippi is 100011110111101011010 .

In[10]:= Uncodestring@"100011110111101011010",88i, "0"<, 8M, "100"<, 8p, "101"<, 8s, "11"<<D

The word for the bit stream 100011110111101011010 is Mississippi.

Page 65: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project B: Huffman Tree and Coding

Objective: Write Mathematica commandsto Huffman encode,to Huffman decode, andto produce a Huffman tree.

In[6]:= CodeWord@"Mississippi", 88i, "0"<, 8M, "100"<, 8p, "101"<, 8s, "11"<<DThe coded bit stream for Mississippi is 100011110111101011010 .

In[10]:= Uncodestring@"100011110111101011010",88i, "0"<, 8M, "100"<, 8p, "101"<, 8s, "11"<<D

The word for the bit stream 100011110111101011010 is Mississippi.

Page 66: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project B: Huffman Tree and Coding

Objective: Write Mathematica commandsto Huffman encode,to Huffman decode, andto produce a Huffman tree.

In[6]:= CodeWord@"Mississippi", 88i, "0"<, 8M, "100"<, 8p, "101"<, 8s, "11"<<DThe coded bit stream for Mississippi is 100011110111101011010 .

In[10]:= Uncodestring@"100011110111101011010",88i, "0"<, 8M, "100"<, 8p, "101"<, 8s, "11"<<D

The word for the bit stream 100011110111101011010 is Mississippi.

Page 67: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Huffman Tree and Coding

In[59]:= HuffTree@"Supercalifragilisticexpialidocious"D

0 1

0 1 0 1

0 1 0 10 1

0 1 0 10 1 0 1 0 1 0 1

0 1 0 1 0 1

i

a cu le p s ro

f S t gd x

Page 68: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Project C: Zooming In

bB

vV

hH

dD

Page 69: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects

Any Questions?

Contact: [email protected]

Page 70: Teaching a Discrete Wavelets Transform Coursehelmut.knaust.info/presentations/2010/20100409_DWT_MAA.pdf · 2010-04-13 · Discrete Wavelet Transformations: An Elementary Approach

Setup The Problem Basic DSP Approximating Data JPEG2000 Learning Mathematica Final Projects