Re: [eigen] FFT question |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] FFT question*From*: Trevor Irons <trevorirons@xxxxxxxxx>*Date*: Tue, 16 Feb 2010 20:59:14 -0700*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=SsBdEmSipcUa96dnti6v5tzNu0PwfwdbYTO9RiXIUpw=; b=VWlK3joMMm+cgiQ0NcszE3xBv5Wye+CB5z+zekBm2HrvqHNR/z7YXR/UgL2gnhEvZ2 KDhAEI17BrwW1wLi5Ka9TFEjY2cfUANxUDiuKbjeftcoVtwwxifVgw4eMoXMdfLUD4Xt 9UgOJdNBfxtmZGi++DBof+MDk2+DmvDRGvQsM=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MPYLCPRjKkTX5bdGb7V5OSwh+G4BlzxUyWHj/kP7vEsttNHLWSECDH/JWxmiIyxFH+ i+cmMUhedm6Bd5dwZhE4I4bszq7aMDbT3o+F7SWU38kUyZXZ8+CRA0HHpaPA2/5Ir0Sa Wld9TQ4Xi83eAobXrzhsVl8cf2+XHRqArsQdk=

Thanks so much.

On 16 February 2010 20:07, Mark Borgerding <mark@xxxxxxxxxxxxxx> wrote:

Should be better now.

On 02/16/2010 11:49 AM, Mark Borgerding wrote:

It works when I use the raw pointer methods of FFT. It is something in the Eigen matric functions. I should have a fix in the next day or so.

-- Mark

Trevor Irons wrote:

Mark and others:

I'm trying to get the KISS FFT working for me, but am struggling a little with the Real to Complex and back case. I suspect I'm misusing it somehow, I based this off the tests. The Complex to Complex fwd and inv (Full Spectrum) are working with similar logic.

The forward operation seems to be accurate, but how do I do the inverse on 1/2 spectrum. If I don't remove the flag, I get a lot of errors at runtime (compiles fine):

g++ on 64 bit linux

*** glibc detected *** ./min: free(): invalid next size (normal): 0x0000000000da6790 ***

======= Backtrace: =========

/lib/libc.so.6[0x7fc8a700cdd6]

/lib/libc.so.6(cfree+0x6c)[0x7fc8a701174c]

If I do remove the flag, thinking that maybe since the buffer is double, it will know it is a complex to real transform, but the answer is wrong.

If a do a full spectrum all is happy.

What am I doing wrong? If possible I'd like to just use the 1/2 spectrum. Thanks for any insight, really glad to have this out of the box like this.

#include "Eigen/Core"

#include "unsupported/Eigen/FFT"

#include <complex>

typedef std::complex<double> Complex;

using namespace Eigen;

using namespace std;

int main() {

FFT<double> fft;

double dt(1e-3);

VectorXd timeseries(200);

VectorXcd fd(200);

for (int i=0; i<200; ++i) {

timeseries[i] = std::sin((double)(i)*dt*95.);

}

fft.SetFlag(fft.HalfSpectrum );

fft.fwd(fd, timeseries);

VectorXd out;

// faults if I don't remove, wrong answer if I do

fft.ClearFlag(fft.HalfSpectrum );

fft.inv(out, fd);

for (int i=0; i< out.size(); ++i) {

cout << timeseries[i] << "\t" << out[i] << endl;

}

}

**References**:**[eigen] FFT question***From:*Trevor Irons

**Re: [eigen] FFT question***From:*Mark Borgerding

**Re: [eigen] FFT question***From:*Mark Borgerding

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] FFT question** - Next by Date:
**[eigen] eigen based splines** - Previous by thread:
**Re: [eigen] FFT question** - Next by thread:
**Re: [eigen] Re: meeting in February?**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |