Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets...

26
Fourier and Wavelets Transforms Cintia Bertacchi Uvo

Transcript of Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets...

Page 1: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Fourier and Wavelets TransformsCintia Bertacchi Uvo

Page 2: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

http://www.mathworks.com/access/helpdesk/help/pdf_doc/wavelet/wavelet_ug.pdfAmara Graps (1995)

Fourier Analysis

Frequency analysis Linear operator

Idea: Transforms time-based signals to frequency-based signals.

Page 3: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Any periodic function can be decomposed to a sum of sine and cosine waves, i.e.: any periodic function f(x) can be represented by

cos sin

where:

12 ;

1cos ;

1sin

Page 4: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Basis functions: sines and cosines

Draw back: transforming to the frequency domain, time information is lost. We don’t know when an event happened.

Page 5: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Discrete Fourier Transform: Estimate the Fourier Transform of function from a finite number of its sample points.

Windowed Fourier Transform: Represents non periodic signals. . Truncates sines and cosines to fit a window of particular width. . Cuts the signal into sections and each section is analysed separately.

Page 6: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Example:Windowed Fourier Transform where the window is a square wave

. A single window width is used

. Sines and cosines are truncated to fit to the width of the window.

. Same resolution al all locationsof the time-frequency plane.

Page 7: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Wavelets Transform. Space and frequency analysis (scale and time). Linear operator

A windowing technique with variable-sized regions. . Long time intervals where more precise low-

frequency information is needed.. Shorter regions where high-frequency information is

of interest.

Page 8: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Basis functions: infinite number of wavelets (more complicated basis functions)

Variation in time and frequency (time and scale) so that the previous example becomes:

Page 9: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Definition: A wavelet is a waveform of effectively limited duration that has an average value of zero.

Scale aspect: The signal presents a very quick local variation.

Time aspect: Rupture and edges detection.Study of short-time phenomena as transient processes.

Page 10: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Page 11: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

There are infinite sets of Wavelets Transforms.

Different wavelet families: Different families provide different relationships between how compact the basis function are localized in space and how smooth they are.

Page 12: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Vanishing Moments: if the average value of xkψ (x) is zero (where ψ (x) is the wavelet function), for k = 0, 1, …, n then the wavelet has n + 1 vanishing moments and polynomials of degree n are suppressed by this wavelet.

Page 13: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Use:Detect Discontinuities and Breakdown Points

Small discontinuity in the function

Page 14: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

. Remove noise from time series. Detect Long-Term Evolution. Identify Pure Frequencies. Suppress signals

Page 15: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

The Continuous Wavelet Transform (CWT)

Definition: the sum over all time of the signal multiplied by scaled, shifted versions of the wavelet function :

, Ψ , ,

where: f(t) is the signal,Ψ , , is the wavelet, andC(scale, position) are the wavelet coefficients

Page 16: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Scale

Page 17: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Position

Page 18: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Steps to a Continuous Wavelet Transform

1. Take a wavelet and compare it to a section at the start of the original signal.

2. Calculate C, i.e., how closely correlated the wavelet is with this section of the signal.

, Ψ , ,

Page 19: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

3. Shift the wavelet to the right and repeat steps 1 and 2 until you’ve covered the whole signal.

4. Scale (stretch) the wavelet and repeat steps 1 through 3.

5. Repeat steps 1 through 4 for all scales.

Page 20: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Plot the time-scale view of the signal x-axis is the position along the signal (time), y-axis is the scale, and the colour at each x-y point represents the magnitude of C.

Example: “From above”

Page 21: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

“From the side (3D)”

Page 22: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Low scale => Compressed wavelet => Rapidly changing details => High frequency.

High scale => Stretched wavelet => Slowly changing, coarse features => Low frequency.

Page 23: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Decomposition and Reconstruction

Approximations (A): low-frequency components (high-scale)Details (D): high-frequency components (low scale)

Decomposition – filtering and downsampling

On Matlab:[cA,cD] = dwt(s,’db2’);

Page 24: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Reconstruction – Inverse Discrete Wavelet TransformFiltering and upsampling

Reconstruct the signal from the wavelet coefficients.

On Matlab:ss = idwt(ca1,cd1,'db2');

Page 25: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Approximationsor Details can be reconstructed separately from their coefficient vectors.

Page 26: Fourier and Wavelets Transforms - LTH · 1- Apply Fourier transform 2- Decompose using wavelets Compare results. Created Date: 5/4/2012 9:10:50 AM ...

Lund University / LTH / Dept. Water Res. Eng./ Cintia Bertacchi Uvo

Report:

Choose a data series

1- Apply Fourier transform2- Decompose using waveletsCompare results