예제 #1
0
 public TransformModel(WindowsSetModel set)
 {
     windows = set;
     Current = new TransformStuff();
     //CurrentWindowed = null;
     transformer = new FourierTransformer();
 }
예제 #2
0
        //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;
        }
예제 #3
0
        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);
        }
예제 #4
0
 public TransformContext(TransformStuff current) : base(new TransformParameters(current))
 {
 }
예제 #5
0
 public TransformParameters(TransformStuff current)
 {
     Start = new DoubleParam("Нижняя частота: ", "Частота", current.StartFreq);
     Step  = new DoubleParam("Шаг частоты: ", "Шаг", current.StepFreq);
     Count = new IntParam("Число шагов: ", "Кол-во шагов", current.CountFreq);
 }
예제 #6
0
 public void SetConfigs(TransformStuff stuff)
 {
     transform.Current = stuff;
     Transform();
     TransformChanged();
 }
예제 #7
0
 public void Transform(TransformStuff material)
 {
     transform.Transform(material, GetSum());
     TransformChanged();
 }