Exemple #1
0
        public Vm()
        {
            DataPoints = new List<DataPoint>();
            FourierPoints = new List<DataPoint>();
            Spectrum = new List<DataPoint>();
            MinX = 6;
            MaxX = 16;
            var onePeriod = new SineSeries(SineParameters.FromPeriod(1, MaxX - MinX, 0));
            var twoPeriods = new SineSeries(SineParameters.FromPeriod(1, (MaxX - MinX) / 2.0, 0));
            var tenPeriods = new SineSeries(SineParameters.FromPeriod(1, (MaxX - MinX) / 10.0, 0));
            var notPeriod = new SineSeries(SineParameters.FromPeriod(1, 0.7 * (MaxX - MinX), 0));

            var cos = new SineSeries(SineParameters.FromPeriod(1, (MaxX - MinX), Math.PI / 2));
            var offsetSine = new SineSeries(new SineParameters(1, 0, 0), SineParameters.FromPeriod(1, MaxX - MinX, 0));

            _functions = new List<SampleData>
            {
                new SampleData(onePeriod, "One period"),
                new SampleData(twoPeriods, "Two periods"),
                new SampleData(tenPeriods, "Ten periods"),
                new SampleData(notPeriod, "0.7 periods"),
                new SampleData(cos, "cos"),
                new SampleData(offsetSine, "offset"),
                new SampleData(new NoisySine(onePeriod, 0.1), "noisy sine"),
                new SampleData(new NoisySine(onePeriod, 2), "really noisy sine"),
                new SampleData(new SquareSeries(0,5), "Square"),
                new SampleData(new Polynom(0, 1), "y = x"),
                new SampleData(new NoiseSeries(1), "random noise"),
            };
            _selectedSample = _functions.First();

            NumberOfPoints = 10;
        }
Exemple #2
0
 public NoisySine(SineSeries sineSeries, double stddev)
 {
     _sineSeries = sineSeries;
     _stddev = stddev;
 }