Group Admins

  • Profile picture of Norbert Schnell

Group Mods

  • Profile picture of Frederic Bevilacqua
  • Profile picture of schwarz
  • Profile picture of borghesi

MuBu for Max

Public Group active 1 week, 3 days ago

MuBu for Max user group.

Detecting periodicity in gestures

Author 3 Subscribed Users |
Profile photo of andreasbergsland
andreasbergsland

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

November 21, 2018 at 19:19 #28396
Profile photo of danijoss
danijoss

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?

November 22, 2018 at 07:10 #28397
Profile photo of andreasbergsland
andreasbergsland

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

November 22, 2018 at 09:48 #28398
Profile photo of danijoss
danijoss

Could you post the patch?

November 22, 2018 at 10:19 #28399
Profile photo of andreasbergsland
andreasbergsland

Here is a version without the sensor input

November 22, 2018 at 11:25 #28400
Profile photo of schwarz
schwarz

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

November 22, 2018 at 11:30 #28403
Profile photo of andreasbergsland
andreasbergsland

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?

November 22, 2018 at 11:54 #28404
Profile photo of schwarz
schwarz

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).

November 22, 2018 at 12:03 #28405
Profile photo of danijoss
danijoss

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.

November 22, 2018 at 12:06 #28406
Profile photo of andreasbergsland
andreasbergsland

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

November 22, 2018 at 15:18 #28407

You must be logged in to reply to this topic.

Log in now