code: public double[] getMagnitudes(double[] amplitudes) {
          double[] magnitudes = getMagnitudes(amplitudes, true);
  
          double[] halfOfMagnitudes = new double[magnitudes.length/2];
          System.arraycopy(magnitudes, 0,halfOfMagnitudes, 0, halfOfMagnitudes.length);
          return halfOfMagnitudes;
      }
docs: Get the frequency intensities. Backwards compatible with previous versions w.r.t to number of frequency bins.
  Use getMagnitudes(amplitudes, true) to get all bins.
  
  @param amplitudes complex-valued signal to transform. Even indexes are real and odd indexes are img
  @return intensities of each frequency unit: mag[frequency_unit]=intensity