Ejemplo n.º 1
0
        protected void DrawGraph()
        {
            HammingWindow hammingWindow = new HammingWindow(Parameters.HAMMING_WINDOW_WIDE);
            Processor     processor     = new Processor(waveFile, hammingWindow);

            processor.Process();

            GraphPane sGraphPane = new GraphPane();
            GraphPane eGraphPane = new GraphPane();

            sGraphPane.XAxis.Title.Text = "Time";
            sGraphPane.YAxis.Title.Text = "Amplitude";

            eGraphPane.XAxis.Title.Text = "Time";
            eGraphPane.YAxis.Title.Text = "Enegry";

            PointPairList signalList = Utility.ConvertToPointPairList(waveFile);
            PointPairList enegryList = Utility.ConvertEnegryToPointPairList(processor.enegryArray.ToArray());

            if (signalList == null || enegryList == null)
            {
                return;
            }

            LineItem sCurve = sGraphPane.AddCurve("Signal", signalList, Color.Red, SymbolType.None);
            LineItem eCurve = eGraphPane.AddCurve("Enegry", enegryList, Color.Blue, SymbolType.None);

            sCurve.Line.Width = 1F;
            eCurve.Line.Width = 1F;

            zedGraphControl.AxisChange();
        }
Ejemplo n.º 2
0
        protected void DrawEngeryGraph()
        {
            HammingWindow hammingWindow = new HammingWindow(Parameters.HAMMING_WINDOW_WIDE);
            Processor     processor     = new Processor(waveFile, hammingWindow);

            processor.Process();

            GraphPane graphPane = new GraphPane();

            graphPane.Clone();
            graphPane.XAxis.Title.Text = "Time";
            graphPane.YAxis.Title.Text = "Amplitude";

            PointPairList list = ConvertEnegryToPointPairList(processor.enegryArray.ToArray());

            if (list == null)
            {
                return;
            }

            LineItem curve = graphPane.AddCurve("Curve", list, Color.Red, SymbolType.None);

            curve.Line.Width = 2.0F;
            //curve.Line.Fill = new Fill(Color.White, Color.Red, 45F);
            zedGraphControl.MasterPane.Add(graphPane);
            zedGraphControl.AxisChange();
        }