Adding basic FFT example
[Math-GSL.git] / FFT.i
blob1d5c8c614828666f6b4606afe043f097f286d9d1
1 %module "Math::GSL::FFT"
2 %include "typemaps.i"
3 %include "gsl_typemaps.i"
6 %typemap(argout) (double data[], const size_t stride, const size_t n) {
7 int i=0;
8 AV* tempav = newAV();
10 while( i < $3 ) {
11 av_push(tempav, newSVnv((double) $1[i]));
12 i++;
15 $result = sv_2mortal( newRV_noinc( (SV*) tempav) );
16 argvi++;
19 %typemap(argout) (gsl_complex_packed_array data[], const size_t stride, const size_t n) {
20 int i=0;
21 AV* tempav = newAV();
23 while( i < 2*$3 ) {
24 av_push(tempav, newSVnv((double) $1[i]));
25 i++;
28 $result = sv_2mortal( newRV_noinc( (SV*) tempav) );
29 argvi++;
33 #include "gsl/gsl_fft.h"
34 #include "gsl/gsl_fft_complex.h"
35 #include "gsl/gsl_fft_halfcomplex.h"
36 #include "gsl/gsl_fft_real.h"
37 #include "gsl/gsl_complex.h"
40 %include "gsl/gsl_complex.h"
41 %include "gsl/gsl_fft.h"
42 %include "gsl/gsl_fft_complex.h"
43 %include "gsl/gsl_fft_halfcomplex.h"
44 %include "gsl/gsl_fft_real.h"
46 %perlcode %{
47 @EXPORT_complex = qw/
48 gsl_fft_complex_radix2_forward
49 gsl_fft_complex_radix2_backward
50 gsl_fft_complex_radix2_inverse
51 gsl_fft_complex_radix2_transform
52 gsl_fft_complex_radix2_dif_forward
53 gsl_fft_complex_radix2_dif_backward
54 gsl_fft_complex_radix2_dif_inverse
55 gsl_fft_complex_radix2_dif_transform
56 gsl_fft_complex_wavetable_alloc
57 gsl_fft_complex_wavetable_free
58 gsl_fft_complex_workspace_alloc
59 gsl_fft_complex_workspace_free
60 gsl_fft_complex_memcpy
61 gsl_fft_complex_forward
62 gsl_fft_complex_backward
63 gsl_fft_complex_inverse
64 gsl_fft_complex_transform
66 @EXPORT_halfcomplex = qw/
67 gsl_fft_halfcomplex_radix2_backward
68 gsl_fft_halfcomplex_radix2_inverse
69 gsl_fft_halfcomplex_radix2_transform
70 gsl_fft_halfcomplex_wavetable_alloc
71 gsl_fft_halfcomplex_wavetable_free
72 gsl_fft_halfcomplex_backward
73 gsl_fft_halfcomplex_inverse
74 gsl_fft_halfcomplex_transform
75 gsl_fft_halfcomplex_unpack
76 gsl_fft_halfcomplex_radix2_unpack
78 @EXPORT_real = qw/
79 gsl_fft_real_radix2_transform
80 gsl_fft_real_wavetable_alloc
81 gsl_fft_real_wavetable_free
82 gsl_fft_real_workspace_alloc
83 gsl_fft_real_workspace_free
84 gsl_fft_real_transform
85 gsl_fft_real_unpack
87 @EXPORT_vars = qw/
88 $gsl_fft_forward
89 $gsl_fft_backward
91 @EXPORT_OK = (
92 @EXPORT_real,
93 @EXPORT_complex,
94 @EXPORT_halfcomplex,
95 @EXPORT_vars,
97 %EXPORT_TAGS = (
98 all => \@EXPORT_OK,
99 real => \@EXPORT_real,
100 complex => \@EXPORT_complex,
101 halfcomplex => \@EXPORT_halfcomplex,
102 vars => \@EXPORT_vars,
104 __END__
106 =head1 NAME
108 Math::GSL::FFT - Functions for performing Fast Fourier Transforms (FFT)
110 =head1 SYNOPSIS
112 use Math::GSL::FFT qw /:all/;
114 =head1 DESCRIPTION
116 Here is a list of all the functions in this module :
118 =over
120 =item * C<gsl_fft_complex_radix2_forward >
122 =item * C<gsl_fft_complex_radix2_backward >
124 =item * C<gsl_fft_complex_radix2_inverse >
126 =item * C<gsl_fft_complex_radix2_transform >
128 =item * C<gsl_fft_complex_radix2_dif_forward >
130 =item * C<gsl_fft_complex_radix2_dif_backward >
132 =item * C<gsl_fft_complex_radix2_dif_inverse >
134 =item * C<gsl_fft_complex_radix2_dif_transform >
136 =item * C<gsl_fft_complex_wavetable_alloc >
138 =item * C<gsl_fft_complex_wavetable_free >
140 =item * C<gsl_fft_complex_workspace_alloc >
142 =item * C<gsl_fft_complex_workspace_free >
144 =item * C<gsl_fft_complex_memcpy >
146 =item * C<gsl_fft_complex_forward >
148 =item * C<gsl_fft_complex_backward >
150 =item * C<gsl_fft_complex_inverse >
152 =item * C<gsl_fft_complex_transform >
154 =item * C<gsl_fft_halfcomplex_radix2_backward >
156 =item * C<gsl_fft_halfcomplex_radix2_inverse >
158 =item * C<gsl_fft_halfcomplex_radix2_transform >
160 =item * C<gsl_fft_halfcomplex_wavetable_alloc >
162 =item * C<gsl_fft_halfcomplex_wavetable_free >
164 =item * C<gsl_fft_halfcomplex_backward >
166 =item * C<gsl_fft_halfcomplex_inverse >
168 =item * C<gsl_fft_halfcomplex_transform >
170 =item * C<gsl_fft_halfcomplex_unpack >
172 =item * C<gsl_fft_halfcomplex_radix2_unpack >
174 =item * C<gsl_fft_real_radix2_transform >
176 =item * C<gsl_fft_real_wavetable_alloc >
178 =item * C<gsl_fft_real_wavetable_free >
180 =item * C<gsl_fft_real_workspace_alloc >
182 =item * C<gsl_fft_real_workspace_free >
184 =item * C<gsl_fft_real_transform >
186 =item * C<gsl_fft_real_unpack >
188 =back
190 This module also includes the following constants :
192 =over
194 =item * C<$gsl_fft_forward>
196 =item * C<$gsl_fft_backward>
198 =back
200 For more informations on the functions, we refer you to the GSL offcial
201 documentation: L<http://www.gnu.org/software/gsl/manual/html_node/>
203 Tip : search on google: site:http://www.gnu.org/software/gsl/manual/html_node/ name_of_the_function_you_want
206 =head1 AUTHORS
208 Jonathan Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
210 =head1 COPYRIGHT AND LICENSE
212 Copyright (C) 2008 Jonathan Leto and Thierry Moisan
214 This program is free software; you can redistribute it and/or modify it
215 under the same terms as Perl itself.
217 =cut