forum.alglib.net http://forum.alglib.net/ |
|
FFT error http://forum.alglib.net/viewtopic.php?f=2&t=733 |
Page 1 of 1 |
Author: | spirid [ Sun Nov 25, 2012 8:29 am ] |
Post subject: | FFT error |
Code: alglib.complex[] z = new alglib.complex[xint.LongLength]; // xint - array sources data (2048 samples) Help me, please
alglib.complex f = z[0]; alglib.fft.fftr1d(xint, xint.LongLength, f); // Error in IDE Visual Studio |
Author: | Sergey.Bochkanov [ Mon Nov 26, 2012 4:56 am ] |
Post subject: | Re: FFT error |
Last parameter of fftr1d must be complex array passed as out-parameter. Does it solves your problem? |
Author: | spirid [ Tue Nov 27, 2012 7:35 am ] |
Post subject: | Re: FFT error |
Corrected the code: alglib.fft.fftr1d(xint, 2048, ref z); and the error disappeared. Now I do not know how to get out of the complex (z) real (Rez) and imaginary (Imz) parts for the amplitude spectrum to build. |
Author: | Sergey.Bochkanov [ Tue Nov 27, 2012 10:25 am ] |
Post subject: | Re: FFT error |
Z[j].x stores real part, Z[j].y stores imaginary part. J-th element of Z is equal to SUM(X[k]*exp(-2*pi*sqrt(-1)*j*k/N), k = 0..N-1) (expression is given to distinguish between different kinds of FFT) |
Author: | spirid [ Tue Nov 27, 2012 7:23 pm ] |
Post subject: | Re: FFT error |
Thanks a lot! After correcting the code it work properly! |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |