public TransformModel(WindowsSetModel set) { windows = set; Current = new TransformStuff(); //CurrentWindowed = null; transformer = new FourierTransformer(); }
//public Spectrum Transform(WindowedTransformStuff stuff, ISignal signal, TransformType window) //{ // Spectrum = transformer.Transform(stuff, signal, windows.GetTransformer(window)); // return Spectrum; //} //public Spectrum Transform(WindowedTransformStuff stuff, ISignal signal) //{ // Spectrum = transformer.Transform(stuff, signal, windows.GetTransformer(CurrentWindow)); // return Spectrum; //} public Spectrum Transform(TransformStuff stuff, ISignal signal) { if (WindowType == WindowType.NoWin) Spectrum = transformer.Transform(stuff, signal); else if (stuff is WindowedTransformStuff) Spectrum = transformer.Transform((stuff as WindowedTransformStuff), signal, GetWindow()); else Spectrum = transformer.Transform(new WindowedTransformStuff(stuff), signal, GetWindow()); return Spectrum; }
virtual public Spectrum Transform(TransformStuff stuff, ISignal signal) { var spectrum = new Spectrum(stuff.CountFreq, 1, signal.GetActualLength()); var freqs = stuff.GetFreqs(); for (var i = 0; i < freqs.Length; i++) { var fourier = calc.CalcFreq(signal, freqs[i]); spectrum.SetPoint(i, 0, new FreqPoint(fourier, freqs[i])); } var log = new Logger("not_windowed_transform.log"); log.WriteLog("Hey!"); log.Flush(); return(spectrum); }
public TransformContext(TransformStuff current) : base(new TransformParameters(current)) { }
public TransformParameters(TransformStuff current) { Start = new DoubleParam("Нижняя частота: ", "Частота", current.StartFreq); Step = new DoubleParam("Шаг частоты: ", "Шаг", current.StepFreq); Count = new IntParam("Число шагов: ", "Кол-во шагов", current.CountFreq); }
public void SetConfigs(TransformStuff stuff) { transform.Current = stuff; Transform(); TransformChanged(); }
public void Transform(TransformStuff material) { transform.Transform(material, GetSum()); TransformChanged(); }