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 1 CalcFeatures_stft function 1:procedure CalcFeatures_stft(x,fs_custom,window=‘hamming’,nperseg=32,noverlap=0) 2: (f,t,Zxx)←STFT(x,fs=fs_custom,window=window,nperseg=nperseg,noverlap=noverlap) 3: z←abs(Zxx) 4: n←numberofrows(z) 5: m←numberofcolumns(z) 6: Calculate statistical features for each row of z: y1←mean(z,axis=1) y2←max(z,axis=1) y3←RMS(z,axis=1) y4←std(z,axis=1) y5←std(z,axis=1)/mean(z,axis=1) y6←max(z,axis=1)/mean(z,axis=1) 7: features←concatenate(y1,y2,y3,y4,y5,y6,axis=0) 8: return features 9:end procedure