<<

Laboratory in Oceanography: and Methods Analysis (Brief Intro - a.k.a., don’t get your hopes up!)

MAR550, Spring 2020 Miles A. Sundermeyer

Sundermeyer MAR 550 Spring 2020 1 Wavelet Analysis

Wavelet Toolbox • Functions and applications for analyzing and synthesizing signals and images • Assess how spectral features evolve over time, identify common time-varying patterns in signals, and perform time-localized filtering • Analyze signals and images to detect change points, discontinuities and other events • Sparse representation of data, useful for removing or compressing data while retaining key features

DWT vs. CWT Discrete wavelet transforms good for de-noising, sparse representations of data; continuous good for detailed time- analysis or precise location of transient signals

Note – significant contributions to Matlab’s functionality is from Jonathan Lilly of NWRA – see jlab toolbox for more info and to get a free basic implementation of various wavelet transform analysis tools: http://jmlilly.net/software.html Sundermeyer MAR 550 Spring 2020 2 Wavelet Analysis What is a “Wavelet?”

Time-Frequency Wavelet Features Name Domain

Can vary two Generalized parameters to change 'morse' (default) Morse Wavelet time and frequency spread

Analytic Morlet Equal in time 'amor' (Gabor) Wavelet and frequency

Wider variance in time, Bump Wavelet narrower variance in 'bump' frequency

See also: https://www.mathworks.com/help/wavelet/gs/choose-a-wavelet.html

Sundermeyer MAR 550 Spring 2020 3 Wavelet Analysis Example: Analyze combined time/frequency content of a signal (see https://www.mathworks.com/help/wavelet/examples/practical-introduction-to-continuous-analysis.html)

>>Fs = 1/(diff(t)); >>[cfs,f] = cwt(hyperbolchirp,Fs); >>helperHyperbolicChirpPlot(cfs,f,t)

>>pspectrum(hyperbolchirp,2048,'')

Wavelet transform yields better time resolution at higher and better frequency resolution at lower frequencies.

Sundermeyer MAR 550 Spring 2020 4 Wavelet Analysis Example: Analyze combined time/frequency content of a signal (see https://www.mathworks.com/help/wavelet/examples/practical-introduction-to-continuous-analysis.html)

Sundermeyer MAR 550 Spring 2020 5 Wavelet Analysis Example: Multi-resolution analysis (MRA) – Identifying time varying signals as a function of frequency and time (see https://www.mathworks.com/help/wavelet/examples/practical-introduction-to-multiresolution-analysis.html) >>xdft = fft(x); >>Fs = 1e3; >>N = numel(x); >>t = 0:1/Fs:1-1/Fs; >>xdft = xdft(1:numel(xdft)/2+1); >>comp1 = cos(2*pi*200*t).*(t>0.7); >>freq = 0:Fs/N:Fs/2; >>comp2 = cos(2*pi*60*t).*(t>=0.1 & t<0.3); >>plot(freq,20*log10(abs(xdft))) >>trend = sin(2*pi*1/2*t); >>xlabel('Cycles/second'); >>rng default wgnNoise = 0.4*randn(size(t)); >>ylabel('dB') >>x = comp1+comp2+trend+wgnNoise; >>plot(t,x) >>xlabel('Seconds') >>ylabel('Amplitude')

>>cwt(x,Fs)

Sundermeyer MAR 550 Spring 2020 6 Wavelet Analysis Example: Multi-resolution analysis (MRA) – Identifying time varying signals as a function of frequency and time (cont’d)

>>mra = modwtmra(modwt(x,8)); >>helperMRAPlot(x,mra,t,'wavelet','Wavelet MRA',[2 3 4 9])

• MRA partitions time-freq domain

• Can also do this more formally via empirical decomposition (EMD)

• See also variational mode decomposition (VMD)

Sundermeyer MAR 550 Spring 2020 7 Wavelet Analysis Example: Removing Noise from abruptly time varying signals (see https://www.mathworks.com/help/wavelet/examples/multivariate-wavelet-denoising.html)

Sundermeyer MAR 550 Spring 2020 8