At Thu, 8 Jan 2009 19:06:11 +0000 (GMT), Sean Parsons wrote: > However I noticed that the "halfcomplex" output of gsl_fft_real_transform is > different according to whether the no. of samples (nsample) is a power of two > or not. With nsample a power of 2, I get a sensible result, but with nsample > not a power of two I get rubbish. > > I have illustrated this with the program below (also attached). I input a sum > of three sine waves. With nsample = 4096 I get three nice peaks at the > correct frequencies, but with nsample = 5000, I get just a sequence of small > values. > > Could you help me? I realise that upon the reverse transform, I get my > original data, whether nsample = 4096 or 5000. But I need to know how the > forward transformed data is represented so I can apply filters. >
Hello, Your program is missing the imaginary components (real components are at index 2*i-1 and imaginary at 2*i). If you look at these you will find the three peaks. The manual has a description of the layout in the section "Mixed-radix FFT routines for real data" -- Brian Gough (GSL Maintainer) Support freedom by joining the FSF! http://www.fsf.org/associate/support_freedom/join_fsf?referrer=37 _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
