## 3 Results and Discussion  
### Wavelet Transform and Maximum Decomposition Layer  
In this study, the db4 wavelet-generating function was used in MATLAB R2016a (MathWorks, Natick, MA, USA) to decompose the eight layers wavelet of the original spectrum. The reconstructed signals of layers 1 to 8 are defined as L1 to L8(L1-L8), respectively. L0 indicates the origin spectrum.  
The significant moisture absorption peaks around 1800 and 2400 nm, and weak peaks around 1200 and 2600 nm. There are three distinct areas of noise in L0, which were more obvious around 1600 (defined as noise1), 2200 (defined as noise2), and 2400 nm (defined as noise3) (Figure 3). The small burr phenomenon occurred in noise1, noise2, and noise3. Figure 4 depicts the noise spectral image around 1600 nm, the scope of which is disordered in L0. When decomposition was applied, the high-frequency signal was further removed, and the noise weakened. As shown in Figure 4, when the original spectrum was decomposed into the fifth sub-layer, the spectral curves became smoother. The spectral details were gradually removed and the spectral curve gradually tended to be smooth, so some absorption peaks representing the moisture characteristics of tea leaves disappeared. When the spectrum was decomposed into seven layers, the spectral curve was almost a straight line, but in this case, the spectral data considerably deviated from the original data and large amounts of effective information were lost. The loss of effective information was more serious at L8. Therefore, L7 and L8 completely deviated from L0 to L6.  
Figure 3: The average spectrum of L0. Note: L0 refers to the original spectrum, which has three distinct areas of noise around 1600, 2200, and 2400 nm here (defined as noise1, noise2, and noise3, respectively).  
To further determine the appropriate maximum decomposition layer, the correlation coefficient method was used to measure the correlation between the spectral absorption and moisture characteristics of each wavelength point in the spectral matrix of L1-L8. By comparing the measured value (defined as \(R\)) with the threshold value, the preferable number of wavelength points was determined. In this study, the threshold value was set to 0.8. According to Figure 5, 259 points in L1 and L2 exceeded the threshold, 257 points in L3 and L4, 260 points in L5, 262 in L6, 175 in, and 199 in L8. Figure 5 shows that the numbers of points in L1-L6 passing threshold were similar, stable at \(260\pm 3\). About 30% less of the points in L7 and L8 passed the threshold than in L1-L6, gradually weakening the moisture characteristics of the spectrum. To ensure that enough moisture characteristics are preserved after the wavelet transform, the sixth decomposition layer was taken as the largest decomposition layer and the reconstruction spectrum of L1-L6 lost as few spectral details as possible and noise was relatively thoroughly removed. In the following, we used L1-L6 to replace the original spectrum.  
Figure 4: Zoom in on a noise spectral image around 1700 nm. Note: L0 refers to the original spectrum, L1 refers to the reconstructed spectral average after the layer wavelet transforms, L2 to L8 are analogous to L1. L0–L6 have similar trends under L7 and L8. L7 and L8 correspond to solid red and solid blue, respectively.  
Figure 5: The number of wavelength points of L1 to L8 passing through the threshold, which was set to 0.8.