I need to find the duration of a sequence of data values that represents head yaw

movements .where the positive values are head looking to right and negative values

are head looking to left .the below signal has different duration of looking right

enter image description hereand left. How can I find these duration ?

  • $\begingroup$ use condition (greater than or less than) in matlab to find the time values indices greater than zero and less than. For greater than, take the indices arrange into different classes bases on the connection (sequence). Find the difference of each class between max and min which will provide duration for each class (connected sequence). Repeat the same for less than $\endgroup$ – Zeeshan Jul 6 '17 at 14:32
  • $\begingroup$ you can also filter it before to have smooth response, if it does not destroys your information $\endgroup$ – Zeeshan Jul 6 '17 at 14:33
  • $\begingroup$ I would threshold the time-series to get only 1, 0 and -1 then it's simply a matter of counting blocks of 1s' / -1s' duration $\endgroup$ – Florent Jul 7 '17 at 4:30
  • $\begingroup$ I have filtered the signal using SG ang got this : ![filtered signal ](ibb.co/iKaE7v). Now if I separate it for less than and larger than 0 how can I find the duration of each sequenced values ? $\endgroup$ – amir Jul 7 '17 at 8:15
  • $\begingroup$ Well considering your data to be uniformly sampled, the duration of a sequence is your sampling period times the number of elements in your sequence. For the number of elements it depends on where you implement your algorithm but it shouldn't be too difficult, right? $\endgroup$ – Florent Jul 8 '17 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.