docs: function smooth(spectrum, nbPixels) {
      var result=[];
      var array=spectrum.y;
      var shift=Math.floor(nbPixels/2);
  
      for (var i=shift; i<(array.length-shift-1); i++) {
          var average=0;
          for (var j=i-shift; j<i-shift+nbPixels; j++) {
              average+=array[j];
          }
          result.push(average/nbPixels)
      }
  
      spectrum.y=result;
      // need to shift the reference point
      spectrum.redPoint-=shift;
      spectrum.bluePoint-=shift;
      spectrum.greenPoint-=shift;
  }