Applications of matrix computations, fall 2016

Last modified by smsiltan@helsinki_fi on 2024/03/27 10:49

Smurfboth.png

The "smurf removal" above is an example of harmonic inpainting, a method for removing unwanted objects from a photo. Let me stress that the above was not done by Photoshop! Actually Photoshop is the one that uses mathematical techniques.

Harmonic inpainting follows the ideas of Professor Poisson, here depicted among cup lichen (genus Cladonia) using image processing methods based on deep learning:

Simeon_Poisson_square2.jpg

For more information about harmonic inpainting, see this Science SLAM Helsinki video.

One of the important topics in the course is the wavelet transform.

Teacher: Samuli Siltanen 

Scope: 5 cr

Type: Intermediate studies

Teaching:

Topics: Mathematical modelling using matrices and linear algebra. Many practical applications with a special focus on digital image processing.

Prerequisites: Basic linear algebra (for example courses "Linis" I and II). Rudimentary knowledge of Matlab programming is helpful.

This fall the course concentrates on signal and image processing using matrix methods. The following mathematical techniques will be studied and implemented using Matlab:

We will collect data with smartphone sensors and cameras, and make sense of the data using matrix computations. For example, we will use wavelets for removing noise from the signals and compressing images. There are close connections to JPEG and JPGE2000 image formats, which are based on cosine transform and wavelet transform, respectively.

This course will prepare the students for using computational mathematics both in scientific research and in work life outside the university.

News

18.10.2016 Results of the feedback questionnaire are in. It seems that the course has been pretty OK:

Feedback.png

9.9.2016: Results of the background questionnaire are in. This is the distribution of students according to major topic:

Screen Shot 2016-09-09 at 14.31.24.png

Here are the answers to the questions:

Screen Shot 2016-09-09 at 14.32.49.png

 


 

Teaching schedule

Weels 36-41, Wednesdays 10-12 and Fridays 12-14 in auditorium CK112. Two hours of exercise classes per week.

Exams

There is no exam. The course is passed by returning answers and solutions to weekly exercises. 


 

Course material

The course material will be uploaded to this page as the course progresses. The material includes lecture notes and Matlab programs.

Uuzi.gifLecture 12 (October 19, 2016)

Experiments with the 2D wavelet transform. Especially: compression of images.

MatlabLogoSmaller.pngwavetrans2Donce.mwavetrans2Donce_inv.mwavetrans2D.mwavetrans2D_inv.mWavelet_tr2D_test.m

Lecture 11 (October 14, 2016)

Explanation of the orthogonal basis of the space L^2([0,1]) provided by Haar wavelets.

Structure of the 2D wavelet transform.

Lecture 10 (October 12, 2016)

Finishing the implementation of the multi-scale wavelet transform. Here are the transform files:

MatlabLogoSmaller.png Wavelet_tr_onestep.mWavelet_tr_inv_onestep.mWavelet_tr.mWavelet_tr_inv.m.

We tested the transform with three different signals:

  • Synthetic signal with step discontinuities and added noise,
  • Acceleration signal recorded with a smartphone and Matlab Drive (lecture_acc.mat),
  • Sound signal recorded in the lecture (Wtrans.m4aWtrans.mat).

The signal files are available above. Here is the test routine. 

MatlabLogoSmaller.png Wavelet_tr_test.m

This picture shows the result of noise reduction using Haar wavelets:

noisereduction.png

Lecture 9 (October 7, 2016)

Programming the one-dimensional multi-scale wavelet transform. It was not quite completed as the multi-scale part of the inverse transform is still in construction.


Wednesday, October 5, 2016: no lecture due to sick leave! 

 

Lecture 8 (September 30, 2016)

Motivational introduction to wavelets and the amazing Wavelet Transform, both in 1D and 2D. The 2D transform looks like this:

China512.jpg China512tr.jpg

The wavelet transform is useful for removing noise from images as well as for compressing images. The JPEG2000 standard uses wavelets.

 

Lecture 7 (September 28, 2016)

Complex formulation of Fourier series. See FourierSeries_v1.pdf.

Filtering of signals by setting some of the coefficients to zero (low-pass, high-pass, band-pass filters).

Speeding up the computation by replacing silly for-loops by the legendary Fast Fourier Transform (FFT).

MatlabLogoSmaller.png Fourierseries_complex_test.mFourierseries_realsound_test.m (slow with for-loops), Fourierseries_realsoundFFT_test.m (fast with FFT)

The sample sound is available here: testsound.m4a

 

Lecture 6 (September 23, 2016)

Lecture given by Santeri Kaupinmäki. Topics covered:

Also showed examples of linear regression, markov chain, and webpage ranking in MATLAB.

MatlabLogoSmaller.pngDataFitExample1.m

TeleOperatorComputation.pdf

MatlabLogoSmaller.pngTeleOperatorComputation.m

MatlabLogoSmaller.pngFivePageInternet.m

 

Lecture 5 (September 21, 2016)

Lecture given by Santeri Kaupinmäki. Topics covered:

The file LeastSquaresStuff_v2.pdfcontains notes on the least squares method and SVD, as well as a proof of the SVD approach to the minimum norm solution in Theorem 4.1.

 

