[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] mixed-radix fft

From: Sean Parsons
Subject: Re: [Help-gsl] mixed-radix fft
Date: Fri, 16 Jan 2009 15:00:22 +0000 (GMT)

Thank you Brian. I had the idea (not sure where from) that the real components 
respresented magnitude and the imaginary components phase. But this isn't the 
case is it?
 Sean Parsons
McMaster University
Intestinal Disease Research Program
1200 Main St. West, Room 3N6-9,
Ontario, L8N 3Z5.
Tel: 905-966-2540

From: Brian Gough <address@hidden>
To: Sean Parsons <address@hidden>
Cc: address@hidden
Sent: Wednesday, 14 January, 2009 11:28:49
Subject: Re: [Help-gsl] mixed-radix fft

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.


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!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]