/// <summary> /// calculate band power /// </summary> /// <param name="psd">psd data returned by get_psd or get_log_psd</param> /// <param name="start_freq">lowest frequency of band</param> /// <param name="stop_freq">highest frequency of band</param> /// <returns>band power</returns> public static double get_band_power(Tuple <double[], double[]> psd, double start_freq, double stop_freq) { double[] band_power = new double[1]; int res = DataHandlerLibrary.get_band_power(psd.Item1, psd.Item2, psd.Item1.Length, start_freq, stop_freq, band_power); if (res != (int)CustomExitCodes.STATUS_OK) { throw new BrainFlowException(res); } return(band_power[0]); }