cl-wavelets ยป Spectrogram

For demonstration purposes, there is spectrogram function in wavelets-spectrogram package, which can be loaded with asdf like so: (asdf:load-system :cl-wavelets/examples). This function can produce a spectrogram of an uncompressed wav file (it uses only the first channel).

spectrogram(filename-wav filename-jpg &key (w 600) (h 800) (block-length *block-length*) (wavelet *wavelet*))

Build a spectrogram for the first channel of an audio file in WAV format with the name filename-wav. The spectrogram is written as a jpeg image with the name filename-jpg. w and h parameters define dimensions of the image.

The spectrogram is built using frequency-domain function with data block of length block-length each constructed from the input data. Wavelet wavelet is used in the PWT algorithm.

*wavelet*
Wavelet used for spectrogram calculation. NB: :cdf-4-2 works very bad, do not use it. :cdf-2-2 is the best choice.
*block-length*
The size of data chunks the input signal is divided to before PWT is performed. Must be a power of 2.

Here is some examples of histograms with decription (all of them are obtained using CDF-2-2 wavelet):

Band-limited saw up-chirp signal. You can see five harmonics here.

One sine up-chirp and one sine down-chirp.