public Harmonic AddHarmonic(double length, double phase, double freq) { SubHarmonic = new Harmonic(length, phase, freq); SubHarmonic.ParentHarmonic = this; SubHarmonic.Origin = End; return(SubHarmonic); }
public MainViewModel() { //var _amplify = 300 / Math.PI; //_series = new Series(); //_series.NewHarmonic(_amplify, 90, 2) // .NewHarmonic(_amplify / 3, 90, 6) // .NewHarmonic(_amplify / 5, 90, 10) // .NewHarmonic(_amplify / 7, 90, 14) // .NewHarmonic(_amplify / 9, 90, 18) // .NewHarmonic(_amplify / 11, 90, 22) // .NewHarmonic(_amplify / 13, 90, 26) // .NewHarmonic(_amplify / 15, 90, 30) // .NewHarmonic(_amplify / 17, 90, 34) // .NewHarmonic(_amplify / 19, 90, 38); _series = new Series(); _series.Initiate(0, 250, 90, 2); _series.Expression((a, n) => a / Math.PI / (2 * n - 1), (t, n) => t * (2 * n - 1)); _series.Times(10); Harmonics = new ObservableCollection <Harmonic>(_series.Harmonics); _pipe = new Pipe <double>(1500); Graph = new ObservableCollection <Point>(); Last = Harmonics.Last(); FFTHarmonics = new ObservableCollection <FFTHarmonic> { new FFTHarmonic { Amplify = 0, K = 0 } , new FFTHarmonic { Amplify = 10, K = 1 } , new FFTHarmonic { Amplify = 6, K = 2 } , new FFTHarmonic { Amplify = 30, K = 3 } }; }