Ejemplo n.º 1
0
        public DiscreteSignal Convert(DigitalizedSignal signal, double frequency)
        {
            List <double> timeValues = NewTimeValues(signal, frequency);
            List <Value>  values     = NewValues(signal.Values, timeValues, signal.frequency);

            return(DiscreteSignal.ForParameters(signal.Name, signal.OriginalType, frequency, values));
        }
Ejemplo n.º 2
0
        private void DB6(object sender, RoutedEventArgs e)
        {
            var waveletTransformationOutput = WaveletTransform.WaveletTransformation(Signal);
            var output = new List <Value>();

            for (int i = 0; i < waveletTransformationOutput.Count(); i++)
            {
                var value = new Value
                {
                    X = new Complex(i, 0),
                    Y = new Complex(waveletTransformationOutput[i].Real, 0)
                };
                output.Add(value);
            }
            Signal = DiscreteSignal.ForParameters("DB6", CPS.Signal.SignalType.CONTINUOUS, 1, output);
            ChartWrapper.SetSignal(SignalSlot, Signal);
            ChartWrapper.Replot();
        }
Ejemplo n.º 3
0
        private void FFTTransform(Func <List <Complex>, List <Complex> > transformFunc)
        {
            var input     = Signal.Values.Select(value => value.Y).ToList();
            var fftOutput = transformFunc(input);
            var output    = new List <Value>();

            for (int i = 0; i < fftOutput.Count(); i++)
            {
                var value = new Value
                {
                    X = new Complex(i, 0),
                    Y = fftOutput[i]
                };
                output.Add(value);
            }
            Signal = DiscreteSignal.ForParameters("fft", CPS.Signal.SignalType.CONTINUOUS, 1, output);
            ChartWrapper.SetSignal(SignalSlot, Signal);
            ChartWrapper.Replot();
        }
Ejemplo n.º 4
0
        public DiscreteSignal Process(DiscreteSignal a, DiscreteSignal b)
        {
            List <Value> newValues = NewValues(a, b);

            return(DiscreteSignal.ForParameters(Name, GetType(a.Type, b.Type), a.Frequency, newValues));
        }