Example #1
0
 private static double Triangle(long x, WaveConfig wc)
 {
     return(2 * (2 * wc.Amplitude / wc.Period) * (Math.Abs(x - wc.Period / 2) - wc.Period / 4));
 }
Example #2
0
 private static double Flat(long x, WaveConfig wc)
 {
     return(wc.Offset);
 }
Example #3
0
 private static double Sawtooth(long x, WaveConfig wc)
 {
     return(2 * (wc.Amplitude / wc.Period) * x - wc.Amplitude);
 }
Example #4
0
        private static double Square(long x, WaveConfig wc)
        {
            var b = 2 * Math.PI / (1 / wc.FrequencyInKilohertz);

            return(wc.Amplitude * Math.Sign(Math.Sin(b * x)));
        }