Ejemplo n.º 1
0
        /// <summary>
        /// Произвести вейвлет разложение на 1 уровень
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            double[] signal = dDataSignal.ToArray();
            if (signal.Length > 1)
            {
                coefficients = WaveletTools.WaveDec(new WaveletTools.WaveletCoef(signal, null, null), (int)numericUpDown1.Value);
                ucChart2.ChartData = coefficients.cd.ToList();
                ucChart2.UpdateChart();

            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Произвести вейвлет восстановление на 1 уровень
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            //double[] signal; //= dDataSignalCopy.ToArray();
            if (coefficients.cd.Length > 1)
            {
                if (radioButton1.Checked)
                {

                    //double[] DH, double prg, int mode
                    coefficients.cd = WaveletTools.WThresh(coefficients.cd, Convert.ToDouble(textBox3.Text), 2);
                }
                else if (radioButton2.Checked)
                {
                    coefficients.cd = WaveletTools.WThresh(coefficients.cd, Convert.ToDouble(textBox3.Text), 1);
                }

                //для одноуровнего разложения
                //signal = WaveletTools.iDWT(coefficients);

                //для многоуровего
                coefficients = WaveletTools.WaveRec(coefficients);

                scrollBarSync2.DataSource = coefficients.ca;
                tbCount2.Text = coefficients.ca.Length.ToString();
                tbMean2.Text = StatisticTools.MeanValue(coefficients.ca.ToList()).ToString();
                tbVar2.Text = StatisticTools.VarianceValue(coefficients.ca.ToList()).ToString();

                ucChart2.ChartData = coefficients.ca.ToList();
                ucChart2.UpdateChart();
            }
        }