https://github.com/shamazmazum/cl-wavelets
Wavelet transform library
https://github.com/shamazmazum/cl-wavelets
dwt pwt wavelet-transform
Last synced: 2 months ago
JSON representation
Wavelet transform library
- Host: GitHub
- URL: https://github.com/shamazmazum/cl-wavelets
- Owner: shamazmazum
- License: bsd-2-clause
- Created: 2020-01-03T07:51:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-23T05:31:35.000Z (almost 3 years ago)
- Last Synced: 2025-02-09T10:11:18.369Z (4 months ago)
- Topics: dwt, pwt, wavelet-transform
- Language: Common Lisp
- Size: 705 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cl-wavelets
===========
[](https://cirrus-ci.com/github/shamazmazum/cl-wavelets)
**cl-wavelets** is a library with a set of algorithms related to
various kinds of wavelet transform. Currently they all work with
arrays of type `(simple-array (signed-byte 32) (*))` (i.e. they are
1D). This makes this library suitable for audio processing and
compression. For more info visit the project page
[here](http://shamazmazum.github.io/cl-wavelets).Currently supported algorithms:
* DWT
* Frequency analysis using PWT.
* Best-basis PWT.Currently supported wavelets:
* Haar wavelet
* CDF (2,2) wavelet
* CDF (3,1) wavelet
* CDF (4,2) wavelet### Usage
In examples:
~~~~
(wavelets:dwt (make-array 8
:element-type '(signed-byte 32)
:initial-contents '(0 1 2 3 4 5 7 8))
:wavelet :cdf-2-2
:boundary-style :mirror)
#(2 4 0 3 0 0 0 1)(wavelets:dwt-inverse *
:wavelet :cdf-2-2
:boundary-style :mirror)
#(0 1 2 3 4 5 7 8)
~~~~Generally, there are two kinds of functions: with `!` at the end and without
`!`. Whose with `!` are in-place functions, in other words they modify their
first argument. Whose without `!` do not modify their first argument.For more info, generate a documentation with **codex** like so:
`codex:document :cl-wavelets :skip-unsocumented t`.### Examples package
You can load `cl-wavelets/examples` system which contains packages to
demonstrate some components of this library. For example, you can
build a spectrogram of an uncompressed WAV file making use of
`wavelets:frequency-domain` function. To build a spectrogram, try this:
~~~~
(wavelets-spectrogram:spectrogram "/path/to/audio.wav"
"/path/to/spectrogram.jpg")
~~~~
This will produce `spectrogram.jpg` image with the spectrogram. Note,
that the time axis is the vertical one, with the time going
up-down. This is a spectrogram rotated by 90 degrees clockwise,
actually. Also, the quality of the spectrogram will be much worse
compared to the qualily of a spectrogram obtained via FFT. This is
because the filters used in the process are far from ideal.