Пример #1
0
        private void PlotTime()
        {
            Func <double, double> f    = x => clutter(x) + flib.Gauss(x);
            Transformer           trns = new Transformer(f, N, min, max);
            Func <double, double> xmod;

            if (filter != Filters.Wiener)
            {
                xmod = (x => N / 2 - x);
            }
            else
            {
                xmod = (x => x);
            }
            FFT_Inv_Transformer ft = new FFT_Inv_Transformer(x => trns.FFT_C(x) * filter(xmod(x)), N);

            PlotableFunction f_in  = new PlotableFunction(f, "Input Func", 1);
            PlotableFunction f_out = new PlotableFunction(x => ft.FFT_Inv((x - min) * N / (max - min)), "Result", 2);

            plt.Plot(new PlotableFunction[] { f_in, f_out }, min, max);
        }
Пример #2
0
        private void PlotSpectr()
        {
            Func <double, double> f    = x => clutter(x) + flib.Gauss(x);
            Transformer           trns = new Transformer(f, N, min, max);

            Func <double, double> xmod;

            if (filter != Filters.Wiener)
            {
                xmod = (x => N / 2 - x);
            }
            else
            {
                xmod = (x => x);
            }
            FFT_Inv_Transformer ft = new FFT_Inv_Transformer(x => trns.FFT_C(x) * filter(xmod(x)), N);

            PlotableFunction f_in   = new PlotableFunction(trns.FFT, "Input Func", 1);
            PlotableFunction f_filt = new PlotableFunction(x => filter(xmod(x)).Magnitude, "Filter", 2);
            PlotableFunction f_res  = new PlotableFunction(x => (trns.FFT_C(x) * filter(xmod(x))).Magnitude, "Result", 3);

            plt.Plot(new PlotableFunction[] { f_filt, f_in, f_res }, 0, N);
        }