private void btnBuild_Click(object sender, EventArgs e) { double qde = 0; ArrayList temp = new ArrayList(dataLength); for (int i = 0; i < dataLength; i++) { double summ = 0; for (int j = 0; j < DataBase.Count; j++) { summ += (double)((ArrayList)DataBase[j])[i]; } summ /= DataBase.Count; for (int j = 0; j < DataBase.Count; j++) { qde += Math.Pow((double)((ArrayList)DataBase[j])[i] - summ, 2); } temp.Add(summ); } qde = Math.Sqrt(qde) / DataBase.Count / dataLength; TmpPlot.Clear(); TmpPlot.AddData(temp); pictureBox3.Image = new Bitmap(pictureBox3.Width, pictureBox3.Height); TmpPlot.Restore(Graphics.FromImage(pictureBox3.Image)); TmpPlot.DrawData(); lbVariation.Text = "Среднее отклонение - " + qde.ToString(); }
private void ProcessData(int WindowSize) { ArrayList Mf = new ArrayList(); for (int left = 0; left + WindowSize < Data.Count; left += WindowSize / 2) { double[] temp = new double[WindowSize]; temp = (double[])Data.GetRange(left, WindowSize).ToArray(typeof(double)); RawTransform.Transform(ref temp); FPlot.AddData(temp); temp = RawTransform.getMFCC(temp); Mf.AddRange(temp); } if ((dataLength == 0) | (Mf.Count < dataLength)) { dataLength = Mf.Count; TmpPlot.SelectView(0, dataLength); } DataBase.Add(Mf); TmpPlot.AddData(Mf); FPlot.DrawData(); TmpPlot.DrawData(); }