1 %module
"Math::GSL::Wavelet"
2 %include
"gsl_typemaps.i"
4 #include
"gsl/gsl_types.h"
5 #include
"gsl/gsl_wavelet.h"
10 %include
"gsl/gsl_types.h"
11 %include
"gsl/gsl_wavelet.h"
23 gsl_wavelet_workspace_alloc
24 gsl_wavelet_workspace_free
26 gsl_wavelet_transform_forward
27 gsl_wavelet_transform_inverse
28 $gsl_wavelet_daubechies
29 $gsl_wavelet_daubechies_centered
31 $gsl_wavelet_haar_centered
33 $gsl_wavelet_bspline_centered
37 %EXPORT_TAGS
= ( all
=> [ @EXPORT_OK
], );
41 Math
::GSL
::Wavelet
- wavelets for real data in one dimension
45 use Math
::GSL
::Wavelet qw
/:all
/;
51 Here is a list of all the functions included in this module
:
55 =item C
<gsl_wavelet_alloc
($T
, $k
)> - This function allocates and initializes a wavelet object of type $T
, where $T must be one of the constants below. The parameter $k selects the specific member of the wavelet family.
57 =item C
<gsl_wavelet_free
($w
)> - This function frees the wavelet object $w.
59 =item C
<gsl_wavelet_name
>
61 =item C
<gsl_wavelet_workspace_alloc
($n
)> - This function allocates a workspace for the discrete wavelet transform. To perform a one-dimensional transform on $n elements
, a workspace of size $n must be provided. For two-dimensional transforms of $n-by-$n matrices it is sufficient to allocate a workspace of size $n
, since the transform operates on individual rows and columns.
63 =item C
<gsl_wavelet_workspace_free
($work
)> - This function frees the allocated workspace work.
65 =item C
<gsl_wavelet_transform
>
67 =item C
<gsl_wavelet_transform_forward
($w
, $data
, $stride
, $n
, $work
)> - This functions compute in-place forward discrete wavelet transforms of length $n with stride $stride on the array $data. The length of the transform $n is restricted to powers of two. For the forward transform
, the elements of the original array are replaced by the discrete wavelet transform f_i
-> w_
{j
,k
} in a packed triangular storage layout
, where j is the index of the level j
= 0 ... J-1 and k is the index of the coefficient within each level
, k
= 0 ...
(2^j
)-1. The total number of levels is J
= \log_2
(n
). The output data has the following form
,
71 =item
(s_
{-1,0}, d_
{0,0}, d_
{1,0}, d_
{1,1}, d_
{2,0}, ...
,
73 =item d_
{j
,k
}, ...
, d_
{J-1
,2^
{J-1
}-1})
77 where the first element is the smoothing coefficient s_
{-1,0}, followed by the detail coefficients d_
{j
,k
} for each level j. The backward transform inverts these coefficients to obtain the original data. These functions return a status of $GSL_SUCCESS upon successful completion. $GSL_EINVAL is returned if $n is not an integer power of
2 or if insufficient workspace is provided.
79 =item C
<gsl_wavelet_transform_inverse
>
83 This module also contains the following constants with their valid k value for the gsl_wavelet_alloc function
:
87 =item $gsl_wavelet_daubechies
89 =item $gsl_wavelet_daubechies_centered
93 This is the Daubechies wavelet family of maximum phase with k
/2 vanishing moments. The implemented wavelets are k
=4, 6, ...
, 20, with k even.
97 =item $gsl_wavelet_haar
99 =item $gsl_wavelet_haar_centered
103 This is the Haar wavelet. The only valid choice of k for the Haar wavelet is k
=2.
107 =item $gsl_wavelet_bspline
109 =item $gsl_wavelet_bspline_centered
113 This is the biorthogonal B-spline wavelet family of order
(i
,j
). The implemented values of k
= 100*i
+ j are
103, 105, 202, 204, 206, 208, 301, 303, 305 307, 309.
117 Jonathan Leto
<jonathan@leto.net
> and Thierry Moisan
<thierry.moisan@gmail.com
>
119 =head1 COPYRIGHT
AND LICENSE
121 Copyright
(C
) 2008 Jonathan Leto and Thierry Moisan
123 This program is free software
; you can redistribute it and
/or modify it
124 under the same terms as Perl itself.