There does seem to be some literature on using SVD or PCA for reducing triaxial signals to 1D. (See DOI: 10.1049/el.2018.6117 and DOI: 10.1190/1.1443068 ), but you could also try to calculate the resultant vector ( r = sqrt(x^2 + y^2 + z^2) ).

Whether you want the x-component of the frequency spectrum (frequency value) or the y-component (amplitude value) really depends on the specific problem at hand. Do the different classes of signals have a peak at the same frequency, but of different amplitude, or do they have peaks with the same amplitude but at different frequencies?

You can also try to use the PSD instead of the FFT, which has a more smooth frequency spectrum. ]]>

With pywt you can calculate it as follows:

“0.25 / pywt.scale2frequency(‘cmor’,128)”

>>> 64.0 ]]>

First thank you for the excellent document.

Follwing the question of Balandong, how did you calculate the scale 128 with frequency (1/T)?

All the best ]]>

I need all the 3-components data, one solution is to use SVD to decompose it to 1D (Is it a good solution?). I need only one frequency feature for a given seconds of data (say 2-seconds of data) of the 1D signal. So, should I take the max_peak bin#? but it gives me an index number. Is it the given frequency feature? ]]>

I guess the wavelet transform is less useful in an online mode (especially since it is good in localizing the frequency contents in the time-domain), but depending on the size of the small chunks it can be a little less useful or not useful at all. It also strongly depends on your choice of wavelet. For example, if the small chunks contain 60 samples (1 chunk per minute) you have four levels of decomposition with ‘db2’ and only one with ‘db9’ or higher. ]]>

After that, calculate a bunch of features from the FFT and see which feature has the most importance and pick that one if you really can only pick one.

You could also calculate the PSD and see if there are specific frequency values (PSD_x) for which the PSD amplitude (PSD_y) is really important for your classification problem. ]]>

Thank you for making the codes available!

]]>In your ECG example it seems that you decompose the whole waveform into wavelet coefs. This implies an offline mode of processing. Could you comment on the online mode, when the signal arrives in small chunks. What is the optimal size of data, how waveform length affects feature dimension? In FFT we can focus on local signal properties, feeding the signal frame by frame. Does it make sense to do so in wavelet practice? Despite wavelet capturing multiscale features, does it make sense to work frame by frame for limiting feature size or staying online with signal reading? ]]>

I don’t know exactly what you mean. It could be that the colors are not correct.

The idea is that the output of pywt.wavedec(), which contains a list of sets of coefficients is used as input for a feature generator function.

As long as you are consistent, the order of the coefficients does not really matter. ]]>