diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-05 00:01:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-05 00:01:18 +0000 |
commit | 42995d7bf396933ee60c5f89c354ea89cf13df0d (patch) | |
tree | cfdcea0ac57420e7baf570bfe435e107bb842541 /flow/fft.c | |
download | arts-42995d7bf396933ee60c5f89c354ea89cf13df0d.tar.gz arts-42995d7bf396933ee60c5f89c354ea89cf13df0d.zip |
Copy of aRts for Trinity modifications
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/arts@1070145 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'flow/fft.c')
-rw-r--r-- | flow/fft.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/flow/fft.c b/flow/fft.c new file mode 100644 index 0000000..15c821f --- /dev/null +++ b/flow/fft.c @@ -0,0 +1,32 @@ +#include "gsl/gslfft.h" +#include "fft.h" + +void arts_fft_float ( + unsigned NumSamples, + int InverseTransform, + float *RealIn, + float *ImagIn, + float *RealOut, + float *ImagOut ) +{ + double *ri_in = g_newa(double, NumSamples*4); + double *ri_out = ri_in + NumSamples*2; + unsigned int i; + + for(i = 0; i < NumSamples; i++) + { + ri_in[2*i] = RealIn[i]; + ri_in[2*i+1] = (ImagIn?ImagIn[i]:0.0); + } + + if(InverseTransform == 0) + gsl_power2_fftac (NumSamples, ri_in, ri_out); + else + gsl_power2_fftsc (NumSamples, ri_in, ri_out); + + for(i = 0; i < NumSamples; i++) + { + RealOut[i] = ri_out[2*i]; + ImagOut[i] = ri_out[2*i+1]; + } +} |