Skip to main content
. 2023 Jun 23;23(13):5850. doi: 10.3390/s23135850
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:

        zabs(Zxx)

  • 4:

        nnumberofrows(z)

  • 5:

        mnumberofcolumns(z)

     

  • 6:
        Calculate statistical features for each row of z:
    • y1mean(z,axis=1)
    • y2max(z,axis=1)
    • y3RMS(z,axis=1)
    • y4std(z,axis=1)
    • y5std(z,axis=1)/mean(z,axis=1)
    • y6max(z,axis=1)/mean(z,axis=1)

     

  • 7:

        featuresconcatenate(y1,y2,y3,y4,y5,y6,axis=0)

  • 8:

        return features

  • 9:

    end procedure