Multilevel partial reconstruction is the process to reconstruct approximations and details of a signal from its wavelet decomposed coefficients
The series of 1D multilevel discrete wavelet transform methods includes 3 parts:
Part I: Decomposition Method
Part II: Reconstruction Method
Part III: Partial Reconstruction Methods
The last two parts demonstrate the Discrete wavelet decomposition methods to decompose a 1D signal into multilevel approximation and detail coefficients, and the reconstruction methods to reconstruct the signal from those coefficients. In this article, we will continue to another import part of Discrete wavelet transform, i.e. how to reconstruct the approximation and details of a 1D signal from the approximation and detail coefficients, respectively. This process is also called partial reconstruction.
I suggest that you had better read the process of partial reconstruction before moving on to read this article if you are not familiar with the procedure of partial reconstruction. Otherwise, the methods introduced in this article might be hard to understand.
import pywt
S = list(range(1,101))
data_len = len(S)
w = pywt.Wavelet('sym2')
filter_len = w.dec_len
max_l = pywt.dwt_max_level(data_len, filter_len)
print(max_l)
coeffs = pywt.wavedec(S, 'sym2','periodic',level=max_l)
5
The signal is decomposed into 5 levels, i.e. the maximum decomposition level for this signal. Next, we unpack the coefficients into the approximation coefficient at the fifth level (cA5) and detail coefficients from the level 1 to level 5 (cD5, cD4, cD3, cD2, cD1).
(cA5,cD5,cD4,cD3,cD2,cD1) = coeffs
2. Multilevel Signal Partial Reconstruction
PyWavelets library has not provide direct partial reconstruction method for 1D multilevel Discrete wavelet transform (DWT). However, based on the concepts and process of partial reconstruction, we can easily do the partial reconstruction.
2.1 Create zero arrays
First, we need to create zero arrays for each of the coefficients. There are different methods, but I introduce the following two straight forward ways.
Method 1: Replace the non-zero values in the coefficients to zero
We can use NumPy where()
method to easily replace the non-zero values in the coefficients to zero. I use cA05 to denote the zero array of the approximation coefficient at level 5 (cA5), in which all the values of cA5 are set to zero. Similarly, for example, cD05 means that all the values of cD5 are changed to zero.
import numpy as np
cA05 = np.where(cA5 != 0, 0, cA5)
cD05 = np.where(cD5 != 0, 0, cD5)
cD04 = np.where(cD4 != 0, 0, cD4)
cD03 = np.where(cD3 != 0, 0, cD3)
cD02 = np.where(cD2 != 0, 0, cD2)
cD01 = np.where(cD1 != 0, 0, cD1)
Let’s print the results, then you will be more clear about what we are doing.
print(cA05)
print(cD05)
print(cD04)
print(cD03)
print(cD02)
print(cD01)
[0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
Method 2: Directly create zero arrays
The second direct method is to create zero arrays that have the same lengths with the coefficients.
cA05 = np.zeros(len(cA5))
cD05 = np.zeros(len(cD5))
cD04 = np.zeros(len(cD4))
cD03 = np.zeros(len(cD3))
cD02 = np.zeros(len(cD2))
cD01 = np.zeros(len(cD1))
print(cA05)
print(cD05)
print(cD04)
print(cD03)
print(cD02)
print(cD01)
[0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
2.2 Reconstruct approximation and details
Then, let’s reconstruct the approximation and details of the single. In this previous article, it has clearly explained the concepts and process of of Discrete Wavelet Partial Reconstruction. So I just explain the process generally. For example, to reconstruct approximation A5, we just use the cA5, and change other coefficients to their zero arrays. Similarly, we just keep cD5 and change all other coefficients to their zero arrays to reconstruct D5, and so on.
A5 = pywt.waverec((cA5,cD05,cD04,cD03,cD02,cD01),'sym2','periodic')
D5 = pywt.waverec((cA05,cD5,cD04,cD03,cD02,cD01),'sym2','periodic')
D4 = pywt.waverec((cA05,cD05,cD4,cD03,cD02,cD01),'sym2','periodic')
D3 = pywt.waverec((cA05,cD05,cD04,cD3,cD02,cD01),'sym2','periodic')
D2 = pywt.waverec((cA05,cD05,cD04,cD03,cD2,cD01),'sym2','periodic')
D1 = pywt.waverec((cA05,cD05,cD04,cD03,cD02,cD1),'sym2','periodic')
print('Approximation at the level 5: \n',A5)
print('Detail at the level 5: \n',D5)
print('Detail at the level 4: \n',D4)
print('Detail at the level 3: \n',D3)
print('Detail at the level 2: \n',D2)
print('Detail at the level 1: \n',D1)
Approximation at the level 5: [62.89669784 62.0476011 57.94949763 54.72196288 52.36499687 49.77476267 48.0550972 46.10216354 43.91596169 41.79226387 40.53913477 39.05273749 37.33307201 35.67591056 33.78548093 31.95755531 30.19213372 28.40996422 27.49836346 26.3534945 24.97535736 23.65972424 22.11082294 20.62442565 19.20053239 17.75989123 16.08598188 14.47457655 12.92567524 11.36002603 9.85688084 8.33698775 6.80034676 5.26819336 15.80367328 23.1056406 27.17409531 32.10896712 33.81032632 36.37810261 39.81229599 43.01433362 42.98285863 43.81780074 45.51915994 46.98836338 49.32398392 51.42744869 53.2987577 55.23227266 53.93227501 53.49869446 53.931531 54.13221178 55.19930965 56.03425175 56.6370381 57.3020304 58.83343979 60.13269342 61.19979129 62.32909511 63.22624316 64.18559717 65.20715712 66.21204904 67.17092065 68.14212336 69.12565718 70.10588688 71.0984477 72.0877044 73.073657 74.06049492 75.05966396 76.05552888 77.0480897 78.04153584 79.03167788 80.02270525 81.01461796 82.00629344 83.01030003 84.0110025 85.00840087 86.00668457 87.00166416 87.99752908 88.99427934 89.99079238 90.9840013 91.97809556 92.97307515 93.96781751 94.96344521 95.95883569 96.95398894 97.94920575 96.35199172 95.44941744] Detail at the level 5: [-6.93441246e+00 -8.16687484e+00 -1.03929296e+01 -1.23527520e+01 -1.40463422e+01 -1.58112691e+01 -1.73099638e+01 -1.88799951e+01 -2.05213632e+01 -2.21436167e+01 -2.34996379e+01 -2.49269958e+01 -2.64256904e+01 -2.79052705e+01 -2.94561872e+01 -3.09879894e+01 -3.25006769e+01 -3.40184861e+01 -2.14341196e+01 -1.26284197e+01 -7.60138643e+00 -1.56186247e+00 6.98994876e-01 3.97234289e+00 8.25818157e+00 1.22727242e+01 1.25086002e+01 1.37569669e+01 1.60178242e+01 1.80073855e+01 2.10094375e+01 2.37401934e+01 2.61996532e+01 2.87318066e+01 1.91963267e+01 1.28943594e+01 9.82590469e+00 5.89103288e+00 5.18967368e+00 3.62189739e+00 1.18770401e+00 -1.01433362e+00 1.71413662e-02 1.82199257e-01 -5.19159943e-01 -9.88363384e-01 -2.32398392e+00 -3.42744869e+00 -4.29875770e+00 -5.23227266e+00 -2.93227501e+00 -1.49869446e+00 -9.31530998e-01 -1.32211776e-01 -1.99309645e-01 -3.42517543e-02 3.62961896e-01 6.97969599e-01 1.66560210e-01 -1.32693419e-01 -1.99791288e-01 -3.29095105e-01 -2.26243163e-01 -1.85597168e-01 -2.07157123e-01 -2.12049043e-01 -1.25583123e-01 -6.35964617e-02 -2.60890606e-02 1.79775383e-02 3.75648775e-02 6.37114146e-02 9.64171496e-02 1.27365353e-01 1.33834296e-01 1.46862437e-01 1.66449777e-01 1.84279584e-01 2.08668589e-01 2.31300063e-01 2.52174005e-01 2.73518876e-01 -1.01915708e-01 -3.71033556e-01 -5.33834671e-01 -7.25123268e-01 -8.10095132e-01 -9.23554478e-01 -1.06550131e+00 -1.19981494e+00 -1.22781184e+00 -1.28429622e+00 -1.36926808e+00 -1.44660675e+00 -1.55243289e+00 -1.65062584e+00 -1.74118560e+00 -1.83379066e+00 -9.51311223e-01 -3.30104891e-01] Detail at the level 4: [-9.89161911e+00 -1.31945042e+01 -1.35193520e+01 -1.46421625e+01 -1.65629357e+01 -1.82698954e+01 -2.07748178e+01 -2.30659268e+01 -2.51432223e+01 -2.72778089e+01 -1.30104432e+01 -3.13796732e+00 2.33961863e+00 8.99481178e+00 1.12551150e+01 1.46930255e+01 1.93085432e+01 2.36085219e+01 1.29357562e+01 6.27492522e+00 3.62602907e+00 -9.78617719e-02 1.90182187e-01 -5.96768543e-01 -2.45871396e+00 -4.03261542e+00 -1.59458209e+00 -2.31543438e-01 5.65005204e-02 6.32588438e-01 1.33681667e-01 -7.71811461e-02 7.78827136e-12 9.18846617e-12 3.45051440e-12 -3.74776765e-13 -2.28740731e-12 -4.71253372e-12 -5.22499952e-12 -6.24996118e-12 -7.78741872e-12 -9.18755339e-12 -3.44894602e-12 3.76841190e-13 2.28980823e-12 4.71531389e-12 5.22799938e-12 6.25322349e-12 7.79098622e-12 9.19141464e-12 3.44951667e-12 -3.78600718e-13 -2.29293751e-12 -4.72007027e-12 -5.23342244e-12 -6.25957057e-12 -7.79851467e-12 -9.20005550e-12 -3.45593353e-12 3.73513861e-13 2.28828668e-12 4.71609500e-12 5.22922874e-12 6.25539799e-12 7.79460275e-12 9.19634006e-12 -4.53375252e-02 -7.85268972e-02 -9.95681159e-02 -1.23864422e-01 -1.36012576e-01 -1.51415817e-01 -1.70074146e-01 -1.87860277e-01 -1.93498254e-01 -2.02391320e-01 -2.14539473e-01 -2.25815428e-01 -2.40346471e-01 -2.54005316e-01 -2.66791962e-01 -2.79812314e-01 9.93631022e-02 3.73449979e-01 5.42448317e-01 7.39605044e-01 8.31673231e-01 9.51899808e-01 1.10028477e+00 1.24112472e+00 5.51475728e-01 8.43555756e-02 -1.60235736e-01 -4.64453470e-01 -5.46142363e-01 -6.87457680e-01 -8.88399420e-01 -1.07336431e+00 -8.35981000e-01 -7.11765550e-01] Detail at the level 3: [-1.50252784e+01 -2.71732435e+01 -1.83389811e+01 -1.51268896e+01 -1.75369690e+01 -1.84405922e+01 -4.81877295e+00 4.91096570e+00 1.07486238e+01 1.76291617e+01 6.97094627e+00 1.01222564e+00 -2.47000198e-01 -2.76545187e+00 -5.84408744e-01 3.37408546e-01 2.93709395e-12 4.33680546e-12 5.11896201e-13 -1.91308014e-12 -2.93812356e-12 -4.33827788e-12 -5.12415212e-13 1.91314043e-12 2.93838903e-12 4.33884878e-12 5.12461648e-13 -1.91339608e-12 -2.93872441e-12 -4.33932347e-12 -5.12665609e-13 1.91335298e-12 2.93873230e-12 4.33941178e-12 5.12764703e-13 -1.91322445e-12 -2.93855567e-12 -4.33919205e-12 -5.12442985e-13 1.91363237e-12 2.93903402e-12 4.33974505e-12 5.12357812e-13 -1.91416472e-12 -2.93982253e-12 -4.34084092e-12 -5.12980213e-13 1.91380656e-12 2.93951941e-12 4.34064889e-12 5.12770477e-13 -1.91399949e-12 -2.93966102e-12 -4.34074843e-12 -5.13570922e-13 1.91269722e-12 2.93805601e-12 4.33878732e-12 5.13758453e-13 -1.91103219e-12 -2.93558462e-12 -4.33532975e-12 -5.11969756e-13 1.91186344e-12 2.93616983e-12 4.33547830e-12 5.12017739e-13 -1.91200608e-12 -2.93659315e-12 -4.33615817e-12 -5.11703720e-13 1.91297893e-12 2.93788979e-12 4.33786836e-12 5.12741742e-13 -1.91232216e-12 -2.93732334e-12 -4.33747020e-12 -5.09539962e-13 1.91753124e-12 2.94374341e-12 4.34531463e-12 -7.74741993e-03 -1.34189249e-02 -1.70145150e-02 -2.11663449e-02 -2.32422598e-02 -2.58744144e-02 -2.90628088e-02 -3.21021592e-02 6.92334809e-01 1.22184509e+00 1.55642867e+00 1.94324270e+00 2.01117133e+00 2.16454504e+00 2.40336384e+00 2.61928769e+00 -2.37692049e+00 -5.97654210e+00] Detail at the level 2: [-4.70070292e-01 -2.85882962e+01 -1.26982350e+01 -8.60015877e+00 7.81250000e-01 8.74699408e+00 1.84845735e+00 -1.06720735e+00 5.12747293e-13 1.91352312e-12 -5.13114557e-13 -1.91419988e-12 5.12025987e-13 1.91272691e-12 -5.10816698e-13 -1.90965707e-12 5.12635542e-13 1.91105866e-12 -5.13842838e-13 -1.91428759e-12 5.12371401e-13 1.91356104e-12 -5.11533824e-13 -1.91137884e-12 5.12676179e-13 1.91212027e-12 -5.13334341e-13 -1.91391044e-12 5.12594905e-13 1.91363687e-12 -5.12432357e-13 -1.91303023e-12 5.12269809e-13 1.91242359e-12 -5.11774194e-13 -1.91124006e-12 5.12676179e-13 1.91212027e-12 -5.13334341e-13 -1.91391044e-12 5.12594905e-13 1.91363687e-12 -5.11599689e-13 -1.91158801e-12 5.14098473e-13 1.91469848e-12 -5.15987702e-13 -1.92008384e-12 5.14382932e-13 1.92030987e-12 -5.14109362e-13 -1.91951094e-12 5.14301658e-13 1.91939992e-12 -5.14634725e-13 -1.91997681e-12 5.13570192e-13 1.91848996e-12 -5.13193571e-13 -1.91686235e-12 5.12351083e-13 1.91454682e-12 -5.10812713e-13 -1.91058190e-12 5.13001275e-13 1.91212027e-12 -5.13096355e-13 -1.91358534e-12 5.15520767e-13 1.91848996e-12 -5.19204145e-13 -1.92779562e-12 5.13570192e-13 1.92334306e-12 -5.09339674e-13 -1.91243953e-12 5.15358220e-13 1.91667005e-12 -5.19477715e-13 -1.92738128e-12 5.13814014e-13 1.92364638e-12 -5.11633423e-13 -1.91661853e-12 5.11782165e-13 1.91303023e-12 -5.10303292e-13 -1.90884326e-12 5.11619617e-13 1.90878377e-12 -5.11005009e-13 -1.90804433e-12 5.13651466e-13 1.91212027e-12 1.23958719e-01 2.14702799e-01 2.72232241e-01 3.38661518e-01 2.23690344e+00 3.64431265e+00] Detail at the level 1: [-2.95753175e+01 1.70753175e+01 -7.00073310e-13 7.00318637e-13 -7.00783066e-13 7.00429795e-13 -6.99760443e-13 7.00270723e-13 -7.01068350e-13 7.00793583e-13 -7.00332042e-13 7.00567556e-13 -7.00975478e-13 7.00739964e-13 -7.00217103e-13 7.00766635e-13 -7.01574780e-13 7.01417771e-13 -7.01375700e-13 7.00904672e-13 -7.00146298e-13 7.00460316e-13 -7.00774335e-13 7.01088353e-13 -7.01459841e-13 7.01616850e-13 -7.02061207e-13 7.01433170e-13 -7.00460316e-13 7.00774335e-13 -7.01145823e-13 7.01302832e-13 -7.01172494e-13 7.02114550e-13 -7.03861176e-13 7.02605103e-13 -7.00199641e-13 7.02083752e-13 -7.05691944e-13 7.02865778e-13 -6.98775285e-13 6.99403322e-13 -7.00261237e-13 7.00261237e-13 -6.99801482e-13 7.01057556e-13 -7.03003262e-13 7.02375225e-13 -7.01172494e-13 7.02114550e-13 -7.03631299e-13 7.03003262e-13 -7.01685593e-13 7.02941667e-13 -7.05577005e-13 7.03064857e-13 -6.99403322e-13 7.00031359e-13 -7.01004212e-13 7.00690194e-13 -7.00031359e-13 7.00659396e-13 -7.00942617e-13 7.02512709e-13 -7.04887373e-13 7.04259336e-13 -7.03631299e-13 7.03003262e-13 -7.01225838e-13 7.03737985e-13 -7.08089153e-13 7.05577005e-13 -7.02375225e-13 7.01747188e-13 -7.00199641e-13 7.02083752e-13 -7.03508108e-13 7.06648293e-13 -7.13006763e-13 7.07354430e-13 -6.99863077e-13 6.99235040e-13 -6.98607003e-13 6.97978966e-13 -6.95971664e-13 6.99111849e-13 -7.03861176e-13 7.02605103e-13 -7.01119151e-13 7.00491114e-13 -6.99403322e-13 7.00031359e-13 -7.00199641e-13 7.02083752e-13 -7.04887373e-13 7.04259336e-13 -7.03171544e-13 7.03799581e-13 4.57531755e+00 7.92468245e+00]
We can get approximations at other levels based on the concepts of Discrete wavelet reconstruction in the previous article.
A4 = A5 + D5
A3 = A4 + D4
A2 = A3 + D3
A1 = A2 + D2
print('Approximation at the level 4:\n', A4)
print('Approximation at the level 3:\n', A3)
print('Approximation at the level 2:\n', A2)
print('Approximation at the level 1:\n', A1)
Approximation at the level 4: [55.96228538 53.88072626 47.55656807 42.36921087 38.31865467 33.96349356 30.74513345 27.22216842 23.39459849 19.64864719 17.03949689 14.12574168 10.90738157 7.77064009 4.3292937 0.96956596 -2.30854315 -5.60852191 6.06424384 13.72507478 17.37397093 22.09786177 22.80981781 24.59676854 27.45871396 30.03261542 28.59458209 28.23154344 28.94349948 29.36741156 30.86631833 32.07718115 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67.04533753 68.0785269 69.09956812 70.12386442 71.13601258 72.15141582 73.17007415 74.18786028 75.19349825 76.20239132 77.21453947 78.22581543 79.24034647 80.25400532 81.26679196 82.27981231 82.90838432 83.63996895 84.4745662 85.2815613 86.19156903 87.07397461 87.92877803 88.79097744 89.75618946 90.69379934 91.60380707 92.52121077 93.41101232 94.30820984 95.21280334 96.1154151 95.4006805 95.11931255] Approximation at the level 3: [46.07066627 40.6862221 34.03721605 27.72704834 21.75571895 15.69359811 9.97031561 4.15624164 -1.74862378 -7.6291617 4.02905373 10.98777436 13.2470002 16.76545187 15.58440874 15.66259145 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83.00774742 84.01341892 85.01701452 86.02116634 87.02324226 88.02587441 89.02906281 90.03210216 90.30766519 90.77815491 91.44357133 92.0567573 92.86486995 93.62075216 94.32440392 95.04205079 94.5646995 94.407547 ] Approximation at the level 2: [31.04538784 13.51297863 15.69823499 12.60015877 4.21875 -2.74699408 5.15154265 9.06720735 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 94.87604128 95.7852972 96.72776776 97.66133848 92.18777901 88.4310049 ] Approximation at the level 1: [ 30.57531755 -15.07531755 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 94.42468245 92.07531755]
It also discusses that we can reconstruct the signal from its approximation and details in the article of partial reconstruction concepts and process.
S_r = A5 + D5 + D4 + D3 + D2 + D1
print(S_r)
[ 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100.]
print('Mean absolute error: ',sum(abs(S-S_r))/len(S))
print('Max. AE: ',max(abs(S-S_r)))
Mean absolute error: 2.0467068040375124e-11 Max. AE: 1.0169287634198554e-10
This article generally displays methods to do multilevel partial reconstruction in 1D Discrete wavelet transform. It solves two issues, (1) how to reconstruct the approximation and details of a 1D signal from their coefficients at different levels, and (2) how to reconstruct a signal from its approximation and details at different decomposition levels. This article focuses on using a simple example to demonstrate the methods, so it has not visualized the approximation and details of the signal due to simplicity of the signal. In the future, we will use these methods for a real-world signal, and then approximation and details of the signal will be analyzed and visualized in details.