Exemplo n.º 1
0
        /// <summary>
        /// perform wavelet based denoising
        /// </summary>
        /// <param name="data">data for denoising</param>
        /// <param name="wavelet">db1..db15,haar,sym2..sym10,coif1..coif5,bior1.1,bior1.3,bior1.5,bior2.2,bior2.4,bior2.6,bior2.8,bior3.1,bior3.3,bior3.5 ,bior3.7,bior3.9,bior4.4,bior5.5,bior6.8</param>
        /// <param name="decomposition_level">level of decomposition in wavelet transform</param>
        /// <returns>denoised data</returns>
        public static double[] perform_wavelet_denoising(double[] data, string wavelet, int decomposition_level)
        {
            double[] filtered_data = new double[data.Length];
            Array.Copy(data, filtered_data, data.Length);
            int res = DataHandlerLibrary.perform_wavelet_denoising(filtered_data, filtered_data.Length, wavelet, decomposition_level);

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