public FreqPoint[] GetRange(TransformOptions options) { var range = new FreqPoint[options.CountFreq]; var w = options.StartFreq; for (var i = 0; i < options.CountFreq; i++) { range[i] = new FreqPoint(calculator.CalcFreq(signal, w), w); w += options.StepFreq; } return(range); }
virtual public FreqPoint[] Transform(double[] signal, int stepsCount, double wStart, double wStep) { var tr = new FreqPoint[stepsCount]; var normSignal = norm.Norm(signal); var step = wStart; for (var i = 0; i < stepsCount; i++) { tr[i] = new FreqPoint(findMC(normSignal, step), step); step += wStep; } return(tr); }
virtual public async void CalcSpectrum() { var spec = new FreqPoint[0][]; await Task.Run(() => { spec = generator.GetSpectrum(); //синхронизация, чтобы не возникло проблем при пересчете спектра lock (spectrum) { spectrum = spec; } TransformChanged(); }); }
//public override FreqPoint[] Transform(double[] signal, int stepsCount, double wStart, double wStep) { // return base.Transform(normalizer.Norm(signal), stepsCount, wStart, wStep); //} public override FreqPoint[][] GetSpectrum(double[] signal, int stepsCount, double wStart, double step) { var spectrum = new FreqPoint[signal.Length][]; start = 0; for (var i = 0; i < spectrum.Length; i++) { spectrum[i] = Transform(GetWindow(signal), stepsCount, wStart, step); start++; } return(spectrum); }
virtual public FreqPoint[][] GetSpectrum(double[] signal, int stepsCount, double start, double step) { var spectrum = new FreqPoint[][] { Transform(signal, stepsCount, start, step) }; return(spectrum); }
public void WriteLogFreq(FreqPoint freq) { WriteLog(String.Format("Freq is {0}, X is: {1}, Y is: {2}", freq.Freq, freq.Coords.Real, freq.Coords.Imaginary)); }