Grayson HayNotes from the gardenHome

Continuous Wavelet Transform (CWT) of 1-D Signals using Python and MATLAB

AI-generated

Source page

AI

AI-generated summary

Cat. no.

Grayson Hay Notes

This note

Written by Grayson Hay

Summarized by AI. Not written or verified by the author.

  • Seedling
  • Budding
  • Evergreen

Cites

Sources summarized by AI, not by the author

In maps

Backlinks 1 Links out

Tended

AI-generated summary of Continuous Wavelet Transform (CWT) of 1-D Signals using Python and MATLAB, Exploring Technologies. Not written or verified by the author.

Takeaways: Continuous Wavelet Transform (CWT) of 1-D Signals using Python and MATLAB

2022-03-04 · 35:59 · Source: https://www.youtube.com/watch?v=qoMDpSatG7M · Exploring Technologies

Gist

A recap of CWT theory, then a code walkthrough in Python (PyWavelets) and MATLAB. The CWT slides a wavelet along a signal at many scales and arranges the coefficients by time and scale into a scalogram. Small scales squeeze the wavelet and catch fast detail. Large scales stretch it and catch slow detail. Unlike a Fourier spectrum, the scalogram shows when a change happens, so the demos plant discontinuities in a cosine and find them in the plot. The lecturer also saves the scalogram as a 512×512 RGB image to feed a deep neural network, and explains the cone of influence: the edge region where coefficients can't be trusted.

All claims are the lecturer's. Summarized from YouTube auto-captions, which garble terms: "model at" / "marlette" for Morlet, "scalar gram" / "kilogram" / "skelogram" for scalogram, "fair blades" for wavelets, "hatch effect" for edge effect, "simlet5" for (likely) sym5. Slides and code not seen, so code details come from narration only. The lecturer points to their own earlier intro video on wavelet theory, not read here. Notes marked (mine) are mine. (checked) marks claims checked against the PyWavelets or MathWorks docs.

Takeaways

Theory recap

Applications

Python: PyWavelets

Demo 1: a cosine distorted by two exponentials, Gaussian wavelet, scales 1 to 31.

Demo 2: a 10 ms cosine at 44.1 kHz with samples 87 to 89 forced to zero, scales 1 to 21, copper colormap. The output shows discontinuities at 2 ms and 7 ms, and both line up in the scalogram. The captions only describe the first (sample 87 ÷ 44,100 Hz ≈ 2 ms). (mine) How the 7 ms break is made isn't narrated.

MATLAB: two cwt functions

MATLAB picks between an older and a newer cwt based on the arguments you pass.

OlderNewer
Inputssignal, scales, wavelet name, 'plot'signal, wavelet name, sampling frequency or sampling period
ScalesYou give themMATLAB picks them automatically
Outputcoefficients, frequencies; auto-plots scalogramcoefficients, plus frequencies or periods depending on input
WaveletsMany (demo uses sym5, scales 1 to 200, default colormap pink)Only Morse (default), Morlet (amor), bump

Saving the scalogram as an image: rescale the coefficients to 0 to 1, convert with im2uint8, map to RGB with a colormap, then write scalogram.jpg at 512×512. This lets you turn a set of 1-D signals into scalogram images for DNN training.

Cone of influence (COI)

Patterns