Math::...avelet(3pm)
π Math::GSL::Wavelet(3pm) π
okay bestie, gather round, because today we're talking about Math::GSL::Wavelet β it's the Perl wrapper for 1-D (Real) Wavelets and honestly? it's giving math girlboss energy. π¦
this page is from the User Contributed Perl Documentation, and it's all about allocating wavelets, transforming your data, and then putting it back together again. no cap.
β¨ SYNOPSIS β¨
just one line and it's a baddie:
use Math::GSL::Wavelet qw/:all/;
import everything, we don't gatekeep here π
πΈ DESCRIPTION πΈ
gsl_wavelet_alloc($T, $k)
this one allocates and initializes a whole wavelet object of type $T. and what is $T, you ask? it has to be one of the constants listed further down, no substitutions π
ββοΈ and the parameter $k picks which specific member of that wavelet family you're getting. so like, $T says which family and $k says which sibling. slay.
gsl_wavelet_free($w)
frees the wavelet object $w. say thank u and let it go π«Ά
gsl_wavelet_name
okay so this one is literally just chillin' there in the docs with no description attached. iconic in a mysterious way. π
gsl_wavelet_workspace_alloc($n)
allocates a workspace for the discrete wavelet transform. here's the deal:
- to do a one-dimensional transform on
$nelements, you need a workspace of size$n. that's it, that's the requirement. - for two-dimensional transforms of
$n-by-$nmatrices? you only need a workspace of size$n, because the transform operates on individual rows and columns. so much cheaper than you'd think, we love an efficient queen β¨
gsl_wavelet_workspace_free($work)
frees the allocated workspace work. bye babe π
gsl_wavelet_transform
also listed here with zero description. she's quiet, she's mysterious, she's there. π
gsl_wavelet_transform_forward($w, $data, $stride, $n, $work)
okay THIS is the main character. π₯ these 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. no exceptions bestie, it's giving strict.
for the forward transform, the elements of the original array get replaced by the discrete wavelet transform:
f_i -> w_{j,k}
in a packed triangular storage layout, where:
jis the index of the level,j = 0 ... J-1kis the index of the coefficient within each level,k = 0 ... (2^j)-1- the total number of levels is
J = \log_2(n)
and the output data has this exact form:
(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})
sooo the very first element is the smoothing coefficient s_{-1,0}, and then come all the detail coefficients d_{j,k} for each level j. π«
the backward transform inverts these coefficients to get your original data back. it's giving reversible, it's giving restore-from-backup, we love a round trip. π
these functions return a status of $GSL_SUCCESS when everything goes off without a hitch. but $GSL_EINVAL gets returned if:
$nis not an integer power of 2, or- insufficient workspace is provided
so like, double-check your args before you come crying to me π
gsl_wavelet_transform_inverse
another one just vibing in the list with no writeup. noted. β
π§ the constants π§
this module also contains the following constants, with their valid k value for the gsl_wavelet_alloc function:
$gsl_wavelet_daubechies$gsl_wavelet_daubechies_centered
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. so like, 4, 6, 8... you get it, all the even girlies. π
$gsl_wavelet_haar$gsl_wavelet_haar_centered
this is the Haar wavelet. and the only valid choice of k for Haar is k=2. one option only, no choices, she said what she said. π
$gsl_wavelet_bspline$gsl_wavelet_bspline_centered
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
(yes, exactly like that β I'm not touching a single character of the source, not even the missing comma, that's the author's business π)
π AUTHORS π
Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
shoutout to the devs, absolute legends, fr fr π«Ά
π 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.
so like, go wild, but under Perl's terms. legal bestie behavior only. π
and that's the whole page, no notes β¨
this lil' manual page ships with perl v5.42.3 and is dated 2026-08-20 β go forth and wavelet, babe ππΈπ¦
π¦ where this page comes from
- ubuntu stonking: libmath-gsl-perl 0.49-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms