title: How to compute the envelop of signal in js
body: <p>I have a system that register sound from guitar chords to an Arduino. The result for each chord is an array of numbers between 0 and 1024. So one array represent an audio spectrum.
  I send each array to a nodeJS server. I'd like to compute the envelope of each audio spectrum, but i dunno how to achieve that. If possible, I'd prefer to use a javascript solution, as my server is in javascript.</p>
  
  <p>I add an approximate drawing. What I have is the blue data ; what I want is an array containing the red data.</p>
  
  <p><a href="https://i.stack.imgur.com/d652k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d652k.png" alt="enter image description here"></a></p>