File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 26
26
#include "fft.h"
27
27
28
28
static fftw_plan plan ;
29
- static double * in ;
30
29
static fftw_complex * out ;
30
+ static double * in ;
31
31
static size_t sz ;
32
32
static double * window ;
33
33
static double * sq ;
@@ -65,17 +65,16 @@ squares(size_t n)
65
65
}
66
66
67
67
int
68
- init_fft (size_t n )
68
+ init_fft (size_t maxn , size_t n )
69
69
{
70
- sz = n ;
71
- in = fftw_malloc (sz * sizeof (double ));
72
- out = fftw_malloc (sz * sizeof (fftw_complex ) / 2 );
70
+ in = fftw_malloc (maxn * sizeof (double ));
71
+ out = fftw_malloc (maxn * sizeof (fftw_complex ) / 2 );
73
72
assert (in && out );
74
73
75
- window = hamming ( sz );
76
- sq = squares ( sz );
77
-
78
- plan = fftw_plan_dft_r2c_1d ( sz , in , out , FFTW_MEASURE ) ;
74
+ plan = fftw_plan_dft_r2c_1d ( n , in , out , FFTW_MEASURE );
75
+ window = hamming ( n );
76
+ sq = squares ( n );
77
+ sz = n ;
79
78
80
79
return 0 ;
81
80
}
You can’t perform that action at this time.
0 commit comments