9-1 Wavelet transform wavelet decomposition and reconstruction (matlab program)

1. Brief description

      1. The general process of wavelet processing signal
1) Sampling: This is a preprocessing step. If the signal is continuous, it must be sampled at a rate that captures the necessary details of the original signal. Different applications determine different sampling rates. For example: the detail frequency of the original signal is 20kHz, according to the Nyquist sampling theorem, the sampling rate at this time should be at least twice the detail frequency, that is, 40kHz, in order to ensure that the detail frequency is not distorted.

2) Decomposition: After the signal is sampled, select a highest-level approximation coefficient fj ∈ v, so as to best approximate f ff. Afterwards, the signal is decomposed step by step through a multi-resolution decomposition algorithm. The output of this step is the wavelet coefficients (detail coefficients) of each level and the approximate coefficients of the lowest level (or a custom suitable level). This coefficient set is the object to be processed in the next step of signal processing.

3) Signal processing: The signal can be compressed by discarding non-significant coefficients, or the signal can be filtered or denoised in some way. The output of this step is a modified coefficient set (detail coefficient set), which can be stored or reconstructed immediately to restructure the processed signal. But in some cases, the original signal is no longer useful and can be discarded, such as: singularity detection.

4) Reconstruction: The coefficient set (detail coefficient set) modified by the signal processing step is applied to the multi-resolution reconstruction algorithm, and the reconstruction is carried out step by step. This step outputs the highest-level approximation coefficient.

2. Decomposition Algorithm
1. Decomposition iteration
First, determine the approximate space of f ff based on the sampling rate and what kind of multi-resolution analysis is performed, which can best reflect various information of f ff. Then choose , so as to best approximate f.

3. Reconstruction algorithm
1. Reconstruction iteration
Once the signal is decomposed, the signal can be processed by modifying some wj ′ w_{j'}w . If it is desired to filter out the noise in the signal, the part of wj ′ w_{j'}w in f ff corresponding to the unwanted frequency can be discarded, resulting in significantly reduced noise. If you want to perform data compression on the original signal, you can discard the wj ′ w_{j'}w component with a smaller amplitude, which will not significantly change the characteristics of the original signal, but will obtain a great data compression effect. After the wj ′ w_{j'}w component has been modified, a reconstruction algorithm is needed to reassemble the filtered or compressed signal. This process is signal reconstruction.

2. Multi-resolution reconstruction algorithm
The approximate coefficients and wavelet coefficients are reconstructed in the form of discrete filters.

This is almost the sum of two convolutions, the only difference is that the convolution index is k − l k-lk−l instead of k − 2 l k-2lk−2l, that is, the above formula is an odd number (l ‾ ( k − ( 2 l + 1 ) ) \overline{l}_{(k-(2l+1))} Missing convolution. Can be restored by simply multiplying odd terms by 0 with the upsampling operator.

Form a new sequence with 0s in all odd positions. Each of the original non-zero entries is given a new even index, which simply multiplies the original index.

The iterative steps are described by discrete filters (convolution operators).

2. Code


load woman; %Open and display the original image
imshow(X,map); %X contains original image information, map is a palette, this is an index image
%% perform single-layer decomposition on image X data information, wavelet is db1
nbcol =size(map,1);
[cA1,cH1,cV1,cD1]=dwt2(X,'db1');   
cod_X=wcodemat(X,nbcol);
cod_cA1=wcodemat(cA1,nbcol);
cod_cH1=wcodemat(cH1 ,nbcol);
cod_cV1=wcodemat(cV1,nbcol);
cod_cD1=wcodemat(cD1,nbcol);
%% image coding 4 kinds of detail coefficient
figure
subplot(221)
imshow(cod_cA1,map)
title('approximate detail coefficient')
subplot (222)
imshow(cod_cH1,map)
title('horizontal detail coefficient')
subplot(223)
imshow(cod_cV1,map)
title('vertical detail coefficient')
subplot(224)
imshow(cod_cD1,map)
title('diagonal detail factor')
Y=idwt2(cA1,cH1,cV1,cD1,'db1','nbcol');
%% Perform single-layer reconstruction on the decomposed detail coefficients, wavelet is db1
figure;
imshow(Y,map);
title('reconstruction constructed image')
 

3. Running results

 

 

Guess you like

Origin blog.csdn.net/m0_57943157/article/details/131481610