Lecture 4 (September 16, 2016)
Computational study of Fourier series approximation of functions. Quick conclusions: (1) for a continuous periodic function, a small number of Fourier modes is enough for approximation with high accuracy, and (2) approximating a discontinuous function using Fourier series needs a large number of Fourier modes to avoid "Gibbs phenomenon," or rapid oscillations near the discontinuity. 

MatlabLogoSmaller.png Fourierseries_test.m

Introduction to the source-filter theory of vowel sounds in human speech. Lecture notes (without videos): HumanVoice_v2_share.pdf
For the videos, see https://www.youtube.com/watch?v=Tw2pYY9g6QM 

During the lecture, we recorded the sound of the Electrolarynx, and analysed the signal using Fourier series. Here is the data file and Matlab routine for you to download:

MatlabLogoSmaller.png glottal_excitation.m4aFourierseries_glottal.m

Please try the following: approximate the excitation signal using N values 100, 200, 300, 400, 500 and 600. After each computation, listen to the result:

>> sound(sgnl,FS);sound(fseries,FS)


Lecture 3 (September 14, 2016)

Numerical integration using quadrature rules.

MatlabLogoSmaller.pngquadrature_tests.mgaussint.m (this gaussint.m routine is written by Addie Lambert)

Introduction to Fourier series. Lecture notes: FourierSeries_v1.pdf

 

Lecture 2 (September 9, 2016)

Opening and saving jpg image files in Matlab. Applying gamma correction to brighten or darken the image.
MatlabLogoSmaller.pngopen_image_in_Matlab.mgamma_correction.m 

lecture.jpg lecture.jpg

Removing unwanted objects from photographs using harmonic inpainting. Lecture notes: Inpainting_v1_share.pdf

MatlabLogoSmaller.pngPoisson_FD_solve.mFD_Laplace.m

Smurf.jpg Smurf.jpg

 

Lecture 1 (September 7, 2016)

Overview of the course
Background questionnaire: Taustatietolomake.pdf
Introduction to applications of matrix computations: CourseIntroduction.pdf; regarding the drum shapes, see
https://www.youtube.com/watch?v=SIOLRcU7FZo 
Case study: X-ray tomography and matrices. See TomographyIntro_v9_share.pdf and the following video:
https://www.youtube.com/watch?v=eWwD_EZuzBI 


 

Registration

Did you forget to register? What to do?

Exercises

You gain credits from this course only by completing the weekly exercises; there is no exam. Every exercise will have six questions worth six points each. To receive a grade for the exercises send a single pdf-file (no other formats are accepted!) written with your favourite text-editing program and containing your matlab codes (as text), results, images, comments and explanations to the e-mail address application.matrixcomputation@gmail.com by Monday 10 a.mafter the exercise week (for ex. by 10 a.m. on the 19th of September for Exercise 1). Please write the answers in English or Finnish.

Please write in the text of your e-mail which tasks are included in your solution (for ex. Hi! I am sending my solutions to tasks 1, 2, 3, and 5 in the 1st exercise round. Best wishes, Mary Math). Max number of pages is limited to 15. The assistants will not reply to the e-mails; if you have questions related to the exercises, send them as separate e-mails directly to the exercise assistants (usual helsinki.fi-addresses).

Uuzi.gif The grading will be decided at the end of the course, but you are guaranteed to pass the course if you get at least 40% of the available exercise points.

The exercise groups are for getting advice from an assistant in solving the exercise problems (participating the exercise class is not obligatory).

The exercise assistants are Santeri Kaupinmäki and Jonatan Lehtonen.

 

Uuzi.gif Results for all exercises (If your results are missing, please contact the exercise assistants by email.)

 

Exercise06.pdf (Some tips for exercise 1 were added on Monday 17.10.)

MatlabLogoSmaller.pngwavetrans2Donce.mwavetrans2Donce_inv.mwavetrans2D.mwavetrans2D_inv.m

 

Exercise05.pdf (Some tips for exercise 1 were added on Friday 07.10.)

Here is material for learning the concept of one-dimensional convolution: Convolution.pdf

MatlabLogoSmaller.png DCT_testing.mHaarTransform.mHaarTransformFilter.mHaarTransformMatrix.mTokyo256.matTokyoRow.m

 

Exercise04.pdf  

MatlabLogoSmaller.pngFFTdemo2D.m

BigBen.jpg BigBen.jpg

 

Exercise03.pdf

MatlabLogoSmaller.pngkissa.m,DataFitExample1.m

TeleOperatorComputation.pdf

Exercise02_v2.pdf

Ladybug.pngLadybug.png

Ladybug2.pngLadybug2.png

 

Exercise01.pdf
Note that the biological errors in Problem 6 have been corrected on September 9, 2016! Namely, flies have 5 eyes and rattlesnakes have two horns.
However, if you return an answer to the original form of the exercise, it's OK. 

Assignments

Exercise classes

Group

Day

Time

Room

Instructor

1.

Mon

12-14

C128

Santeri Kaupinmäki

2.

Wed

14-16

C128

Jonatan Lehtonen

3.

Thu

10-12

C128

Santeri Kaupinmäki

4.

Fri

14-16

C128

Jonatan Lehtonen

Course feedback

Course feedback can be given at any point during the course. Click here.