cmath4.c, correct scale for ifft

This commit is contained in:
dwarning
2014-01-02 09:53:48 +01:00
committed by rlar
parent 51c7f17186
commit dc398f1387
+4 -4
View File
@@ -780,7 +780,7 @@ cx_ifft(void *data, short int type, int length, int *newlength, short int *newty
{ {
ngcomplex_t *indata = (ngcomplex_t *) data; ngcomplex_t *indata = (ngcomplex_t *) data;
int i, tpts; int i, tpts;
double span, scale; double span;
double *xscale; double *xscale;
ngcomplex_t *outdata = NULL; ngcomplex_t *outdata = NULL;
struct dvec *sv; struct dvec *sv;
@@ -792,6 +792,7 @@ cx_ifft(void *data, short int type, int length, int *newlength, short int *newty
#else #else
int N, M; int N, M;
double *datax = NULL; double *datax = NULL;
double scale;
#endif #endif
if (grouping == 0) if (grouping == 0)
@@ -895,10 +896,9 @@ cx_ifft(void *data, short int type, int length, int *newlength, short int *newty
*newlength = tpts; *newlength = tpts;
outdata = alloc_c(tpts); outdata = alloc_c(tpts);
scale = (double) tpts;
for (i = 0; i < tpts; i++) { for (i = 0; i < tpts; i++) {
outdata[i].cx_real = out[i][0] * scale; outdata[i].cx_real = out[i][0];
outdata[i].cx_imag = out[i][1] * scale; outdata[i].cx_imag = out[i][1];
} }
fftw_free(in); fftw_free(in);