View full-text article in PMC Sensors (Basel). 2023 Jun 23;23(13):5850. doi: 10.3390/s23135850 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 2 CalcFeatures_cwt function 1:procedure CalcFeatures_cwt(x,waveletname,level) 2: feature_levels←emptylist 3: for ii∈{0,1,…,level−1} do 4: (x,coeff_d)←DWT(x,waveletname) 5: Calculate statistical features for x: wave_y1←mean(x) wave_y2←max(x) wave_y3←RMS(x) wave_y4←std(x) wave_y5←std(x)/mean(x) wave_y6←max(x)/mean(x) 6: Calculate statistical features for coeff_d: wave_coef_y1←mean(coeff_d) wave_coef_y2←max(coeff_d) wave_coef_y3←RMS(coeff_d) wave_coef_y4←std(coeff_d) wave_coef_y5←std(coeff_d)/mean(coeff_d) wave_coef_y6←max(coeff_d)/mean(coeff_d) wave_coef_n5←5%−percentile(coeff_d) wave_coef_n25←25%−percentile(coeff_d) wave_coef_n75←75%−percentile(coeff_d) wave_coef_n95←95%−percentile(coeff_d) 7: features←(wave_y1,wave_y2,wave_y3,wave_y4,wave_y5,wave_y6, wave_coef_y1,wave_coef_y2,wave_coef_y3,wave_coef_y4, wave_coef_y5,wave_coef_y6,wave_coef_n5,wave_coef_n25,wave_coef_n75, wave_coef_n95) 8: Append features to feature_levels 9: end for 10: output←Flatten(feature_levels) 11: return output 12:end procedure