Home | History | Annotate | Download | only in tests

Lines Matching refs:nfft

54 void check(kiss_fft_scalar  * in,kiss_fft_scalar  * out,int nfft,int isinverse)
59 for (bin=0;bin<nfft/2;++bin) {
63 for (k=0;k<nfft;++k) {
64 double phase = 2*M_PI*(k+.5+.25*nfft)*(bin+.5)/nfft;
67 re /= nfft/4;
77 printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr );
84 void check_inv(kiss_fft_scalar * in,kiss_fft_scalar * out,int nfft,int isinverse)
89 for (bin=0;bin<nfft;++bin) {
93 for (k=0;k<nfft/2;++k) {
94 double phase = 2*M_PI*(bin+.5+.25*nfft)*(k+.5)/nfft;
107 printf("nfft=%d inverse=%d,snr = %f\n",nfft,isinverse,snr );
115 void test1d(int nfft,int isinverse)
118 size_t buflen = sizeof(kiss_fft_scalar)*nfft;
123 opus_val16 * window= (opus_val16*)malloc(sizeof(opus_val16)*nfft/2);
126 clt_mdct_init(&cfg, nfft, 0);
127 for (k=0;k<nfft;++k) {
131 for (k=0;k<nfft/2;++k) {
134 for (k=0;k<nfft;++k) {
140 for (k=0;k<nfft;++k) {
141 in[k] /= nfft;
145 for (k=0;k<nfft;++k)
147 /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("\n");*/
151 for (k=0;k<nfft;++k)
153 clt_mdct_backward(&cfg,in,out, window, nfft/2, 0, 1);
155 for (k=0;k<nfft/4;++k)
156 out[nfft-k-1] = out[nfft/2+k];
157 check_inv(in,out,nfft,isinverse);
159 clt_mdct_forward(&cfg,in,out,window, nfft/2, 0, 1);
160 check(in_copy,out,nfft,isinverse);
162 /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("\n");*/