Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 virtual public async void CalcSpectrum()
 {
     var spec = new FreqPoint[0][];
     await Task.Run(() =>
     {
         spec = generator.GetSpectrum();
         //синхронизация, чтобы не возникло проблем при пересчете спектра
         lock (spectrum)
         {
             spectrum = spec;
         }
         TransformChanged();
     });
 }
Ejemplo n.º 4
0
        //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);
        }
Ejemplo n.º 5
0
        virtual public FreqPoint[][] GetSpectrum(double[] signal, int stepsCount, double start, double step)
        {
            var spectrum = new FreqPoint[][] { Transform(signal, stepsCount, start, step) };

            return(spectrum);
        }
Ejemplo n.º 6
0
 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));
 }