I have a simple understanding of wavelet transformation. However, wavelet transformation can be understood in combination with Fourier transformation.
Fourier transformation is to use a series of positive Cosine Functions with different frequencies to decompose the original functions. After transformation, the original functions are obtained with coefficients at different frequencies of the positive cosine.
Wavelet transform uses a series of wavelet at different scales to decompose the original functions. After the transformation, the coefficients of the original functions under different scales of wavelet are obtained.
Different wavelet are decomposed by translation and scale transformation. Translation is used to obtain the Time Characteristics of the original function, and scale transformation is used to obtain the frequency characteristics of the original function.
Wavelet Transformation steps:
1. Compare the starting part of wavelet W (T) with the original function f (t) and calculate the coefficient C. The coefficient C indicates the similarity between this function and wavelet.
2. Shift the wavelet to the right K Unit to obtain the wavelet W (t-k), repeating 1. Repeat this section to know that function f is over.
3. Extended wavelet W (T) to obtain the wavelet W (T/2), repeat Step 1 and 2.
4. Constantly expanding wavelet, repeating 1, 2, 3.
The Haar wavelet I use here, the scaling function is [1], and the wavelet function is [1-1]. Is the simplest wavelet.
Let's take a look at the effect of decomposition. This time I chose a big image:
A fully decomposed wavelet packet with a scale of 2:
The following is the Matlab code:
Main. m
Clear all; close all; clc; IMG = double (imread ('lena (2).jpg '); [m n] = size (IMG ); [ll lh hl hh] = haar_dwt2d (IMG); % of course dwt2 (IMG, 'haar ') is the same, I just want to understand the details IMG = [ll LH; hl HH]; % One Layer decomposition imgn = zeros (m, n); for I = 0: M/2: M/2 for J = 0: n/2: n/2 [ll lh hl hh] = haar_dwt2d (IMG (I + 1: I + M/2, J + 1: J + n/2 )); % re-decompose imgn (I + 1: I + M/2, J + 1: J + n/2) = [ll LH; hl HH]; endendimshow (imgn)
Haar_dwt2d.m
Function [ll lh hl hh] = haar_dwt2d (IMG) [m n] = size (IMG); for I = 1: M % split each line [l h] = haar_dwt (IMG (I, :)); IMG (I, :) = [l h]; end for j = 1: N % decomposition of each column [l h] = haar_dwt (IMG (:, j); IMG (:, j) = [l h]; end % should not be added to mat2gray for decomposition, but LL = mat2gray (IMG (1: M/2, 1: n/2) is added to ensure a good display effect )); % columns are low frequency LH = mat2gray (IMG (1: M/2, n/2 + 1: N )); % row low frequency column high frequency HL = mat2gray (IMG (M/2 + 1: M, 1: n/2 )); % row high frequency column low frequency HH = mat2gray (IMG (M/2 + 1: m, n/2 + 1: N); % columns are high frequency end
Haar_dwt.m
Function [l h] = haar_dwt (f) % obviously, I didn't perform boundary processing. The best picture is 2 ^ N * 2 ^ N Type N = length (f ); N = n/2; L = zeros (1, N); % low frequency component H = zeros (1, N); % high frequency component for I = 1: n l (I) = (F (2 * i-1) + F (2 * I)/SQRT (2); H (I) = (F (2 * i-1) -F (2 * I)/SQRT (2); end
Refer:
Http://amath.colorado.edu/courses/5720/2000Spr/Labs/Haar/haar.html
Http://www.cs.ucf.edu /~ Mali/Haar/
Http://wenku.baidu.com/view/7839b821aaea998fcc220eed.html