Input: 2-D data, d1 Output: new 2-D data, d2 | |
---|---|
1 | set x, n, t, j = 0; //set wavelet function, decomposition scale, threshold value and pointer j. |
2 | (L [j], h1[j], h2[j], h3[j]) = wavedec2(x, d1) //decompose data. |
3 | (h1[j], h2[j], h3[j]) = threshold(t, h1[j], h2[j], h3[j]); //quantize high frequency coefficients. |
4 | for→j = 0 to n-1: //the process of decomposition. |
5 | (L [j + 1], h1[j + 1], h2[j + 1], h3[j + 1]) = wavedec2(x, L [j]); |
6 | (h1[j + 1], h2[j + 1], h3[j + 1]) = threshold(h, h1[j + 1], h2[j + 1], h3[j + 1]); j = j + 1; |
7 | for→i = n-1 to 0: //the process of reconstruction. |
8 | L [i-1] = waverec2(x, L [i], h1[i], h2[i], h3[i]); i = i-1; |
9 | d2 = waverec2(x, L [i], h1[i], h2[i], h3[i]); //reconstruct data. |