コード例 #1
0
ファイル: data_filter.cs プロジェクト: neuroidss/brainflow
        /// <summary>
        /// detrend, unlike other bindings instead in-place calculation it returns new array
        /// </summary>
        /// <param name="data"></param>
        /// <param name="operation"></param>
        /// <returns>data with removed trend</returns>
        public static double[] detrend(double[] data, int operation)
        {
            double[] new_data = new double[data.Length];
            Array.Copy(data, new_data, data.Length);
            int res = DataHandlerLibrary.detrend(new_data, new_data.Length, operation);

            if (res != (int)CustomExitCodes.STATUS_OK)
            {
                throw new BrainFlowException(res);
            }
            return(new_data);
        }