# An ECG Signal De-Noising Approach Based on Wavelet Energy and Sub-Band Smoothing Filter
## 3 The Proposed Approach
### De-Noising Based on Wavelet Energy
#### 3.2.3 Selecting the Required De-Noising Points  
According to the coefficient energy of each layer calculated above, the wavelet energy curve can be obtained, and then the position of the maximum and minimum points of the energy curve can be calculated, that is the decomposition level where they are.  
According to the positions of the maximum and minimum points of the calculated wavelet energy curve, the variation points of the number of detail layers that need to be de-noised can be judged. The previous level of the variation points is considered to be de-noised, while the level of the variation point and the subsequent level are not considered to de-noise.  
In practical processing, we only locate the initial several detail coefficients that required processing, without considering the low-frequency components behind.Therefore the first position of the energy change point is particularly important. Selecting the location points required de-noising is divided into the following cases:  
1. When the minimum and maximum values of the energy curve exist simultaneously: 1. When the locationof the first maximum point is less than the location of the first minimum point and the location of the first maximum point is less than the median value of the location of the first maximum point and the location of the first minimum point (If the median is not an integer, round to zero). When the position of the first maximum point is greater than the tolerance value, the location point is calculated as: \[cbg\_locs=\left\lceil\frac{max\_locs(1)}{2}\right\rceil\] (3)When the position of the first maximum point is less than the tolerance value, the location point is calculated as \[chg\_locs=max\_locs(1)\] (4) where \(chg\_locs\) is the location point to be determined and \(max\_locs(1)\) is the location of the first maximum point.
2. When the location of the first maximum point is greater than the location of the first minimum point, and the position of the first minimum point is less than the median value of the position of the first maximum point and the position of the first minimum point. When the position of the first minimum point is greater than the tolerance value, the location point is calculated as: \[chg\_locs=\left\lceil\frac{min\_locs(1)}{2}\right\rceil\] (5) When the position of the first minimum point is less than the tolerance value, the location point is calculated as: \[chg\_locs=min\_locs(1)\] (6) where \(min\_locs(1)\) is the location of the first minimum point.
3. When the minimum point of the energy curve exists and the maximum point does not exist. 1. When the position of the first minimum point is greater than the tolerance value, the location point is calculated as: \[chg\_locs=min\_locs(1)\] (8)
4. When the maximum point of the energy curve exists and the minimum point does not exist. 1. when the position of the first maximum point is greater than the tolerance value, the location point is calculated as: \[chg\_locs=\left\lceil\frac{max\_locs(1)}{2}\right\rceil\] (9)
5. When the position of the first maximum point is less than the tolerance value, the location point is calculated as: \[chg\_locs=max\_locs(1)\] (10)
6. When the minimum and maximum of the energy curve do not exist, we consider that the default noise only appears in the first and second high frequency detail components, and the locating point is set as follows: \[chg\_locs=3\] (11)