9 TsSpectrum::TsSpectrum(
bool WantMultiCalc)
11 MultiCalc = WantMultiCalc;
12 ExistsPlanForward =
false;
13 ExistsPlanReverse =
false;
19 void TsSpectrum::DestroyMem()
21 if (ExistsPlanForward || ExistsPlanReverse)
23 if (ExistsPlanForward)
24 fftw_destroy_plan(p_forward);
25 if (ExistsPlanReverse)
26 fftw_destroy_plan(p_reverse);
27 fftw_free(timedomain);
28 fftw_free(freqdomain);
29 ExistsPlanForward =
false;
30 ExistsPlanReverse =
false;
34 TsSpectrum::~TsSpectrum()
40 void TsSpectrum::AssignMem(
const int size)
43 timedomain = (
double *) fftw_malloc(
sizeof(
double) *
size);
44 freqdomain = (fftw_complex *) fftw_malloc(
sizeof(fftw_complex) * (size
48 void TsSpectrum::Finish_Calculation(
const int size)
53 void TsSpectrum::Prepare_Calculation(
const int size)
61 p_reverse = fftw_plan_dft_c2r_1d(size, freqdomain, timedomain,
63 p_forward = fftw_plan_dft_r2c_1d(size, timedomain, freqdomain,
68 p_reverse = fftw_plan_dft_c2r_1d(size, freqdomain, timedomain,
70 p_forward = fftw_plan_dft_r2c_1d(size, timedomain, freqdomain,
73 ExistsPlanReverse =
true;
74 ExistsPlanForward =
true;