Ejemplo n.º 1
0
void OouraFFT::rdft(int n, int isgn, double * a, int * ip, double * w)
{
	int nw, nc;
	double xi;

	nw = ip[0];
	if (n > (nw << 2))
	{
		nw = n >> 2;
		makewt(nw, ip, w);
	}
Ejemplo n.º 2
0
      virtual void init(size_t size) override
      {
        if (_size != size)
        {
          _ip.resize(2 + static_cast<int>(std::sqrt(static_cast<double>(size))));
          _w.resize(size / 2);
          _buffer.resize(size);
          _size = size;

          const int size4 = static_cast<int>(_size) / 4;
          makewt(size4, _ip.data(), _w.data());
          makect(size4, _ip.data(), _w.data() + size4);
        }
      }
Ejemplo n.º 3
0
void init_rdft(int n, int *ip, float *w)
{

  int	nw,
	nc;

  void	makewt(int nw, int *ip, float *w);
  void	makect(int nc, int *ip, float *c);

  nw = n >> 2;
  makewt(nw, ip, w);

  nc = n >> 2;
  makect(nc, ip, w + nw);

  return;
}
int lsx_rdft_init(int n, FFTcontext* z)
{
    int nw;

    z->n = n;
    z->br = (int*) _aligned_malloc(dft_br_len(n) * sizeof(int), 16);
    z->sc = (double*) _aligned_malloc(dft_sc_len(n) * sizeof(double), 16);
    if(z->br == NULL || z->sc == NULL)
    {
        lsx_rdft_close(z);
        return -1;
    }

    nw = n >> 2;
    makebr(nw, z->br);
    makewt(nw, z->br, z->sc);
    makect(nw, z->sc + nw);

    makebr(n, z->br);
    return 0;
}