File: Wavelet.pod

package info (click to toggle)
libmath-gsl-perl 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192,156 kB
  • sloc: ansic: 895,524; perl: 24,682; makefile: 12
file content (141 lines) | stat: -rw-r--r-- 3,689 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
%perlcode %{

@EXPORT_OK = qw/
    gsl_wavelet_alloc
    gsl_wavelet_free
    gsl_wavelet_name
    gsl_wavelet_workspace_alloc
    gsl_wavelet_workspace_free
    gsl_wavelet_transform
    gsl_wavelet_transform_forward
    gsl_wavelet_transform_inverse
    $gsl_wavelet_daubechies
    $gsl_wavelet_daubechies_centered
    $gsl_wavelet_haar
    $gsl_wavelet_haar_centered
    $gsl_wavelet_bspline
    $gsl_wavelet_bspline_centered
/;


%EXPORT_TAGS = ( all => [ @EXPORT_OK ], );

=encoding utf8

=head1 NAME

Math::GSL::Wavelet - 1-D (Real) Wavelets

=head1 SYNOPSIS

    use Math::GSL::Wavelet qw/:all/;

=cut

=head1 DESCRIPTION

=over 1

=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.

=item C<gsl_wavelet_free($w)>

This function frees the wavelet object $w.

=item C<gsl_wavelet_name>

=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.

=item C<gsl_wavelet_workspace_free($work)>

This function frees the allocated workspace work.

=item C<gsl_wavelet_transform>

=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,

=over

    (s_{-1,0}, d_{0,0}, d_{1,0}, d_{1,1}, d_{2,0}, ..., d_{j,k}, ..., d_{J-1,2^{J-1}-1})

=back

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.

=item C<gsl_wavelet_transform_inverse>

=back

This module also contains the following constants with their valid k value for
the gsl_wavelet_alloc function :

=over 1

=item $gsl_wavelet_daubechies

=item $gsl_wavelet_daubechies_centered

=back

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.

=over 1

=item $gsl_wavelet_haar

=item $gsl_wavelet_haar_centered

=back

This is the Haar wavelet. The only valid choice of k for the Haar wavelet is k=2.

=over 1

=item $gsl_wavelet_bspline

=item $gsl_wavelet_bspline_centered

=back

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.

=head1 AUTHORS

Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2008-2024 Jonathan "Duke" Leto and Thierry Moisan

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut
%}