---
name: "Math::GSL::Wavelet"
section: "3pm"
platform: "linux"
package: "libmath-gsl-perl"
version: "0.45-2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Math::GSL::Wavelet"
---

# Math::GSL::Wavelet(3pm)

1-D (Real) Wavelets

## NAME

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

## SYNOPSIS

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

## DESCRIPTION

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

- gsl\_wavelet\_free($w)

  This function frees the wavelet object `$w`.

- "gsl\_wavelet\_name"

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

- gsl\_wavelet\_workspace\_free($work)

  This function frees the allocated workspace work.

- "gsl\_wavelet\_transform"

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

  ```
      (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})
  ```

  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.

- "gsl\_wavelet\_transform\_inverse"

  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.

- $gsl\_wavelet\_haar

  - $gsl\_wavelet\_haar\_centered

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

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

## AUTHORS

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

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