Пример #1
0
        public fft(int n, window_type wt)
        {
            fftLength = n;
            pin       = fftw.malloc(n * 2 * sizeof(double));
            pout      = fftw.malloc(n * 2 * sizeof(double));

            fin    = new double[2 * n];
            fout1  = new double[2 * n];
            fout2  = new double[2 * n];
            window = new double[n];
            freq   = new double[n / 2];

            winfunc = wt;
            makewindow();

            for (int i = 0; i < 2 * n; i++)
            {
                fin[i] = 0.0;
            }
            for (int i = 0; i < n / 2; i++)
            {
                freq[i] = (double)i / (n / 2) * 48000 / 2;
            }

            fplan = fftw.dft_r2c_1d(n, pin, pout, fftw_flags.Estimate);
        }
Пример #2
0
 public void setwindow(window_type wf)
 {
     if (wf != winfunc)
     {
         winfunc = wf;
         makewindow();
     }
 }