< Back to IRCAM Forum

Detecting periodicity in gestures

Hi
I have been looking for a way of detecting periodicity in movements (analysis of an IMU sensor), typically in the range 0.5 - 10 Hz. I have seen that some people have used the YIN pitch tracking algorithm for that. However, when I tried using the pipo.yin I have not been able to find any parameter settings that gave any sensible output. Has anyone any experience with detecting periodicity using MuBu/pipo, and if so, how?
Best,
Andreas

I would imagine yin’s quality factor would do that. Minimum frequency should also be set accordingly.
Do you do any preprocessing? What parameter of the IMU are you feeding into yin?

Thanks for the reply. So I’ve been testing a bit more now, and it is starting to make a bit more sense. Now I get a relatively continuous output for all four values (frequency, lin energy, quality factor and AC1/AC0). However, the frequency value seems to be wrong - it is about 175% of the expected value: when feeding it with a periodic signal of 3Hz I get values of about 5.55Hz, 4Hz gives 7.15Hz, etc. My parameter settings are:
Downsampling: 4x
Frame rate: 100
Min freq: 0.75
Normalize: None
frame size: 200
Hop size: 4
Win type: hamming
Periodicity threshold: 0.5
Do you know what this error could be? Could this be a bug, or is it a result of tuning the algorithm to audio signals?
When using data from the IMU I have used a linear acceleration value filtered with slice (20,20) which have given relatively smooth values.
Best, Andreas

Could you post the patch?

Here is a version without the sensor input

Periodicity_YIN.maxpat (7.39 KB)

your test signal is garbage. Try with [cycle~ 3] -> [snapshot~ 10].

The result was as expected now. Thanks! Any advice on filtering the signal from the IMU: would slice 20. 20. be ok, or any of the pipo filters are perhaps better?

Indeed, for gesture analysis pipo wavelet works better, since it can cope with the always huge DC or low-frequency components.
You’d have to do some peak-picking on the wavelet spectrum (pipo.peaks).

Btw I got it much closer with a framerate of 50 and snapshot value of 20ms, for some reason, overdrive on.
The filtering depends on the source of motion, in my opinion, as there can be periodicity that takes place across all axes. You could certainly remove frequencies that aren’t part of the bandwidth you’re scanning, but maybe some vector math would be beneficial.

@Schwarz: Ok, so pipo wavelet with pipo.peaks could be better than yin, then? So basically looking at the peaks in the spectrum?