Esempio n. 1
0
        ///<summary> A method for creating a Butterworth filter, based on the coefficents of the discrete filter, for filtering EMG data. </summary>
        ///<returns> N/A </returns>
        void CreateEMGFilters()
        {
            int           coefficients = 3;
            List <double> B1           = new List <double>(coefficients);
            List <double> A1           = new List <double>(coefficients);

            B1.Add(Convert.ToSingle(0.956543225556877));
            B1.Add(Convert.ToSingle(-1.91308645111375));
            B1.Add(Convert.ToSingle(0.956543225556877));

            A1.Add(Convert.ToSingle(1.000000000000000));
            A1.Add(Convert.ToSingle(-1.91119706742607));
            A1.Add(Convert.ToSingle(0.914975834801434));

            //Create Butterworth High Pass filter for EMG data - 20Hz, order 2
            emg_highpass_filter = new Butterworth(B1, A1);

            coefficients = 3;
            List <double> B2 = new List <double>(coefficients);
            List <double> A2 = new List <double>(coefficients);

            B2.Add(Convert.ToSingle(0.292893218813452));
            B2.Add(Convert.ToSingle(0.585786437626905));
            B2.Add(Convert.ToSingle(0.292893218813452));

            A2.Add(Convert.ToSingle(1.000000000000000));
            A2.Add(Convert.ToSingle(-2.22044604925031e-16));
            A2.Add(Convert.ToSingle(0.171572875253810));

            //Create Butterworth Low Pass filter for EMG data - 500Hz, order 2
            emg_lowpass_filter = new Butterworth(B2, A2);
        }
Esempio n. 2
0
        void CreateLinearEnvelopeFilter()
        {
            int           coefficients = 5;
            List <double> B            = new List <double>(coefficients);
            List <double> A            = new List <double>(coefficients);

            B.Add(Convert.ToSingle(7.69909892783804e-09));
            B.Add(Convert.ToSingle(3.07963957113522e-08));
            B.Add(Convert.ToSingle(4.61945935670283e-08));
            B.Add(Convert.ToSingle(3.07963957113522e-08));
            B.Add(Convert.ToSingle(7.69909892783804e-09));

            A.Add(Convert.ToSingle(1.000000000000000));
            A.Add(Convert.ToSingle(-3.95074409047721));
            A.Add(Convert.ToSingle(5.85344171948211));
            A.Add(Convert.ToSingle(-3.85463384437136));
            A.Add(Convert.ToSingle(0.951936338552047));

            linear_envelope_filter = new Butterworth(B, A);
        }
Esempio n. 3
0
        ///<summary> A method for creating a Butterworth filter, based on the coefficents of the discrete filter, for filtering angle data. </summary>
        ///<returns> N/A </returns>
        void CreatePositionFilter()
        {
            //Create Butterworth Low Pass Filter for angle data - 6Hz, order 4
            int           coefficients = 5;
            List <double> B            = new List <double>(coefficients);
            List <double> A            = new List <double>(coefficients);

            B.Add(Convert.ToSingle(7.69909892783804e-09));
            B.Add(Convert.ToSingle(3.07963957113522e-08));
            B.Add(Convert.ToSingle(4.61945935670283e-08));
            B.Add(Convert.ToSingle(3.07963957113522e-08));
            B.Add(Convert.ToSingle(7.69909892783804e-09));

            A.Add(Convert.ToSingle(1.000000000000000));
            A.Add(Convert.ToSingle(-3.95074409047721));
            A.Add(Convert.ToSingle(5.85344171948211));
            A.Add(Convert.ToSingle(-3.85463384437136));
            A.Add(Convert.ToSingle(0.951936338552047));

            position_filter = new Butterworth(B, A);
        }