Exemple #1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (((ComboBox)sender).SelectedIndex)
            {
            case 0:                     // noize
                dispFunc.FracAdd(new Func(FuncHelper.Noise1()));
                break;

            case 1:                     // polyharm
                var polyharmFun = new Func(FuncHelper.Polyharm(
                                               new[] { 50, 5, 150.0 },
                                               new[] { 75.0, 15, 25 },
                                               0.001));
                dispFunc.FracAdd(polyharmFun);
                break;

            case 2:                     // harm
                dispFunc.FracAdd(new Func(FuncHelper.Harm(50, 25, 0.001)));
                break;

            case 3:                     // func
                dispFunc.FracAdd(new Func(dispFunc.StartFunc));
                break;
            }
        }
Exemple #2
0
        static double[] FxNoize()
        {
            var res   = Fx();
            var noize = FuncHelper.Noise1();

            for (int i = 0; i < res.Length; i++)
            {
                res[i] += noize[i];
            }

            return(res);
        }
Exemple #3
0
 private void bJump_Click(object sender, EventArgs e)
 {
     if (int.Parse(bJump.Tag.ToString()) == 1)
     {
         dispFunc.AddF(FuncHelper.Jump(5, 1000));
         bJump.Tag  = 0;
         bJump.Text = "Убрать всплески";
     }
     else
     {
         FuncHelper.ClearJumps(ref dispFunc.Fx[1], 1000);
         dispFunc.CountF();
         bJump.Tag  = 1;
         bJump.Text = "Добавить всплески";
     }
     Refresh();
 }
Exemple #4
0
        public FrmMain()
        {
            InitializeComponent();
            var fun1 = new Func(FuncHelper.Func4());

            funcAnalysis1.DispFunc = fun1;
            var fun2 = new Func(FuncHelper.Func2());

            ucFuncAnalysis1.DispFunc = fun2;
            var fun3 = new Func(FuncHelper.Func3());

            ucFuncAnalysis2.DispFunc = fun3;
            //var polyharmFun = new Func(
            //    Algorithms.SlowReverseFourierTransform(
            //Algorithms.SlowFourierTransformCplx(FuncHelper.Polyharm(
            //    new[] { 50, 5, 150.0 },
            //    new[] { 75.0, 15, 25 },
            //    0.001)[1])));

            var polyharmFun = new Func(FuncHelper.Polyharm(
                                           new[] { 50, 5, 150.0 },
                                           new[] { 75.0, 15, 25 },
                                           0.001));

            ucFuncAnalysis3.DispFunc = polyharmFun;
            var harmFun = new Func(FuncHelper.Harm(50, 25, 0.001));

            ucFuncAnalysis4.DispFunc = harmFun;
            var noize1F = new Func(FuncHelper.Noise1());

            ucFuncAnalysis5.DispFunc = noize1F;
            var noize2F = new Func(FuncHelper.Noise2());

            ucFuncAnalysis6.DispFunc = noize2F;
            var cardiogram = new Convolution();
            var cardio     = new Func(cardiogram.Result());

            //cardio.AddF(noize1F);
            ucFuncAnalysis7.DispFunc = cardio;
            var deconvolution = new Deconvolution();
            var deconv        = new Func(deconvolution.Result(cardio.Fx[1], cardiogram));

            ucFuncAnalysis8.DispFunc = deconv;
            ucFiltration1.DispFunc   = polyharmFun;
        }
Exemple #5
0
 private void bTrend_Click(object sender, EventArgs e)
 {
     if (int.Parse(bTrend.Tag.ToString()) == 1)
     {
         var funTrend = new Func(FuncHelper.Func1());
         dispFunc.AddF(funTrend);
         bTrend.Tag  = 0;
         bTrend.Text = "Убрать тренд";
     }
     else
     {
         FuncHelper.ClearTrend(ref dispFunc.Fx[1]);
         dispFunc.CountF();
         bTrend.Tag  = 1;
         bTrend.Text = "Добавить тренд";
     }
     Refresh();
 }
Exemple #6
0
 private void bHarm_Click(object sender, EventArgs e)
 {
     if (int.Parse(bHarm.Tag.ToString()) == 1)
     {
         var harmFun = new Func(FuncHelper.Harm(50, 25, 0.001));
         dispFunc.AddF(harmFun);
         bHarm.Tag  = 0;
         bHarm.Text = "Убрать синус";
     }
     else
     {
         FuncHelper.ClearHarm(ref dispFunc.Fx[1]);
         dispFunc.CountF();
         bHarm.Tag  = 1;
         bHarm.Text = "Добавить синус";
     }
     Refresh();
 }
Exemple #7
0
 private void bNoise_Click(object sender, EventArgs e)
 {
     if (int.Parse(bNoise.Tag.ToString()) == 1)
     {
         var funNoise = new Func(FuncHelper.Noise1(10));
         dispFunc.AddF(funNoise);
         bNoise.Tag  = 0;
         bNoise.Text = "Убрать шум";
     }
     else
     {
         FuncHelper.ClearNoize(ref dispFunc.Fx[1]);
         dispFunc.CountF();
         bNoise.Tag  = 1;
         bNoise.Text = "Добавить шум";
     }
     Refresh();
 }
Exemple #8
0
 public void CountF()
 {
     if (Fx == null)
     {
         return;
     }
     P    = FuncHelper.P(Fx[1]);
     M    = FuncHelper.M(Fx[1]);
     Sq   = FuncHelper.MSq(Fx[1]);
     Disp = FuncHelper.Disp(Fx[1]);
     Fac  = FuncHelper.FAc(Fx[1]);
     if (FFrac != null)
     {
         Frac = FuncHelper.FRac(Fx[1], FFrac.Fx[1]);
     }
     PList    = GBuilder.MakeGraph(P);
     FacList  = GBuilder.MakeGraph(Fx[0], Fac);
     FracList = GBuilder.MakeGraph(Fx[0], Frac);
     FpList   = GBuilder.MakeGraph(Fx);
 }
Exemple #9
0
 private void bPolyharm_Click(object sender, EventArgs e)
 {
     if (int.Parse(bPolyharm.Tag.ToString()) == 1)
     {
         var polyharmFun = new Func(FuncHelper.Polyharm(
                                        new[] { 50, 5, 150.0 },
                                        new[] { 75.0, 15, 25 },
                                        0.001));
         dispFunc.AddF(polyharmFun);
         bPolyharm.Tag  = 0;
         bPolyharm.Text = "Очистить от полигарм. колеб.";
     }
     else
     {
         FuncHelper.ClearPolyHarm(ref dispFunc.Fx[1]);
         dispFunc.CountF();
         bPolyharm.Tag  = 1;
         bPolyharm.Text = "Добавить полигарм. колеб.";
     }
     Refresh();
 }