title: Having an array of magnitudes, how can I find the frequency in javascript?
body: <p>I am currently working on a project that involves recording the magnitude of a user's mobile device, and then analyzing this after recording to find the frequency of the user's movement. It's supposed to help the user with a specific kind of exercise that is done periodically. I need to find a way using javascript to find the frequency in the array of magnitudes recorded.</p>
  
  <p>I already have some data of the movement and was able to process it a bit in python, the magnitude basically looks like following: </p>
  
  <p><img src="https://i.imgur.com/KzL9qjs.png" alt="example"></p>
  
  <p>What I want is a method that can detect that frequency of the array, so I know to how many points should I cut the array and process it and verify it. It's an app to count repetitions of an exercise, and I am planning after getting the frequency, to divide the array based on this frequency, and then compare each period with a stored "ideal" repetition of the exercise and do dynamic time warping on it to compare how well it was performed.</p>