Beispiel #1
0
        /// <summary>
        /// perform highpass filter, unlike other bindings instead in-place calculation it returns new array
        /// </summary>
        /// <param name="data"></param>
        /// <param name="sampling_rate"></param>
        /// <param name="cutoff"></param>
        /// <param name="order"></param>
        /// <param name="filter_type"></param>
        /// <param name="ripple"></param>
        /// <returns>filtered data</returns>
        public static double[] perform_highpass(double[] data, int sampling_rate, double cutoff, int order, int filter_type, double ripple)
        {
            double[] filtered_data = new double[data.Length];
            Array.Copy(data, filtered_data, data.Length);
            int res = DataHandlerLibrary.perform_highpass(filtered_data, data.Length, sampling_rate, cutoff, order, filter_type, ripple);

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